BookmarkSubscribeRSS Feed
sulafa
Obsidian | Level 7

Hello SAS users,

I made cox proportional code, it runs without errors in the log, but I have some missing values(HR, CI) I need to test for interaction of my primary exposure iron(ironcat) with vitamin c(vitccat). also, how I can get a survival analysis graph with the same code? Thanks in advance

here is my code: 

proc phreg data = CANIMPT.capstoneclean covs(aggregate) covm;
class ironcat vitccat;
model fup_t1d*case_t1d(0) = ironcat ironcat *vitccat /ties=discrete risklimits covb;
hazardratio "iron unadjusted" ironcat / diff=ref cl=wald;
title 'Ironcat consumption and T1D progression';
run;

sulafa
1 REPLY 1
OsoGris
SAS Employee
You don't get HR for interaction terms in the ParameterEstimates table. You need to use a HAZARDRATIO statement with the AT= option to specify the level of the interacting variable. Also, the COVS(AGGREGATE) does nothing unless you have an ID statement to identify the clusters.

proc phreg data = CANIMPT.capstoneclean covs(aggregate) covm;
class ironcat vitccat;
model fup_t1d*case_t1d(0) = ironcat ironcat *vitccat /ties=discrete risklimits covb;
hazardratio "iron unadjusted" ironcat / diff=ref cl=wald;
title 'Ironcat consumption and T1D progression';
run;
You will also need the PLOTS= option on the PROC PHREG statement in conjunction with the BASELINE statement in the code. See Example 8 Survival Curves in the PHREG documentation for the basics.

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
  • 1 reply
  • 1511 views
  • 1 like
  • 2 in conversation