premiumcas.blogg.se

Simple linear regression equation from stata
Simple linear regression equation from stata










simple linear regression equation from stata

The r-squared for the regression is 0.9997, which means that the the x variable explains almost all of the variance in the dependent variable, y2. Likewise, the estimated slope coefficient is close to 8 as 8 is in the 95% confidence interval. Notice that the estimated intercept is close to 12 as 12 is in the 95% confidence interval. This precise relationship must hold as averages and expected values hold across linear expressions.ĭiscussion. Notice the mean and standard deviation of each of the y variable is exactly 12 plus 8 * (10) plus the mean of the corresponding error term. Generate three dependent variables: y2, y20, and y50 where each conforms to the regression model (i.e., y2 = 12 + 8x + e2, y20 = 12 + 8x + e20, y50 = 12 + 8x + e50).ĭiscussion. The true regression model that we will investigate takes the form y = 12 + 8x + e. In fact, notice that the mean of e2 (with a standard deviation of 2) is extremely close to the mean of e20 (which has a standard deviation of 20).

simple linear regression equation from stata

This result is expected as e2 has the smallest standard deviation, but it wouldn't have had to turn out this way. All three variable were drawn from a distribution with a mean of zero, but the mean of e2 is closer to zero than is the mean of e20 or e50. Of the three error variables e2, e20, and e50, which has a sample mean closest to its true mean? Why would you expect this?Īnswer. Notice the mean, standard deviation, minimum, and maximum for each variable. Likewise, e20 and e50 are randomly drawn observations from a normal distribution with mean 0 and standard deviation of 20 and 50 respectively.Ĭopy and paste the data into Stata. The variable e2 contains randomly drawn observations from a normal distribution with mean 0 and standard deviation of 2. The variable x can take on values between -15 and 34, with a mean of 10.

simple linear regression equation from stata

The data set contains four variables: x, e2, e20, and e50.

simple linear regression equation from stata

The data for the first part of this lab are in an Excel file: residuals.xls. Stata Lab 4: Regression Analysis Stata Lab 4: Regression Analysis












Simple linear regression equation from stata