Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Proc phreg one sided test using estimate and lower statment and option

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 05-23-2019 09:04 AM
(1957 views)

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!

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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;`

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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;`

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

You saved my day! Thanks!

Are you ready for the spotlight? We're accepting content ideas for **SAS Innovate 2025** to be held May 6-9 in Orlando, FL. The call is **open **until September 25. Read more here about **why** you should contribute and **what is in it** for you!

What is ANOVA?

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.