1 / 13

Analysis of Variance in Matrix form

Analysis of Variance in Matrix form. The ANOVA table sums of squares, SSTO, SSR and SSE can all be expressed in matrix form as follows…. Multiple Regression. A multiple regression model is a model that has more than one explanatory variable in it.

verne
Download Presentation

Analysis of Variance in Matrix form

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Analysis of Variance in Matrix form • The ANOVA table sums of squares, SSTO, SSR and SSE can all be expressed in matrix form as follows…. week 9

  2. Multiple Regression • A multiple regression model is a model that has more than one explanatory variable in it. • Some of the reasons to use multiple regression models are: • Often multiple X’s arise naturally from a study. • We want to control for some X’s • Want to fit a polynomial • Compare regression lines for two groups week 9

  3. Multiple Linear Regression Model • In a multiple linear regression model there are k predictor variables. • The model is • This model is linear in the β’s. The variables may be non-linear, e.g., log(X1), X1*X2 etc. • We need to estimate k +1 β’s and σ2. • There are k+2 parameters in this model and so we need at least that many observations to be able to estimate them. week 9

  4. Multiple Regression Model in Matrix Form • In matrix notation the multiple regression model is: Y=Xβ + ε where • Note, Y and ε are vectors, β is a vector and X is a matrix. • The Gauss-Markov assumptions are: E(ε) = 0, Var(ε) = σ2I. • These result in E(Y) = 0, Var(Y) = σ2I. • The Least-Square estimate of β is week 9

  5. Estimate of σ2 • The estimate of σ2 is: • It has n-k-1 degrees of freedom because… • Claim: s2 is unbiased estimator of σ2. • Proof: week 9

  6. General Comments about Multiple Regression • The regression equation gives the mean response for each combination of explanatory variables. • The regression equation will not be useful if it is very complicated or a function of large number of explanatory variables. • We generally want “parsimonious” model, that is, a model that is as simple as possible to adequately describe the response variable. • It is unwise to think that there is some exact, discoverable equation. • Many possible models are available. • One or two models may adequately approximate the mean of the response variable. week 9

  7. Example – House Prices in Chicago • Data of 26 house sales in Chicago were collected (clearly collected some time ago). The variables in the data set are: price - selling price in $1000's bdr - number of bedrooms flr - floor space in square feet fp - number of fireplaces rms - number of rooms st - storm windows (1 if present, 0 absent) lot - lot size (frontage) in feet bth - number of bathrooms gar - garage size (0=no garage, 1=one-car garage, etc.) week 9

  8. Interpreting Regression Coefficients • b0is the estimate of the mean value of Y when all the predictor variables are 0; it may be meaningless in many cases. • bj , j = 1,…, k is the estimated change in Y, on average, due to a unit increase in Xj where all the other variables held fixed. Note, that it may be impossible to hold all other variables fixed. • Example, re the home price example above, for 100 extra square feet (everything else held constant), the price goes up by $1760 on average. For one more room (everything else held constant), the price goes up by $3900 on average. For one more bedroom (everything else held constant), the price goes down by $7700 on average. week 9

  9. Residual Plots • As in the simple linear regression model, we examine 3 types of residual plots to assess the validity of the model assumptions. • The plots are: • Residual versus Xj , j = 1, …, k. We examine presence of curvature and/or influential points. • Residual versus predicted values. We use this plot to check for non-constant variance and for any outliers in residuals. • Normal quantile plot of residuals. week 9

  10. Inference for Regression Coefficients • As in simple linear regression, we are interesting in testing H0: βj = 0 versus Ha: βj≠ 0. • The test statistics is It has a t-distribution with n-k-1 degrees of freedom. • We can calculate the P-value from the t-table with n-k-1 df. • This test gives an indication of whether or not the jth predictor variable statistically significant contributes to the prediction of the response variable over and above all the other predictor variables. • Confidence interval for βj (assuming all the other predictor variables are in the model) is given by: • We can use Bonferroni correction for simultaneous CI for more than one β. week 9

  11. ANOVA Table • The ANOVA table in multiple regression model is given by… week 9

  12. Coefficient of Multiple Determination – R2 • As in simple linear regression model, R2 = SSR/SSTO. • In multiple regression this is called the “coefficient of multiple determination”; it is not the square of a correlation coefficient. • In multiple regression, R2 always goes up when more predictor variables are added to the model, regardless of whether the predictor variables are useful in estimating Y. week 9

  13. Adjusted R2 • An attempt to make R2 more useful is to calculate Adjusted R2 (“Adj R-Sq” in SAS) • Adjusted R2 is adjusted for the number of predictor variables in the model. • It can actually go down when more predictors are added. • It can be used for choosing the best model. • It is defined as • Note that Adjusted R2 will increase only is MSE decrease. week 9

More Related