BookmarkSubscribeRSS Feed
nested
Calcite | Level 5
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.
1 REPLY 1
Dale
Pyrite | Level 9
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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Discussion stats
  • 1 reply
  • 1438 views
  • 0 likes
  • 2 in conversation