Question: STATA : You will solve this problem set by modifying the lines in this do file itself. There is a code needed where you see

STATA : You will solve this problem set by modifying the lines in this do file itself.

There is a code needed where you see / / ! ! \ \ in the do file. Please provide the two lines of codes

STATA : You will solve this problem set by modifying the lines

in this do file itself. There is a code needed where you

see / / ! ! \ \ in the do file. Please

322i +, 1. Consider the following regression model: 1 Yi = 6 +0.04.2011 G where 21 ~ N(10,2.52), 221~ Binomial(4, 0.47), ~ N(0,12). We are interested in running regressions of yi on our available variables, and want to understand how our t-statistics vary with sample size. In this problem, we generate data according to the distributions above and run the re- gression R = 5000 times for each specification and sample size we are interested in. This will allow us to look at the distribution of t-statistics. a) Suppose that we simulate the variables above from a sample size of N = 1000. Run the regression by filling in the code in the for loop. The for loop takes the regression you include and stores B1 (the coefficient on 01) and selfi) (the standard error of the coefficient on 21), which you will need to answer the following questions. In your * Set the number of simulations local R = 5000 Fill in the number of observations per regression in 1.a */ local n = //!!\\ here postfile id iteration beta sebeta using reg_1000, replace set seed 998876 * Set the loop to draw R samples of size n = 1000 each time forvalues i = 1/'R' { // Set the number of observations you want to draw for each iteration set obs 'n' capture drop xl x2 eps y // The gen commands will store 'n' observations under the relevant variable name. * Generate the x variables for use in the regression. gen x1 = rnormal(10, 2.5) gen x2 = rbinomial(4, 0.47) * Generate the noise term for our regression gen eps = rnormal(0,1) * Generate the outcome process. gen y = 6 + 0.04*X1 - (1/3)*x2 + eps ALTER THE REGRESSION BELOW FOR QUESTION 1 */ here quietly reg y 1/ specify regression here // Storing the count of the iteration to the local local iteration = 'i' post id( iteration') (_b[xl]) (_se[xl]) iteration 322i +, 1. Consider the following regression model: 1 Yi = 6 +0.04.2011 G where 21 ~ N(10,2.52), 221~ Binomial(4, 0.47), ~ N(0,12). We are interested in running regressions of yi on our available variables, and want to understand how our t-statistics vary with sample size. In this problem, we generate data according to the distributions above and run the re- gression R = 5000 times for each specification and sample size we are interested in. This will allow us to look at the distribution of t-statistics. a) Suppose that we simulate the variables above from a sample size of N = 1000. Run the regression by filling in the code in the for loop. The for loop takes the regression you include and stores B1 (the coefficient on 01) and selfi) (the standard error of the coefficient on 21), which you will need to answer the following questions. In your * Set the number of simulations local R = 5000 Fill in the number of observations per regression in 1.a */ local n = //!!\\ here postfile id iteration beta sebeta using reg_1000, replace set seed 998876 * Set the loop to draw R samples of size n = 1000 each time forvalues i = 1/'R' { // Set the number of observations you want to draw for each iteration set obs 'n' capture drop xl x2 eps y // The gen commands will store 'n' observations under the relevant variable name. * Generate the x variables for use in the regression. gen x1 = rnormal(10, 2.5) gen x2 = rbinomial(4, 0.47) * Generate the noise term for our regression gen eps = rnormal(0,1) * Generate the outcome process. gen y = 6 + 0.04*X1 - (1/3)*x2 + eps ALTER THE REGRESSION BELOW FOR QUESTION 1 */ here quietly reg y 1/ specify regression here // Storing the count of the iteration to the local local iteration = 'i' post id( iteration') (_b[xl]) (_se[xl]) iteration

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 Databases Questions!