Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ab 4: Power of the Chi-Squared Test Building on what we have learned recently about power of hypothesis tests, we are going to take a

ab 4: Power of the Chi-Squared Test Building on what we have learned recently about power of hypothesis tests, we are going to take a look at the power of the chi-squared test for association between two binary variables. Following some of the examples we have seen, we'll generically call the two variables exposure and disease. To start, your group should simulate a data table based on n = 100 individuals, where each individual has the following probabilities of falling into each cell. Exposure Y N Disease Y 0.15 0.10 N 0.45 0.30 You can simulate the dataset using the commands mydata <- matrix(rmultinom(1, size=100, prob=c(0.15, 0.45, 0.1, 0.3)), nrow=2) mydata The rmultinom function in R simulates random draws from the multinomial distribution, which generalizes the binomial distribution from two categories (e.g., success/failure) to more than two categories (we need four right, for the four cells in our table). Also if you are curious about about why the rst argument we supply to the rmultinom function is a 1, this is because we seek only 1 simulated set of four counts. Now carry out the chi-squared test to see if your dataset casts doubt on the null hypothesis that exposure

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probability and Stochastic Processes A Friendly Introduction for Electrical and Computer Engineers

Authors: Roy D. Yates, David J. Goodman

3rd edition

1118324560, 978-1118324561

More Books

Students also viewed these Mathematics questions

Question

What is "Fintech"?

Answered: 1 week ago