Number of Observations
Number of Observations Read | 49 |
---|---|
Number of Observations Used | 49 |
Now it's your turn. Use the the skin cancer dataset (csv) to obtain the following output.
Questions 1-4 can be answered by using PROC REG with the CLB option in the MODEL statement. We will first need to calculate the product of Lat and Long for the interaction term.
LIBNAME Survey "H:\BiostatCourses\PHC6937SurveryBiostat\Lectures\MLR\Data";
PROC IMPORT datafile="H:\BiostatCourses\PHC6937SurveryBiostat\Lectures\MLR\Data\skincancer.csv"
out=Survey.cancer dbms=csv replace;
getnames=Yes;
RUN;
DATA cancer_temp;
SET survey.cancer;
LatLong = Lat*Long;
RUN;
PROC REG DATA=cancer_temp;
MODEL Mort = Lat Long LatLong / CLB;
RUN;
For number 5, we need to add a row to the dataset with a missing value for Mort so we can use the output statement to get the confidence and prediction intervals.
DATA cancer_temp2;
INPUT Mort Lat Long LatLong;
DATALINES;
. 33 86 2838
;
RUN;
DATA cancer_temp;
SET cancer_temp cancer_temp2;
RUN;
ODS SELECT NONE;
PROC REG DATA=cancer_temp;
MODEL Mort = Lat Long LatLong / CLB;
OUTPUT OUT=pred(where=(Mort=.)) p=predicted lcl=UCL_Pred ucl=LCL_Pred
LCLM=LCLM_Pred UCLM=UCLM_Pred;
RUN;
ODS SELECT ALL;
PROC PRINT DATA=pred;
VAR LAT LONG LATLONG predicted LCLM_Pred UCLM_Pred UCL_Pred LCL_Pred;
RUN;
For number 6, we need to run PROC REG again without the interaction term in the model statement.
PROC REG DATA=Survey.cancer;
MODEL Mort = Lat Long / CLB;
RUN;