20
2 December 2004 PubH8420: Parametric Regression Mode ls Slide 1 Applications - SAS Applications - SAS • Parametric Regression in SAS – PROC LIFEREG – PROC GENMOD – PROC LOGISTIC Reference: SAS ver. 8.0 SAS/STAT User’s Guide, SAS Institute, Inc., Cary, NC

2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

Embed Size (px)

Citation preview

Page 1: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 1

Applications - SASApplications - SAS

• Parametric Regression in SAS– PROC LIFEREG– PROC GENMOD– PROC LOGISTIC

Reference: SAS ver. 8.0 SAS/STAT User’s Guide,SAS Institute, Inc., Cary, NC

Page 2: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 2

Applications – PROC LIFEREGApplications – PROC LIFEREG• Mathematical Model

where y is a vector of response values, (often the log of the failure times) X is a matrix of covariates variables (usually including an intercept term), β is a vector of unknown regression parameters σ is an unknown scale parameter, and ε is a vector of errors (assumed to come from any known distribution)

Xy

Page 3: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 3

Applications – PROC LIFEREGApplications – PROC LIFEREG

• Log Likelihood– if all the responses are observed

, where

– If some of the responses are right censored,

))(

log(

iwfL )(

1 iii xyw

))(log())(

log( ii wF

wfL

Page 4: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 4

Applications – PROC LIFEREGApplications – PROC LIFEREG

• Model & Estimation– Accelerated Failure Time (Life) Model

• The effect of independent variables on an event time distribution is multiplicative on the event time

• The effect of the covariates : change the scale of a baseline distribution of failure times, not the location

– Estimation : MLE using a Newton-Raphson algorithm

– Standard Errors of the parameter estimates : the inverse of the observed information matrix

– Test : Normal based Test (e.g. chi-sq test, LRT)

)log( if Ty

Soon-Young Jang
Soon-Young Jang
Soon-Young Jang
For the Exponential Distribution, ALM = PHMFor the Weibull Distribution, ALM = PHM when having the same shape parameter (the parameterization for the covariates differs by a multiple of the scale parameter).
Soon-Young Jang
For the Exponential Distribution, ALM = PHMFor the Weibull Distribution, ALM = PHM when having the same shape parameter (the parameterization for the covariates differs by a multiple of the scale parameter).
Page 5: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 5

Applications – PROC LIFEREGApplications – PROC LIFEREG

• Kidney Transplant Data

PROC FORMAT; VALUE female 0='Male' 1='Female'; VALUE algfmt 0='Non-ALG' 1='ALG';RUNDATA kidney; INFILE "surd01.dat"; INPUT id 1-4 age 5-6 sex 7 Alg 22 duration 25-27 status 28; lntime = log(duration); FORMAT sex female. Alg algfmt.;RUN;

Page 6: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 6

Applications – PROC LIFEREGApplications – PROC LIFEREG

• Exponential Regression

TITLE1 "Kidney Transplants Data";PROC LIFEREG DATA=kidney; CLASS ALG; MODEL DURATION*STATUS(0)= ALG/

DIST=EXPONENTIAL; OUTPUT OUT=out CDF=prob; TITLE2 "Simple Exponential Regression”;

RUN;

Page 7: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 7

Applications – PROC LIFEREGApplications – PROC LIFEREG

Kidney Transplants Data 1 Simple Exponential Regression

The LIFEREG Procedure

Model Information

Data Set WORK.KIDNEY Dependent Variable Log(duration) Censoring Variable status Censoring Value(s) 0 Number of Observations 469 Noncensored Values 192 Right Censored Values 277 Left Censored Values 0 Interval Censored Values 0 Name of Distribution Exponential Log Likelihood -645.2158149

Algorithm converged.

Output

Page 8: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 8

Applications – PROC LIFEREGApplications – PROC LIFEREG

Type III Analysis of Effects WaldEffect DF Chi-Square Pr > ChiSqALG 1 6.7769 0.0092

Analysis of Parameter Estimates Standard 95% Confidence Chi-Parameter DF Estimate Error Limits Square

Intercept 1 4.2155 0.1400 3.9410 4.4899 906.28Alg ALG 1 0.4254 0.1634 0.1051 0.7456 6.78Alg Non-ALG 0 0.0000 0.0000 0.0000 0.0000 . Scale 0 1.0000 0.0000 1.0000 1.0000 Weibull Shape 0 1.0000 0.0000 1.0000 1.0000

Output Continued

Page 9: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 9

Applications – PROC LIFEREGApplications – PROC LIFEREG

• Interpretation (Risk = λ exp(xβ) )– λ = Exp(-β0) = exp(-4.215) = 0.015

– β1 = coefficient for ALG = 0.425

– RR(ALG=1:ALG=0) = exp(β1) = 0.654• the risk of ALG group = λ exp(β1)

= 0.015*0.654 = 0.0096

• the risk of Non-ALG group = λexp(0) = 0.015

• Testing & Conclusion– Using ALG decreased the risk 34.6%

– Significant effect

( )0092.0,78.62 pValue

Page 10: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 10

Applications – PROC LIFEREGApplications – PROC LIFEREGEstimated CDF of Residuals Vs. Observed Duration

Page 11: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 11

Applications – PROC LIFEREGApplications – PROC LIFEREG

• Multiple Regression

PROC LIFEREG DATA=kidney; CLASS ALG; MODEL DURATION*STATUS(0)= AGE ALG/ DIST=EXPONENTIAL; OUTPUT OUT=out QUANTILES=.5 STD=STD P=MED_DURATION;RUN;

Page 12: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 12

Applications – PROC LIFEREGApplications – PROC LIFEREG

• Estimation Comparison

  Exponential Regression Cox Regression

Para-meter

Hazards Ratio

95% ConfidenceLimits

Hazards Ratio

95% ConfidenceLimits

age 1.022 1.010 1.034 1.017 1.006 1.029

ALG 0.651 0.473 0.897 0.577 0.417 0.798

Page 13: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 13

Applications – PROC LIFEREGApplications – PROC LIFEREG

• Predicted Values and Confidence Intervals

DATA out1;

SET out;

ltime=log(med_duration);

stde=std/med_duration;

upper=exp(ltime+1.64*stde);

lower=exp(ltime-1.64*stde);

RUN;

Page 14: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 14

Applications – PROC LIFEREGApplications – PROC LIFEREGMedian Predicted Values Vs. AGE by the Use of ALG

Page 15: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 15

Applications – PROC LIFEREGApplications – PROC LIFEREG• Other supported distributions

– Generalized Gamma– Loglogistic– Lognormal– Weibull

• Some relations among the distributions:

The Weibull with Scale=1 : exponential distribution

The gamma with Shape=1 : Weibull distribution.

The gamma with Shape=0 : lognormal distribution.

Page 16: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 16

Applications – PROC GENMODApplications – PROC GENMOD

• Piecewise exponential distribution

(Poisson Regression)

TITLE1 "Kidney Transplants Data";PROC GENMOD DATA=kidney; CLASS ALG; MODEL STATUS = AGE ALG/ DIST=POISSON LINK=log OFFSET=lntime type3; TITLE2 "Multiple Piecewise Exponential Regression";

RUN;

Page 17: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 17

Applications – PROC LOGISTICApplications – PROC LOGISTIC

• Dichotomized dataDATA kidney1; SET kidney; DO month=1 TO duration; IF month=duration AND status=1 THEN fail=1; ELSE fail=0; OUTPUT; END;RUN;

Page 18: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 18

Applications – PROC LOGISTICApplications – PROC LOGISTIC

• LOGISTIC REGRESSION with LOGIT LINK

PROC LOGISTIC DATA=kidney1;

CLASS month fail/

PARAM=reference REF=first;

MODEL fail=age ALG;

RUN;

Page 19: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 19

Applications – PROC LOGISTICApplications – PROC LOGISTIC

• LOGISTIC REGRESSION

with CLOGLOG LINK

PROC LOGISTIC DATA=kidney1 ;

CLASS month fail/

PARAM=reference REF=first;

MODEL fail=age ALG/

LINK=CLOGLOG;

RUN;

Page 20: 2 December 2004PubH8420: Parametric Regression Models Slide 1 Applications - SAS Parametric Regression in SAS –PROC LIFEREG –PROC GENMOD –PROC LOGISTIC

2 December 2004 PubH8420: Parametric Regression Models Slide 20

Applications - SASApplications - SAS

• Comparison of Parameter Estimates– Hazards Ratio in Log Scale

  PHREG LIFEREG GENMOD LOGISTIC

Method Cox Reg.Exp. Reg

( -β )PiecewiseExp. Reg

LOGIT CLOGLOG

AGE 0.0168 0.0216 0.0216 0.0219 0.0217

ALG -0.549 -0.429 -0.429 -0.4346 -0.431