Page 1 of 1

1. Create 2 vectors of 4000 elements. The elements are draws from a uniform distribution between 0 and 1, U(0,1). Name t

Posted: Tue Sep 07, 2021 7:44 am
by answerhappygod
1 Create 2 Vectors Of 4000 Elements The Elements Are Draws From A Uniform Distribution Between 0 And 1 U 0 1 Name T 1
1 Create 2 Vectors Of 4000 Elements The Elements Are Draws From A Uniform Distribution Between 0 And 1 U 0 1 Name T 1 (100.42 KiB) Viewed 56 times
1. Create 2 vectors of 4000 elements. The elements are draws from a uniform distribution between 0 and 1, U(0,1). Name them xi and x2. You can use runif function for random number generation. In R 2. Create the dependent variable y using the following equation. Yi = 1 * Xli – 2 * X2i +ti i = 1, ..., 4000 where e draws from a standard normal distribution, i.e., E ~ N(0,1). You can use rnorm function for random number generation. 3. Calculate OLS estimator using the formula Bols = (X'X)--(X'y) in open form N N Bols = ( x'x;)-xayi) i=1 i=1 where X = (x1, x2). (You can use the cbind() to combine xı and x2). t() for matrix transpose, solve() for matrix inverse