Question: k. Bias in the data. (a) Create two correlated data vectors using the following procedure. 1. Write an R code to draw three uniformly distributed

k. Bias in the data. (a) Create two correlated data vectors using the following procedure. 1. Write an R code to draw three uniformly distributed random variables: Vi ~ U(-1,1), v2 U(0,1), and V3 U(-1,0) with 240 observations each. II. Define x1 = 2v1 + v2 and x2 = V1 + V3 You will use the data you just generated to do parts (b) through (d) (b) Generate response y using the following model: y = 1+ 2x1 + 3x2 + u where u ~ N(0,22) Estimate the following two regression models: Model A: y = BAO + BA1X1 + BA2X2 + ua + Model B: y = Bbo + BB1X1 + UB Record the coefficient estimates and their standard errors. Repeat the process 1,000 times: generate a new vector y using the same xy and x2 but drawing new values for u; use it to estimate Models A and B; record the estimates and their standard values. (c) In (b), what are your average coefficient estimates? Are they biased? (d) Compute the standard error for the coefficient estimators in (b) using your sample of 1,000 coefficient estimates (e) Compute the standard error for the coefficient estimators in (b) using your sample of 1,000 standard error estimates for the corresponding coefficients. (f) Compare the results obtained in (d) and (e) for Model A. Do the same for Model B. For each model, discuss if the results are indicative of bias. k. Bias in the data. (a) Create two correlated data vectors using the following procedure. 1. Write an R code to draw three uniformly distributed random variables: Vi ~ U(-1,1), v2 U(0,1), and V3 U(-1,0) with 240 observations each. II. Define x1 = 2v1 + v2 and x2 = V1 + V3 You will use the data you just generated to do parts (b) through (d) (b) Generate response y using the following model: y = 1+ 2x1 + 3x2 + u where u ~ N(0,22) Estimate the following two regression models: Model A: y = BAO + BA1X1 + BA2X2 + ua + Model B: y = Bbo + BB1X1 + UB Record the coefficient estimates and their standard errors. Repeat the process 1,000 times: generate a new vector y using the same xy and x2 but drawing new values for u; use it to estimate Models A and B; record the estimates and their standard values. (c) In (b), what are your average coefficient estimates? Are they biased? (d) Compute the standard error for the coefficient estimators in (b) using your sample of 1,000 coefficient estimates (e) Compute the standard error for the coefficient estimators in (b) using your sample of 1,000 standard error estimates for the corresponding coefficients. (f) Compare the results obtained in (d) and (e) for Model A. Do the same for Model B. For each model, discuss if the results are indicative of bias
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
