Question: Write code that produces a 10,000 x 1001 matrix (rows x cols) of random numbers drawn from N(0,1). Seed your code using the last 4

  1. Write code that produces a 10,000 x 1001 matrix (rows x cols) of random numbers drawn from N(0,1). Seed your code using the last 4 digits of your phone number (this number will be different for everyone). Every time you run the code, it should now yield the exact same ("random") dataset.
  2. Treat the first column as "y" and the remaining 1000 columns as x's.
  3. Regress y on x's. Is an intercept needed? Why? Why not?
  4. Plot histogram of the p-values from the regression in Q3. What distribution does this histogram look like?
  5. How many "significant" variables do you expect to find knowing how the data was generated? How many "significant" variables does the regression yield if alpha = 0.01? What does this tell us?
  6. Given the p values you find, use the BH procedure to control the FDR with a q of 0.1. How many "true" discoveries do you estimate?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!