notes14 - Chapter 9 Model Selection and Validation Timothy...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 9 Model Selection and Validation Timothy Hanson Department of Statistics, University of South Carolina Stat 704: Data Analysis I 1 / 40 Salary example in proc glm Model salary ($1000) as function of age in years, years post-high school education (educ), & political affiliation (pol), pol = D for Democrat, pol = R for Republican, and pol = O for other. data salary; input salary age educ pol$ @@; datalines; 38 25 4 D 45 27 4 R 28 26 4 O 55 39 4 D 74 42 4 R 43 41 4 O 47 25 6 D 55 26 6 R 40 29 6 O 65 40 6 D 89 41 6 R 56 42 6 O 56 32 8 D 65 33 8 R 45 35 9 O 75 39 8 D 95 65 9 R 67 69 10 O ; options nocenter; proc glm; class pol; model salary=age educ pol / solution; run;------------------------------------------------------------- Standard Parameter Estimate Error t Value Pr > |t| Intercept 26.19002631 B 7.89909191 3.32 0.0056 age 0.89834968 0.19677236 4.57 0.0005 educ 1.50394642 1.18414843 1.27 0.2263 pol D-9.15869409 B 4.84816554-1.89 0.0814 pol O-25.69911504 B 4.75120999-5.41 0.0001 pol R 0.00000000 B . . . The model is Y i = + 1 age i + 2 educ i | {z } 2 continuous + 31 I { pol i = D } + 32 I { pol i = O } + 33 I { pol i = R } | {z } 1 categorical + i and the coefficient vector is = ( , 1 , 2 , 31 , 32 , 33 |{z} =0 ). 2 / 40 General linear test in SAS The contrast statement in SAS PROC GLM lets you test whether one or more linear combinations of regression effects are (simultaneously) zero. To test no difference between Democrats and Republicans, H : 31 = 33 equivalent to H : 31- 33 = 0, use contrast "Dem=Rep" pol 1 0 -1; . Need to include the - 1 even though SAS sets 33 = 0! To test no difference among all political affiliations, use H : 31- 32 = 0 and H : 32- 33 = 0, given by contrast "Dem=Rep=Other" pol 1 -1 0, pol 0 1 -1; . proc glm; class pol; model salary=age educ pol / solution; contrast "Dem=Rep" pol 1 0 -1; contrast "Dem=Rep=Other" pol 1 -1 0, pol 0 1 -1;------------------------------------------------------------- Contrast DF Contrast SS Mean Square F Value Pr > F Dem=Rep 1 240.483581 240.483581 3.57 0.0814 Dem=Rep=Other 2 2017.608871 1008.804436 14.97 0.0004 3 / 40 General linear test in SAS We can also test quadratic effects and interactions. From the initial fit, educ is not needed with age and pol in the model. Lets refit: proc glm; class pol; model salary=age pol / solution; run;------------------------------------------------------------- Source DF Type III SS Mean Square F Value Pr > F age 1 2648.275862 2648.275862 37.65 <.0001 pol 2 1982.208197 991.104098 14.09 0.0004 Standard Parameter Estimate Error t Value Pr > |t| Intercept 30.15517241 B 7.41311553 4.07 0.0012 age 1.03448276 0.16859121 6.14 <.0001 pol D-8.63793103 B 4.93543380-1.75 0.1020 pol O-25.37931034 B 4.84730261-5.24 0.0001 pol R 0.00000000 B . . ....
View Full Document

This note was uploaded on 12/14/2011 for the course STAT 704 taught by Professor Staff during the Fall '11 term at South Carolina.

Page1 / 40

notes14 - Chapter 9 Model Selection and Validation Timothy...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online