options ls=78;

 

data hw7;

        infile 'hw7data.dat';

        input sn exam study tv worried;

        sqrtstud=sqrt(study);

        logstudy=log(study);

        nrstudy=-1/(study);

        nr2study=-1/(study**2);

        tvsq=tv**2;

        tvcube=tv**3;

        tv4th=tv**4;

        tv5th=tv**5;

run;

 

proc print data=hw7;

run;

 

proc plot data=hw7;

        plot exam*study exam*sqrtstud exam*logstudy exam*nrstudy exam*nr2study

        exam*tv exam*tvsq exam*tvcube exam*tv4th exam*tv5th exam*worried;

        title 'Plots of exam by IVs";

run;

 

proc corr data=hw7;

        var exam study sqrtstud logstudy nrstudy nr2study;

run;

 

proc corr data=hw7;

        var exam tv tvsq tvcube tv4th tv5th;

run;

 

proc reg data=hw7;

        model exam=logstudy;

        plot exam*logstudy pred.*logstudy/overlay;

        title 'plot of exam by log study and predicted line';

     run;

        plot pred.*logstudy u95m.*logstudy l95m.*logstudy/overlay;

        title 'plot of predicted by log study and 95% confidence intervals';

        print cli clm;

run;

 

proc reg data=hw7;

        model exam=tv4th;

        plot exam*tv4th pred.*tv4th/overlay;

        title 'plot of exam by tv4th and predicted line';

     run;

        plot pred.*tv4th u95m.*tv4th l95m.*tv4th/overlay;

        title 'plot of predicted by tv4th and 95% confidence intervals';

        print cli clm;

run;

 

proc reg data=hw7;

        model exam=worried;

        plot exam*worried pred.*worried/overlay;

        title 'plot of exam by worriedand predicted line';

     run;

        plot pred.*worried u95m.*worried l95m.*worried/overlay;

        title 'plot of predicted by worried and 95% confidence intervals';

        print cli clm;

run;