Question: Is there code to get a table of figures for the confidence intervals and prediction limits (dotted line in the diagram below) at each time period in the 'Results' tab?
Currently, here is my code so far:
/* MACRO to generate poly curves based on x and y variables*/
/* dt_input : datset you wish to input tot he macro*/
/* modeller : variable to be modelled (i.e y axis)*/
/* var : explanatoty varaible (i.e. x axis)*/
/* note poly test and ROC test uploaded from p drive - excel sheets*/
%macro poly_2(dt_input=roctest, modeller = cohortA, var = time );
ods graphics on;
proc orthoreg data = &dt_input
outest = poly_&modeller.
/*%if &Chart_Out. = 0 %THEN noprint;*/
;
effect xMod = polynomial (&var / degree = 2);
model &modeller. = xMod / noint;
effectplot fit / obs;
store Ostore;
run;
ods graphics off;
data poly_&modeller;
length final_segment $20.;
set poly_&modeller.;
final_segment = "&modeller";
run;
%mend;
%poly_2;
Since you are using the STORE statement to store the model, you can use PROC PLM and the SCORE statement to score the data. Here is an example that scores the model on the original data points:
proc plm restore=Ostore;
score data=&dt_input out=ScoreResults
predicted LCLM UCLM LCL UCL;
run;
proc print data=ScoreResults(obs=10);
var &var &modeller
predicted LCLM UCLM LCL UCL;
run;
Since you are using the STORE statement to store the model, you can use PROC PLM and the SCORE statement to score the data. Here is an example that scores the model on the original data points:
proc plm restore=Ostore;
score data=&dt_input out=ScoreResults
predicted LCLM UCLM LCL UCL;
run;
proc print data=ScoreResults(obs=10);
var &var &modeller
predicted LCLM UCLM LCL UCL;
run;
Hi,
Thanks a lot for your reply, it is greatly appreciated!
From you advice, this is the code that I have adapted, with the Results output screenshot below. Can you please confirm that I have written the code correctly/that the Results table looks correct?
proc plm restore=Ostore;
score data=roctest out=ScoreResults
predicted LCLM UCLM LCL UCL;
run;
proc print data=ScoreResults(obs=10);
var time cohortA
predicted LCLM UCLM LCL UCL;
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: