08-09-2012 10:22 AM
I'm having some difficulty figuring out how to interpret the output of LSMEANS in PROC PHREG, and was hoping someone could refresh my memory and/or help me out.
My data has one row per subject, with discrete time periods for each subject (ranging from 1 to 7), and is right-censored (some subjects dropped out before experiencing an event). The variable TimeTo1stEvent capturing the time period when they experienced the first event, AnyEventFlag as the censoring variable (1 if they had an event, 0 otherwise), EntryType (1 to 4) and SubjType (1 to 3) are categorical variables, and the other explanatory variables in the MODEL statement below are continuous variables. I also have a variable TotalNumPeriods that captures for how many periods we have data on a subject. For subjects who didn't experience an event, I had set AnyEventFlag=0 and TimeTo1stEvent=TotalNumPeriods.
(As an aside, I wasn't sure how, if at all, to incorporate TotalNumPeriods into the code, but I didn't think I needed to.)
My code is:
proc phreg data=Prospect ;
class AnyEventFlag EntryType SubjType / param=glm ;
model TimeTo1stEvent*AnyEventFlag(0) = EntryType SubjType Age_At_Entry GP MP1 MP2 / type3 ;
hazardratio EntryType / diff=all ;
lsmeans EntryType / means diff ilink exp bylevel plots=none ;
lsmeans EntryType / means diff ilink exp om plots=none ;
lsmeans EntryType / means diff ilink exp bylevel om plots=none ;
I'm interested in what the marginal means are for each category of EntryType, controlling for the other explanatory variables.
The results I get from the first LSMEANS statement are:
|Margins||By Level||Estimate||Standard Error||z Value||Pr > |z|||Mean|
And the results from the next two LSMEANS statements are fairly similar.
What I'm trying to get is something like the expected Time to Event for EntryType=1 is X.XX number of periods, for EntryType=2 is Y.YY number of periods, etc. For some reason, I can't figure out how to take the values in the Estimate column (or any other info SAS spits out) and translate those to what I'm looking for. Using PROC LIFEREG I can create an output dataset and specify "QUANTILES=0.5" to get a quantile estimate for each subject in the data, but not an overall estimate for each value of EntryType.
I also had explored using the "TYPE=DISCRETE" option in the model statement, and a BASELINE statement, but neither seemed to be giving me what I was trying to get at.
Can anyone help me out and remind me how to get what I'm looking for?