Hi there,
I believe that I'm pretty stupid because I cannot seem to get proc phreg to perform a one-sided test using the estimate statement with the lower option. I cannot find any relevant examples online so I'm seeking your expertise!
Here follows some example code:
proc phreg data=output nosummary; strata yearentry origin ; class sex; effect aspl=spline(agefirstentry / naturalcubic knotmethod=equal(5)); model (entry,exit)*censored(1)= PARAMETER sex aspl / rl; estimate 'PARAMETER' /lower; run;
Generating the following error. Removing quotes yields the same result.
22 76 ERROR 22-322: Syntax error, expecting one of the following: a name, INTERCEPT. ERROR 76-322: Syntax error, statement will be ignored.
Do you have any ideas? I cannot figure this out ...(https://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_phreg_sect0...)
Thanks!
Hi @td1345,
@td1345 wrote:
Hi there,
I believe that I'm pretty stupid (...)
Impossible! You're doing quite sophisticated statistical analyses. 🙂
Indeed, I prefer a much less advanced example to (hopefully) answer your question. I took it from the PROC PHREG documentation, simplified it further and added the ESTIMATE statement:
proc phreg data=rats;
model days*status(0)=group;
estimate 'enter your label here' group 1 / lower;
run;
Partial output:
Analysis of Maximum Likelihood Estimates Parameter Standard Hazard Parameter DF Estimate Error Chi-Square Pr > ChiSq Ratio Group 1 -0.14401 0.24192 0.3543 0.5517 0.866 Estimate Standard Label Estimate Error z Value Tails Pr < z enter your label here -0.1440 0.2419 -0.60 Lower 0.2758
In this particular example the results of the ESTIMATE statement do not add much value to the results of maximum likelihood estimation: estimate and SE are the same, Chi-Square=(z Value)**2, (Pr < z)=(Pr > ChiSq)/2, not surprisingly.
So, in your statement estimate 'PARAMETER' /lower; you missed both the model effect (e.g. parameter without quotes) and the value(s). For details on the latter I'd like to refer to section Shared Concepts and Topics in the SAS/STAT documentation. (As you probably know, the ESTIMATE statement is not unique to PROC PHREG.)
Just one more remark: If, in the RATS dataset used above, GROUP had three levels and it was specified in a CLASS statement so that it had two parameters in the model, say b1 and b2 (for the two design variables), we could, for example, request an estimate (and the corresponding test) for a linear combination of the two parameters, e.g. 7b1−3b2, with
estimate 'enter your label here' group 7 -3 / lower;
Hi @td1345,
@td1345 wrote:
Hi there,
I believe that I'm pretty stupid (...)
Impossible! You're doing quite sophisticated statistical analyses. 🙂
Indeed, I prefer a much less advanced example to (hopefully) answer your question. I took it from the PROC PHREG documentation, simplified it further and added the ESTIMATE statement:
proc phreg data=rats;
model days*status(0)=group;
estimate 'enter your label here' group 1 / lower;
run;
Partial output:
Analysis of Maximum Likelihood Estimates Parameter Standard Hazard Parameter DF Estimate Error Chi-Square Pr > ChiSq Ratio Group 1 -0.14401 0.24192 0.3543 0.5517 0.866 Estimate Standard Label Estimate Error z Value Tails Pr < z enter your label here -0.1440 0.2419 -0.60 Lower 0.2758
In this particular example the results of the ESTIMATE statement do not add much value to the results of maximum likelihood estimation: estimate and SE are the same, Chi-Square=(z Value)**2, (Pr < z)=(Pr > ChiSq)/2, not surprisingly.
So, in your statement estimate 'PARAMETER' /lower; you missed both the model effect (e.g. parameter without quotes) and the value(s). For details on the latter I'd like to refer to section Shared Concepts and Topics in the SAS/STAT documentation. (As you probably know, the ESTIMATE statement is not unique to PROC PHREG.)
Just one more remark: If, in the RATS dataset used above, GROUP had three levels and it was specified in a CLASS statement so that it had two parameters in the model, say b1 and b2 (for the two design variables), we could, for example, request an estimate (and the corresponding test) for a linear combination of the two parameters, e.g. 7b1−3b2, with
estimate 'enter your label here' group 7 -3 / lower;
You saved my day! Thanks!
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.