Question: question4 Question IV Read the Stata program below clear scalar alpha = sqrt (2) scalar beta = 3. 14 scalar gamma = exp (1) capture
question4

Question IV Read the Stata program below clear scalar alpha = sqrt (2) scalar beta = 3. 14 scalar gamma = exp (1) capture postclose tom postfile fileid beta_star_hat beta_hat gamma_hat delta_hat using OVB. dta, replace set seed 1 forvalues i = 1(1) 100 { qui drop _all qui set obs 100 gen z = rnormal () gen x = z + rnormal () gen u = rnormal () gen y = alpha + x*beta + z*gammatu drop u /*save xyz. dta, replace */ quietly reg y x z,r scalar beta_hat = _b[x] scalar gamma_hat = _b[z] quietly reg y x,r scalar beta_star_hat = _b[x] quietly reg z x,r scalar delta_hat = _b[x] post fileid (beta_star_hat) (beta_hat) (gamma_hat) (delta_hat) postclose fileid use OVB . dta, clear gen bias = beta_star_hat - beta_hat gen proxy_effect = gamma_hat*delta_hat sum The sum command provides the summary statistics for each variable in the data set OVB.dta. What would you expect the mean of each variable to be? Explain. Is the mean of 'bias' close to that of 'proxy_effect'? Explain
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
