/*proc import OUT=WORK.prof DATAFILE="Z:\stat 704\Math Proficiency.txt" DBMS=TAB REPLACE; GETNAMES=YES; DATAROW=2; RUN; */ *New PROC IMPORT; proc import OUT=WORK.prof DATAFILE="Z:\stat 704\Math Proficiency.txt" replace; RUN; proc sgscatter data=prof; matrix mathprof parents homelib reading tvwatch absences; run; proc reg data=prof; model mathprof=parents homelib reading tvwatch absences; run; proc robustreg data=prof method=m (wf=huber); model mathprof=parents homelib reading tvwatch absences; run; *Test dropping more than one term; proc robustreg data=prof method=m (wf=huber); model mathprof=parents homelib reading tvwatch absences; test absences reading; *rho and Rn-squared tests; run; *Save output; proc robustreg data=prof method=m (wf=huber) plots=all; model mathprof=parents homelib tvwatch ; id state; output out=out p=p sr=sr; run; proc sgplot data=out; scatter x=p y=sr/datalabel=state; run; proc sgplot data=out; scatter x=parents y=sr/datalabel=state; run; proc sgplot data=out; scatter x=homelib y=sr/datalabel=state; run; proc sgplot data=out; scatter x=tvwatch y=sr/datalabel=state; run; proc import OUT=WORK.Fall08 DATAFILE="w:\courses\stat704\Fall 2008.txt" replace; RUN; proc sgscatter data=fall08; matrix cltotgpa satm satv; run; proc quantreg data=fall08; model cltotgpa=satv / quantile=0.25; output out=o1 p=p1; proc quantreg data=fall08; model cltotgpa=satv / quantile=0.50; output out=o2 p=p2; proc quantreg data=fall08; model cltotgpa=satv / quantile=0.75; output out=o3 p=p3; data o4; set o1 o2 o3; proc sort data=o4; by quantile satv; run; proc sgplot data=o4; scatter x=satv y=cltotgpa/legendlabel="Data"; reg x=satv y=p1/nomarkers legendlabel="Q1";; reg x=satv y=p2/nomarkers legendlabel="Median"; reg x=satv y=p3/nomarkers legendlabel="Q3"; xaxis label="Verbal SAT"; yaxis label="GPA"; run;