Question: 2. In class we showed that in the simple linear regression model, the standard error of P1 is 62 se( B,) = ( x -

 2. In class we showed that in the simple linear regression

2. In class we showed that in the simple linear regression model, the standard error of P1 is 62 se( B,) = ( x - X ) ? I'M ( x - X ) 2 Then, using the beertemp.dta data set, we calculated se( 1) . Here is my do file: use beertemp . dta, clear reg cases temp * Calculate sigma_hat gen y_hat = _b[_cons] +_b [temp]*temp egen sum_u_hat_sq = total( (cases-y_hat) *2 ) gen sigma_hat= sqrt (sum_u_hat_sq/(26-2) ) list sum_u_hat_sq sigma_hat in 1/1 drop sum_u_hat_sq * Calculate x_bar egen sumx = total(temp) gen xbar = sumx/26 list sumx xbar in 1/1 drop sumx Calculate se(b1_hat) egen sum_x_xbar_sq = total( (temp - xbar ) *2 ) gen se_bi_hat = sigma_hat/sqrt(sum_x_xbar_sq) list sigma_hat sum_x_xbar_sq se_bi_hat in 1/1 We know from the handout "Review of Mathematical Tools" (page 1) that [ ( x - x)= = [x2 - nx2 (Note you calculate and then subtract nX" .) Hence, se( P1) is equivalently given by the following formula using this alternate way to calculate the denominator as well as taking the square root of the entire expression: se( B,) = I'M Use the data set house.dta and model (1) price =/, + Bibarms, + 4 to show that you can calculate sel 1) using this alternate, but equivalent formula. (Note because of rounding error, your answer may differ from the answer in Question 1 at the fifth or sixth decimal place.) I suggest you start by copying my commands from this question (above) into a Stata do file, then modify the commands to calculate 1 using this alternate formula using model (1) from Question 1. In your

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!