| Literature DB >> 25572709 |
Maria Kohl1, Max Plischke2, Karen Leffondré3, Georg Heinze4.
Abstract
We present a new SAS macro %pshreg that can be used to fit a proportional subdistribution hazards model for survival data subject to competing risks. Our macro first modifies the input data set appropriately and then applies SAS's standard Cox regression procedure, PROC PHREG, using weights and counting-process style of specifying survival times to the modified data set. The modified data set can also be used to estimate cumulative incidence curves for the event of interest. The application of PROC PHREG has several advantages, e.g., it directly enables the user to apply the Firth correction, which has been proposed as a solution to the problem of undefined (infinite) maximum likelihood estimates in Cox regression, frequently encountered in small sample analyses. Deviation from proportional subdistribution hazards can be detected by both inspecting Schoenfeld-type residuals and testing correlation of these residuals with time, or by including interactions of covariates with functions of time. We illustrate application of these extended methods for competing risk regression using our macro, which is freely available at: http://cemsiis.meduniwien.ac.at/en/kb/science-research/software/statistical-software/pshreg, by means of analysis of a real chronic kidney disease study. We discuss differences in features and capabilities of %pshreg and the recent (January 2014) SAS PROC PHREG implementation of proportional subdistribution hazards modelling.Entities:
Keywords: Competing risks; Cumulative incidence; Regression analysis; SAS software; Subdistribution hazard ratio; Survival analysis
Mesh:
Year: 2014 PMID: 25572709 PMCID: PMC4673318 DOI: 10.1016/j.cmpb.2014.11.009
Source DB: PubMed Journal: Comput Methods Programs Biomed ISSN: 0169-2607 Impact factor: 5.428
Counting process representation and weighting of original survival information for a Fine-Gray model describing time to event type 1.
| Subject | Observed survival time | Observed status | For Fine-Gray model | |
|---|---|---|---|---|
| Counting process representation | Weight | |||
| A | censored | (0, | 1 | |
| B | event 1 | (0, | 1 | |
| C | event 2 | (0, | 1 | |
| ( | ||||
| ( | ||||
| etc. | etc | |||
Assuming t( ≤ t < t( and t, t < t.
Definition of parameters available in %pshreg.
| Parameter | Definition |
|---|---|
| data | specifies the input |
| cens | specifies a |
| time | specifies a |
| admin | specifies a |
| varlist | specifies a list of independent |
| class | specifies a subset of the |
| out | specifies the output |
| firth=1 | request the Firth penalization (default=0). |
| action=estimate | requests the estimation of the Fine-Gray proportional subdistribution hazards model using as covariates all variables specified in varlist (default). If action=code the PSH model is not estimated but the code needed to obtain the PSH analysis using PROC PHREG is printed in the Log window. |
| by | specifies a |
| options | specifies options which are passed to PROC PHREG's MODEL statement. As examples, consider |
| id | specifies a patient identifier |
| cuminc=1 | to plot unadjusted cumulative incidence curves estimated from the empirical subdistribution hazard, stratified by the levels of the first variable specified in varlist. The default value is 0 (no cumulative incidence curve estimation). |
| call | specifies an output |
| clean=1 | if working data set should be cleaned (default), i.e., keeping only relevant variables mentioned in the macro call. |
| missing=drop | to drop missing values in the modified data set (default). To keep observations with missing values in any variable of the varlist set missing=keep. |
| delwork=1 | to delete all working data sets on exit (default). |
| tiedcens=after | specifies whether censored times that are tied with event times should be interpreted as occurring slightly after the event times (the default) or slightly before the event. |
Descriptive statistics of the prognostic factors considered in the CKD study.
| Prognostic factor | SAS variable name | Median (1st, 3rd quartiles) or N (%) |
|---|---|---|
| Age (in decades) | age | 5.6 (4.2, 6.7) |
| Osmolarity (mOsmol/L) | logUosm | 510 (414, 622) |
| Proteinuria (g/L) | logProt | 0.87 (0.23, 2.35) |
| Creatinine clearance (ml/min) | logCCR | 47.5 (30.3, 79.0) |
| PKD | pkd | 18 (6.59%) |
| Beta-blocker | bblock | 119 (47.0%) |
| Diuretics | diur | 120 (47.4%) |
Name of log-transformed variables used in modelling.
Fig. 1Extract of the input SAS data set CKDstudy.
Fig. 2Extract of the SAS data set dat_crr created by %pshreg.
Fig. 3Data set datameans.
Fig. 4Predicted cumulative incidence probabilities at the 10th, 50th and 90th percentiles of osmolarity, assuming average values for all other covariates.
Fig. 5Plot of weighted Schoenfeld-type residuals (95% confidence limits) for creatinine clearance.
Descriptive statistics of the prognostic factors in the smallsample data set.
| Prognostic factor | SAS variable name | Median (1st, 3rd quartiles) or N (%) |
|---|---|---|
| Age, binary (>60 years) | dage60 | 17 (8.5%) |
| Osmolarity, binary (>500 mOsmol/L) | dUosm | 158 (79%) |
| Proteinuria, binary (>3 g/L) | dProt | 26 (13%) |
| Creatinine clearance (ml/min) | logCCR | 91.9 (80.9, 132.86) |
Names of binary or log-transformed variables used in modelling.
Comparison of 95% confidence intervals for Firth-corrected coefficients estimated for the smallsample data set.
| Firth-corrected analysis | |||||
|---|---|---|---|---|---|
| Variable | Parameter estimate | Lower | Upper | Lower | Upper |
| 95% Wald CL | 95% PPL CL | ||||
| dage60 | −2.06 | −5.00 | 0.84 | −6.90 | −0.03 |
| dUosm | 0.19 | −0.74 | 1.11 | −0.68 | 1.17 |
| dProt | 0.94 | −0.03 | 1.91 | −0.08 | 1.86 |
| logCCR | −2.50 | −3.80 | −1.20 | −3.90 | −1.30 |
Wald CL: confidence limits by normal approximation based on standard errors.
PPL CL: profile penalized likelihood confidence limits.
| The PSHREG macro: summary of macro options | ||
| Macro option | Assigned value | Remark |
| data | CKDstudy | Input data set |
| time | Time | Time variable |
| cens | status | Censoring variable |
| failcode | 1 | Code for event of interest |
| cencode | 0 | Code for censored observation |
| tiedcens | after | How censored times tied with event times should be treated |
| admin | Administrative censoring time variable | |
| varlist | age | List of covariables |
| logUosm | ||
| logProt | ||
| logCCR | ||
| pkd | ||
| bblocker | ||
| diur | ||
| class | List of class variables | |
| options | Options to be passed to PROC PHREG | |
| firth | 0 | Standard ML estimation, no Firth correction |
| id | Subject identifier | |
| by | BY processing variable | |
| cuminc | 0 | Requests cumulative incidence curves |
| action | code | No output produced (see log file) |
| weights | 0 | Standard model, no weighting of risk sets |
| clean | 1 | Unnecessary variables removed |
| call | _pshregopt | Data set with this call's macro options |
| out | dat_crr | Output data set for standard Fine-Gray model |
| missing | drop | Delete observations with missing covariate |
| values | ||
| statustab | 1 | Summary of status variable requested |
| delwork | 1 | Temporary data sets deleted on exit |
| ------------ | ----------- | ------------------------------------------ |
| macro version | 2014.09 | |
| build | 201409301506 | |
| The PSHREG macro: Summary of missing values in covariates and outcome variables | |||
| Remark | Covariates | Outcome (Time, status) | Total |
| Observations deleted in input data set because of missing values: | 21 | 0 | 21 |
| The PSHREG macro: Summary of status variable | |||
| Obs | _status | COUNT | PERCENT |
| 1 | Censored | 119 | 47.2222 |
| 2 | Events of interest | 100 | 39.6825 |
| 3 | Competing events | 33 | 13.0952 |
| PROC PHREG DATA=dat_crr covs(aggregate); |
| MODEL (_start_,_stop_)*_censcrr_(0)=age logUosm logProt logCCR pkd bblocker diur; |
| ID _id_; |
| WEIGHT _weight_; |
| RUN; |
| The PHREG Procedure | ||||||
| Analysis of Maximum Likelihood Estimates | ||||||
| Parameter | DF | Parameter Estimate | Standard Error | StdErr Ratio | Chi-Square | Pr > ChiSq |
| age | 1 | −0.13910 | 0.08002 | 1.171 | 3.0219 | 0.0821 |
| logUosm | 1 | 0.71233 | 0.33328 | 1.110 | 4.5682 | 0.0326 |
| logProt | 1 | 0.61339 | 0.07247 | 0.955 | 71.6483 | <.0001 |
| logCCR | 1 | −1.91238 | 0.23115 | 1.033 | 68.4487 | <.0001 |
| PKD | 1 | 1.23414 | 0.34888 | 1.010 | 12.5133 | 0.0004 |
| BBlocker | 1 | 0.42904 | 0.23475 | 1.089 | 3.3403 | 0.0676 |
| diur | 1 | 0.48149 | 0.23248 | 1.048 | 4.2895 | 0.0383 |
| The PHREG Procedure | |||
| Analysis of Maximum Likelihood Estimates | |||
| Parameter | Hazard Ratio | 95% Hazard Ratio | |
| age | 0.870 | 0.744 | 1.018 |
| logUosm | 2.039 | 1.061 | 3.918 |
| logProt | 1.847 | 1.602 | 2.129 |
| logCCR | 0.148 | 0.094 | 0.232 |
| PKD | 3.435 | 1.734 | 6.807 |
| BBlocker | 1.536 | 0.969 | 2.433 |
| diur | 1.618 | 1.026 | 2.553 |
| PROC PHREG DATA=dat_crr covs(aggregate); | |
| MODEL (_start_,_stop_)*_censcrr_(0)=age logUosm logProt logCCR pkd bblock diur/rl; | |
| WEIGHT _weight_; | |
| BASELINE out=cuminccurves covariates=datameans survival=_surv_; | |
| RUN; | |
| DATA cuminccurves; |
| SET cuminccurves; |
| cuminc=1 - _surv_; |
| RUN; |
| SYMBOL1 v=none i=steplj line=1 c=blue width=2; |
| SYMBOL2 v=none i=steplj line=1 c=black width=2; |
| SYMBOL3 v=none i=steplj line=1 c=green width=2; |
| AXIS1 order=0 to 0.40 by 0.05 label=(angle=90 ‘Cumulative incidence of dialysis’); |
| AXIS2 order=0 to 8 by 1 value=(‘0’ ‘1’ ‘2’ ‘3’ ‘4’ ‘5’ ‘6’ ‘7’ ‘8’) label=(‘Time in years’); |
| LEGEND1 value=(‘315’ ‘510’ ‘780’) label=(‘Osmolarity’); |
| PROC GPLOT DATA=cuminccurves; |
| PLOT cuminc*_stop_=logUosm/vaxis=axis1 haxis=axis2 legend=legend1; |
| RUN; |
| PROC PHREG DATA=dat_crr covs(aggregate) outest=estimates; | |
| MODEL (_start_,_stop_)*_censcrr_(0)=age logUosm logProt logCCR pkd bblocker diur; | |
| OUTPUT out=schoenfeld_data wtressch=WSR_age WSR_logUosm WSR_logProt | |
| WSR_logCCR WSR_pkd WSR_bblocker WSR_diur; | |
| ID _id_; | |
| WEIGHT _weight_; | |
| BY _by_; | |
| RUN; | |
| DATA schoenfeld_data; | |
| MERGE schoenfeld_data (keep=WSR_logCCR _stop_ _by_) estimates; | |
| BY _by_; | |
| rescaled_WSR_logCCR=WSR_logCCR+logCCR; | |
| LABEL rescaled_WSR_logCCR=“beta(t) of log2 of creatinine clearance” _stop_=“Time in years”; | |
| RUN; | |
| ODS GRAPHICS on; | |
| ODS SELECT fitplot; | |
| PROC LOESS DATA=schoenfeld_data | |
| PLOTS=residuals(smooth); | |
| MODEL rescaled_WSR_logCCR=_stop_/clm; | |
| RUN; | |
| ODS GRAPHICS off; | |
| DATA schoenfeld_data; |
| SET schoenfeld_data; |
| logstop=log(_stop_); |
| RUN; |
| PROC CORR DATA=schoenfeld_data; | |
| VAR _stop_ logstop; | |
| WITH WSR_age WSR_logUosm WSR_logProt WSR_logCCR WSR_pkd WSR_bblocker | |
| WSR_diur; | |
| RUN; | |
| The CORR Procedure | ||
| Pearson Correlation Coefficients | ||
| Prob>|r| under H0: Rho=0 | ||
| Number of Observations | ||
| _stop_ | logstop | |
| WSR_age | −0.08184 | −0.04724 |
| Standardized Schoenfeld Residual age | 0.4182 | 0.6407 |
| 100 | 100 | |
| WSR_logUosm | −0.11007 | −0.15490 |
| Standardized Schoenfeld Residual logUosm | 0.2756 | 0.1238 |
| 100 | 100 | |
| WSR_logProt | −0.12749 | −0.04825 |
| Standardized Schoenfeld Residual logProt | 0.2062 | 0.6336 |
| 100 | 100 | |
| WSR_logCCR | 0.30715 | 0.34600 |
| Standardized Schoenfeld Residual logCCR | 0.0019 | 0.0004 |
| 100 | 100 | |
| WSR_pkd | 0.08729 | 0.09667 |
| Standardized Schoenfeld Residual PKD | 0.3878 | 0.3387 |
| 100 | 100 | |
| WSR_bblocker | 0.08781 | 0.07293 |
| Standardized Schoenfeld Residual BBlocker | 0.3850 | 0.4709 |
| 100 | 100 | |
| WSR_diur | −0.07860 | −0.08767 |
| Standardized Schoenfeld Residual diur | 0.4370 | 0.3857 |
| 100 | 100 | |
| PROC PHREG DATA=dat_crr covs(aggregate); | |
| MODEL (_start_,_stop_)*_censcrr_(0)=age logUosm logProt logCCR pkd bblocker diur logCCR*logstop1/rl; | |
| logstop1=log(_stop_+1/12); | |
| ID _id_; | |
| WEIGHT _weight_; | |
| HAZARDRATIO logCCR/at(logstop1=-2.49 -0.54 0.08 1.13 1.63); | |
| RUN; | |
| The PHREG Procedure | ||||||
| Analysis of Maximum Likelihood Estimates | ||||||
| Parameter | DF | Parameter Estimate | Standard Error | StdErr Ratio | Chi-Square | Pr>ChiSq |
| age | 1 | −0.12462 | 0.07846 | 1.128 | 2.5228 | 0.1122 |
| logUosm | 1 | 0.65759 | 0.31375 | 1.055 | 4.3927 | 0.0361 |
| logProt | 1 | 0.60890 | 0.07306 | 0.955 | 69.4532 | <.0001 |
| logCCR | 1 | −2.64152 | 0.26778 | 0.812 | 97.3099 | <.0001 |
| PKD | 1 | 1.14126 | 0.33683 | 0.968 | 11.4801 | 0.0007 |
| BBlocker | 1 | 0.40915 | 0.22757 | 1.049 | 3.2326 | 0.0722 |
| diur | 1 | 0.47390 | 0.22469 | 1.005 | 4.4484 | 0.0349 |
| logstop1*logCCR | 1 | 0.83933 | 0.19486 | 0.781 | 18.5532 | <.0001 |
| Analysis of Maximum Likelihood Estimates | ||||
| Parameter | Hazard Ratio | 95% Hazard Ratio Confidence Limits | Label | |
| age | 0.883 | 0.757 | 1.030 | age |
| logUosm | 1.930 | 1.044 | 3.570 | |
| logProt | 1.838 | 1.593 | 2.121 | |
| logCCR | . | . | . | |
| PKD | 3.131 | 1.618 | 6.058 | |
| BBlocker | 1.506 | 0.964 | 2.352 | BBlocker |
| diur | 1.606 | 1.034 | 2.495 | |
| logstop1*logCCR. | . | . | . | logstop1 * logCCR |
| Hazard Ratios for logCCR | |||
| Description | Point Estimate | 95% Wald Robust Confidence Limits | |
| logCCR Unit=1 At logstop1=−2.49 | 0.009 | 0.002 | 0.033 |
| logCCR Unit=1 At logstop1=−0.54 | 0.045 | 0.023 | 0.088 |
| logCCR Unit=1 At logstop1=0.08 | 0.076 | 0.046 | 0.127 |
| logCCR Unit=1 At logstop1=1.13 | 0.184 | 0.118 | 0.286 |
| logCCR Unit=1 At logstop1=1.63 | 0.280 | 0.165 | 0.474 |
| PROC PHREG DATA=small_crr; | |
| MODEL (_start_,_stop_)*_censcrr_(0)=dage60 dUosm dProt logCCR/rl=pl firth; | |
| ID _id_; | |
| WEIGHT _weight_; | |
| TITLE “Firth-corrected PSH model”; | |
| RUN; | |
| Firth-corrected PSH model | |||||
| The PHREG Procedure | |||||
| Analysis of Maximum Likelihood Estimates | |||||
| Parameter | DF | Parameter Estimate | Standard Error | Chi-Square | Pr>ChiSq |
| dage60 | 1 | −2.05496 | 1.47804 | 1.9330 | 0.1644 |
| dUosm | 1 | 0.18740 | 0.47225 | 0.1575 | 0.6915 |
| dProt | 1 | 0.94149 | 0.49547 | 3.6108 | 0.0574 |
| logCCR | 1 | −2.49539 | 0.66178 | 14.2183 | 0.0002 |
| Analysis of Maximum Likelihood Estimates | |||
| Parameter | Hazard Ratio | 95% Hazard Ratio Profile Likelihood Confidence Limits | |
| dage60 | 0.128 | 0.001 | 0.966 |
| dUosm | 1.206 | 0.506 | 3.223 |
| dProt | 2.564 | 0.927 | 6.435 |
| logCCR | 0.082 | 0.021 | 0.275 |
| PROC PHREG DATA=small_crr COVS(AGGREGATE); | |
| MODEL (_start_,_stop_)*_censcrr_(0)=dage60 dUosm dProt logCCR/rl; | |
| ID _id_; | |
| WEIGHT _weight_; | |
| TITLE “Uncorrected PSH model”; | |
| RUN; | |
| The PHREG Procedure | ||||||
| Analysis of Maximum Likelihood Estimates | ||||||
| Parameter | DF | Parameter Estimate | Standard Error | StdErr Ratio | Chi-Square | Pr>ChiSq |
| dage60 | 1 | −15.54092 | 0.40801 | 0.000 | 1450.7792 | <.0001 |
| dUosm | 1 | 0.23984 | 0.49566 | 1.037 | 0.2342 | 0.6285 |
| dProt | 1 | 0.91084 | 0.51374 | 1.025 | 3.1434 | 0.0762 |
| logCCR | 1 | −2.58038 | 0.50017 | 0.749 | 26.6152 | <.0001 |
| Analysis of Maximum Likelihood Estimates | |||
| Parameter | Hazard Ratio | 95% Hazard Ratio Confidence Limits | |
| dage60 | 0.000 | 0.000 | 0.000 |
| dUosm | 1.271 | 0.481 | 3.358 |
| dProt | 2.486 | 0.908 | 6.806 |
| logCCR | 0.076 | 0.028 | 0.202 |