BookmarkSubscribeRSS Feed
Eunhee
Calcite | Level 5

Hello,

I'm trying to calculate a p-value for non-time covariates interaction by comparing two models.

 

At first, I calculated the hazard ratio using this code:

 

PROC PHREG DATA=PCA4;
	CLASS FACTOR4_RANK(REF='0') AGE_CAT(REF='1') A00_SEX_N(REF='1');
	MODEL F_TIME_Y*DYSLIPI_D(0)= FACTOR4_RANK AGE_CAT A00_SEX_N / RISKLIMITS;
	STRATA AGE_CAT;
RUN;

 

 

And then, I tried to calculate a p-value for interaction in sex and independent variable by comparing two models.

 

 

PROC PHREG DATA=PCA4;
	CLASS AGE_CAT(REF='1') A00_SEX_N(REF='1');
	MODEL F_TIME_Y*DYSLIPI_D(0)= FACTOR4 AGE_CAT A00_SEX_N / RISKLIMITS;
	STRATA AGE_CAT;
RUN; /*-2LogL with covariates = 17410.810*/

PROC PHREG DATA=PCA4;
	CLASS AGE_CAT(REF='1') A00_SEX_N(REF='1');
	MODEL F_TIME_Y*DYSLIPI_D(0)= FACTOR4 AGE_CAT A00_SEX_N A00_SEX_N*FACTOR4 / RISKLIMITS;
	STRATA AGE_CAT;
RUN; /*-2LogL with covariates =17407.791*/

DATA _NULL_;
DIFF=17410.810-17407.791;
p=1-PROBCHI(DIFF,1);
PUT p; /*p=0.082*/
run;

 

 

At this point, I have 2 questions as below.

(In the syntax for calculating a hazard ratio(first attached), the independent variable was "FACTOR4_RANK" which was categorizing "FACTOR4" continuous variable into tertiles)

 

1) I just want to check by all of you whether this syntax has any statistical problem.

 

2) When I calculate a hazard ratio, I used a categorical variable as an independent variable ("FACTOR4_RANK"),

but when I calculate a p-value for sex interaction with the independent variable, I used a continuous variable as an independent variable and interaction term ("FACTOR4" and "A00_SEX_N*FACTOR4").
My question is that if I used a categorical variable("FACTOR4_RANK") as an independent variable to find a hazard ratio,

should I use a categorical variable("FACTOR4_RANK") as an independent variable and interaction term in the syntax for calculating a p-value for interaction in the same way?

Or is there no statistical problem if I use the continuous variable("FACTOR4") to get a p-value for interaction and the categorical variable("FACTOR4_RANK") to get a hazard ratio?

 

Perhaps I lack the concept of finding the interaction between covariates(non-time dependent) and independent variables.

Thanks for your guidance.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 0 replies
  • 3037 views
  • 0 likes
  • 1 in conversation