PROC IMPORT OUT=WORK.FALL08 DATAFILE="Z:\stat 704\Fall 2008.txt" DBMS=TAB REPLACE; GETNAMES=YES; DATAROW=2; RUN; proc sgscatter data=fall08; matrix CLTOTGPA SATV SATM; run; *Slopes appear equal. Gender main effect; proc sgplot data=fall08; scatter x=SATV y=CLTOTGPA/group=gender; reg x=SATV y=CLTOTGPA/nomarkers group=gender; xaxis label="Verbal SAT"; yaxis label="GPA"; run; *Unequal slopes. Combine upper classes; proc sgplot data=fall08; scatter x=SATV y=CLTOTGPA/group=class; reg x=SATV y=CLTOTGPA/nomarkers group=class; xaxis label="Verbal SAT"; yaxis label="Class"; run; proc glm data=fall08; class gender; model cltotgpa=gender SATV gender*SATV; *Use this to test only the interaction; model cltotgpa=gender SATV/solution; *Interaction was dropped; run; proc glm data=fall08; class class; *Hmmm; model cltotgpa=class SATV class*SATV; contrast "UpperClass" class 0 1 -1 0, class*satv 0 1 -1 0; *Check levels to get this right; run; data power; * pp. 300-305 QUESTION: is first order model okay?; input cycles rate temp @@; ratesq=rate*rate; RxT=rate*temp; tempsq=temp*temp; datalines; 150 0.6 10 86 1.0 10 49 1.4 10 288 0.6 20 157 1.0 20 131 1.0 20 184 1.0 20 109 1.4 20 279 0.6 30 235 1.0 30 224 1.4 30 ; run; *Odd example since continuous covariates have so few levels; proc sgscatter data=power; matrix cycles rate temp; run; proc reg data=power; model cycles=rate temp ratesq RxT tempsq; *Can do this with Type I SS too, but this approach is better; SecondOrder: test ratesq=0, RxT=0, tempsq=0; run; *Same test in PROC GLM; proc glm data=power; model cycles=rate temp rate*rate rate*temp temp*temp; contrast 'SecondOrder' rate*rate 1, rate*temp 1, temp*temp 1; run; data soap; * pp. 330-333 QUESTION: are the lines the same?; input Scrap Speed Line @@; datalines; 218 100 1 248 125 1 360 220 1 351 205 1 470 300 1 394 255 1 332 225 1 321 175 1 410 270 1 260 170 1 241 155 1 331 190 1 275 140 1 425 290 1 367 265 1 140 105 0 277 215 0 384 270 0 341 255 0 215 175 0 180 135 0 260 200 0 361 275 0 252 155 0 422 320 0 273 190 0 410 295 0 ; run; proc sgplot data=soap; scatter x=speed y=scrap /group=line; reg x=speed y=scrap/group=line; run; proc glm data=soap; class line; model scrap=speed line speed*line/solution; contrast 'Same Line' line 1 -1, speed*line 1 -1; run;