turn on suggestions

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

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- How to output score test statistic or LR test stat...

Topic Options

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-19-2009 02:12 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

06-24-2009 03:12 PM

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.