Nesting variables within a Cox Proportional Hazards Model

Reply
New Contributor
Posts: 2

Nesting variables within a Cox Proportional Hazards Model

Hi,

I am trying to analyze data using the Cox Proportional Hazards Model. I'm thinking this is the right model to start with but I'm not 100% sure. I was going to start with this model, then test the assumption of proportional hazards to determine if it is the right type of model to use. If it isn't I'm not completely prepared for what to do next. Some input into if this is correct way to go or more efficient ways to do this would be greatly appreciated.

To give you some background into my data, my experiment is as follows:

I wanted to test the survivorship of 2 ant species by holding them at different temperatures and humidities and using 3 colonies of each species. So my variables are as follows Time until death, Status (dead or alive), Temp (3 levels), Humidity (3 levels), Species (2 levels), and Colony (3 levels for each species). Each data point corresponds with a single individual with a combination of the listed variables.

The code I have used to analyze this is as follows:

proc sort data=ants;

by speciescode colony;

run;

proc phreg data=ants;

class speciescode(ref=first param=ref);

class colony (ref=first param=ref);

class temp (ref=first param=ref);

class hum (ref=first param=ref);

interaction1 = temp*hum;

interaction2 = temp*colony;

interaction3 = temp*speciescode;

interaction4 = hum*colony;

interaction5 = hum*speciescode;

interaction6 = colony*speciescode;

interaction7 = temp*hum*colony;

interaction8 = temp*hum*speciescode;

interaction9 = temp*colony*speciescode;

interaction10 = hum*colony*speciescode;

interaction11 = temp*colony*speciescode*hum;

model time*dead(0)= speciescode colony temp hum interaction1 interaction2 interaction3 interaction4 interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11;

run;

The questions I have are: Is this the right method to use?

If it is, should I include Colony as a nested variable as in the code below? If so, how do I get SAS to recognize this nesting? The code below will not work (I have tried). SAS says that it does not recognized Colony(Speciescode).

proc sort data=ants;

by speciescode colony;

run;

proc phreg data=ants;

class speciescode(ref=first param=ref);

class colony (ref=first param=ref);

class temp (ref=first param=ref);

class hum (ref=first param=ref);

interaction1 = temp*hum;

interaction2 = temp*colony(speciescode);

interaction3 = temp*speciescode;

interaction4 = hum*colony(speciescode);

interaction5 = hum*speciescode;

interaction6 = colony(speciescode)*speciescode;

interaction7 = temp*hum*colony(speciescode);

interaction8 = temp*hum*speciescode;

interaction9 = temp*colony(speciescode)*speciescode;

interaction10 = hum*colony(speciescode)*speciescode;

interaction11 = temp*colony(speciescode)*speciescode*hum;

model time*dead(0)= speciescode colony(speciescode) temp hum interaction1 interaction2 interaction3 interaction4 interaction5 interaction6 interaction7 interaction8 interaction9 interaction10 interaction11;

run;


Any help would be greatly appreciated!


Thank you,


Rochelle

New Contributor
Posts: 2

Re: Nesting variables within a Cox Proportional Hazards Model

Posted in reply to RochelleHC

I also want to add that the warning message I receive when I try to run the second set of code is: "WARNING: Cannot find a library containing subroutine COLONY." I'm not sure what to make of this or how to fix it.

Ask a Question
Discussion stats
  • 1 reply
  • 235 views
  • 0 likes
  • 1 in conversation