Programming the statistical procedures from SAS

How to output score test statistic or LR test statistic from PROC PHREG?

Reply
N/A
Posts: 1

How to output score test statistic or LR test statistic from PROC PHREG?

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.
Regular Contributor
Posts: 169

Re: How to output score test statistic or LR test statistic from PROC PHREG?

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.
Ask a Question
Discussion stats
  • 1 reply
  • 127 views
  • 0 likes
  • 2 in conversation