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
- /
- How to output score test statistic or LR test statistic from PROC PHRE...

Options

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

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

Posted 06-19-2009 02:12 PM
(1595 views)

I am running a multivarialbe model:

model survtime*death(0)=A B A*B. Is there a way to output the score test statistic and likelihood ratio test statistic for A*B from Proc PHREG?

Thanks.

model survtime*death(0)=A B A*B. Is there a way to output the score test statistic and likelihood ratio test statistic for A*B from Proc PHREG?

Thanks.

1 REPLY 1

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

The PHREG procedure computes score and likelihood ratio tests for the entire parameter vector. Those tests can be output to a data set if you precede your RUN; statement with an ODS OUTPUT statement:

proc phreg data=mydata;

model survtime*deaty(0)=A B A*B;

ods output GlobalTests=GlobalTests_AxBincluded;

run;

You can obtain a likelihood ratio test for the A*B interaction by additionally fitting a model with only the main efffects, outputting the global tests table for that model, merge the two global test tables (rename the variables which contain values of -2LL so that that one does not overwrite the other), and then taking the difference in -2LL values. If A or B are both continuous, then you will also need to rename the variables identifying the degrees of freedom in the global tests data sets. The difference in df and the difference in -2LL values allow you to construct a likelihood ratio test for the A*B interaction.

I have only outlined how to construct the LR test for the A*B interaction. I don't know the names of the variables in the GlobalTest tables right off hand. In order to complete the likelihood ratio test, you will have to identify the names of the variables that you need to manipulate and extract just the rows of the GlobalTest tables which contain values of -2LL. After computing the differences which you need to construct the LR test, you will also need to compare the difference in -2LL to tables of the chi-square distribution which you can do programmatically using the PROBCHI function.

proc phreg data=mydata;

model survtime*deaty(0)=A B A*B;

ods output GlobalTests=GlobalTests_AxBincluded;

run;

You can obtain a likelihood ratio test for the A*B interaction by additionally fitting a model with only the main efffects, outputting the global tests table for that model, merge the two global test tables (rename the variables which contain values of -2LL so that that one does not overwrite the other), and then taking the difference in -2LL values. If A or B are both continuous, then you will also need to rename the variables identifying the degrees of freedom in the global tests data sets. The difference in df and the difference in -2LL values allow you to construct a likelihood ratio test for the A*B interaction.

I have only outlined how to construct the LR test for the A*B interaction. I don't know the names of the variables in the GlobalTest tables right off hand. In order to complete the likelihood ratio test, you will have to identify the names of the variables that you need to manipulate and extract just the rows of the GlobalTest tables which contain values of -2LL. After computing the differences which you need to construct the LR test, you will also need to compare the difference in -2LL to tables of the chi-square distribution which you can do programmatically using the PROBCHI function.

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.