Was told to Predict, with 95% confidence, the values between which the true mean cancer mortality lies for all counties with an exposure index of 5.2.
code was:
libname cancer '/home/u59291263/Cancer';
run;
proc contents data=cancer.cancer;run;
proc reg data= cancer.cancer;
model exposure= mortality/ clm cli;
ID mortality;
run;
data work.newobs;
set cancer.cancer;
exposure= 5.2;
run;
proc reg data= work.newobs;
model exposure= mortality/ clm cli;
ID exposure;
run;
But I am getting 5.2 as all my answers
By the way, I just noticed this
Shouldn't your PROC REG have
model mortality = exposure/ clm cli;
where exposure predicts mortality (instead of the way you wrote it, where mortality predicts exposure)?
By the way, I just noticed this
Shouldn't your PROC REG have
model mortality = exposure/ clm cli;
where exposure predicts mortality (instead of the way you wrote it, where mortality predicts exposure)?
I think you want to predict mortality (the response) from exposure (the independent variable). You have those variables reversed in your MODEL statement.
Try this:
data ScoreObs;
exposure= 5.2;
run;
data All;
set cancer ScoreObs(in=score);
NewData = (Score=1);
run;
proc reg data= All plots=none;
model mortality = exposure / clm cli;
output out=ScoreOut Pred=Pred lclm=LowerM uclm=UpperM lcl=LowerI ucl=UpperI;
run;
proc print data=ScoreOut;
where NewData=1;
run;
I assume that this is a homework problem, but I feel compelled to mention that linear regression with PROC REG is probably not the best way to measure mortality, which is a rate in the interval [0, 1] (or 0 to 100 if you are measuring percentages). A linear regression could predict a negative mortality rate or a mortality rate that is greater than 100%. Neither of these predictions makes sense, which is why we don't linear regression is not the best way to predict bounded quantities.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.