Docsity

Statistics ii, Apuntes de Estadística

Toggle sidebar
bg1
Universidad Carlos III de Madrid Departamento de Estadística
Statistics II
Computer lab 2 notes
Simple and multiple linear regressions in Excel
pf3
pf4
pf5

Vista previa parcial del texto

¡Descarga Statistics ii y más Apuntes en PDF de Estadística solo en Docsity!

Universidad Carlos III de Madrid Departamento de Estadística

Statistics II

Computer lab 2 notes

Simple and multiple linear regressions in Excel

Notes Comp Lab II 2

Statistical inference on model parameters: confidence intervals and

hypothesis testing

Once we have the regression output, we check if the model is significant, that is, if the slope coefficient is significantly different from 0. This can be checked in two places. We look at the p-value (based on the F- statistic) of the ANOVA table or the p-value of the t-test (which is equal to the F-based p-value) in the table with parameter estimates and standard errors. The p-value is very small, suggesting significance (linear) dependence of y on x. In the latter table, we can also find confidence intervals for the population intercept and the population slope (at a 95% level, unless changed). Give a 99% confidence interval for beta0 and for beta1.

Prediction interval

Once the model has been fitted, we can utilize the regression line to obtain prediction of the employment rate for a given GDP. Let’s say that the GDP per capita in one of the “Comunidades” in 2008 is 22 .1 (for example, that’s the case in Castilla y León). Assuming that the model is a good fit to the data, what would be the predicted employment rate of this “Comunidad”? Construct a corresponding 95% prediction interval. Unfortunately, “Data Analysis” does not contain an option to obtain these values directly, hence we perform the necessary calculations by hand. We use the formulas from the theory class, the regression output of Excel and include some additional calculations (e.g., the sample mean and quasi-variance of x).

Goodness-of-fit (model diagnostics)

Now, we need to verify if the model assumptions have been met. “Regression” dialog window of “Data Analysis” allows us to carry out residual analysis in which we can obtain residuals, standardized residuals, residual plot, normal probability plot. Based on the standardized residuals we can verify the presence of outliers, while the residual plot allows us to decide if the assumptions of linearity and homoscedasticity have been violated. The normal probability plot helps us to assess the normality assumption of the y variable. Based on the residual analysis, is the linear model a suitable model for the data?

Multiple linear regression model

In the last stage of the computer lab, we will incorporate second independent variable to the model, namely, percentage of the population with a university diploma, to see if it jointly explains (together with the GDP) the variability in the employment rate. To fit a multiple linear regression model, we proceed as in the simple linear regression model, except that now, in the range of the independent variable we include both columns (with the two independent variables).

Notes Comp Lab II 3 The Excel output is very similar to the one obtained above, with some additional information. In particular, the ANOVA table includes the F statistic and the corresponding p-value to assess the global significance of the model. The table with the estimates and their standard errors contains three lines: one for the intercept and two for beta1 and beta2. This allows us to decide if the coefficients are individually significant. We can see that beta1 and beta2 are statistically significant (both p-values are very small). For a “Comunidad” with the GDP of 22,1 (where 19.4% of people have university diploma), what would be an effect of an 5% increase in the percentage of people with a university diploma, on the employment rate (keeping everything else the same)?

Additional exercises

To round-up, please repeat the above analyses with the following variables (available in the 1st spreadsheet):

  • Fit again simple and multiple linear regression models to the data from 2009.^ Do you observe some significant changes in parameter estimates, compared to 2008?
  • Fit a multiple linear regression model to emplyoment on the GDP and the percentage of people with a PhD diploma for 2008. Is the model (globally) significant? Is the coefficent beta2 statistically significant?