The `cox` action in the `phreg` (Proportional Hazards Regression) action set is used to fit Cox proportional hazards regression models. This statistical method is fundamental in survival analysis for investigating the relationship between the survival time of subjects and one or more predictor variables. The action can handle both continuous and categorical predictors, supports various methods for handling tied survival times, and includes robust model selection capabilities to help identify the most significant variables influencing survival.
| Parameter | Description |
|---|---|
| alpha | Specifies the significance level for constructing all confidence intervals. |
| attributes | Changes the attributes of variables used in this action. |
| class | Names the classification variables to be used as explanatory variables in the analysis. |
| classGlobalOpts | Lists options that apply to all classification variables. |
| classLevelsPrint | When set to False, suppresses the display of class levels. |
| clb | When set to True, displays upper and lower confidence limits for the parameter estimates. |
| code | Writes SAS DATA step code for computing predicted values of the fitted model. |
| collection | Defines a set of variables that are treated as a single effect with multiple degrees of freedom. |
| corrB | When set to True, displays the correlation matrix of the parameters. |
| covB | When set to True, displays the covariance matrix of the parameters. |
| display | Specifies a list of results tables to send to the client for display. |
| freq | Names the numeric variable that contains the frequency of occurrence for each observation. |
| hessian | When set to True, uses the analytical Hessian instead of the finite difference Hessian. |
| lassoRho | Specifies the base regularization parameter for the LASSO method. |
| lassoSteps | Specifies the maximum number of steps for the LASSO method. |
| lassoTol | Specifies the convergence criterion for the LASSO method. |
| logLikeNull | When set to True, displays the -2 log likelihood of the NULL model. |
| model | Specifies the dependent variable, explanatory effects, and model options. |
| multimember | Allows an observation to be associated with multiple levels of a classification variable. |
| multipass | When set to True, levelizes the input data table every time it is read. |
| nClassLevelsPrint | Limits the display of class levels. A value of 0 suppresses all levels. |
| noStdErr | When set to True, does not compute the covariance matrix or any statistic that depends on it. |
| optimization | Specifies the technique and options for performing the optimization. |
| output | Creates a server-side table containing observation-wise statistics computed after fitting the model. |
| outputTables | Lists the names of results tables to save as CAS tables on the server. |
| partByFrac | Specifies the fractions of the data to be used for validation and testing. |
| partByVar | Names the variable and its values to use for partitioning the data into training, validation, and testing roles. |
| polynomial | Specifies a polynomial effect. All variables must be numeric. |
| selection | Specifies the method and options for performing model selection. |
| spline | Expands variables into spline bases whose form depends on the specified parameters. |
| ss3 | When set to True, performs Type 3 effect tests. |
| strata | Names the variable that identifies the strata for a stratified analysis. |
| strataMissing | When set to True, allows missing values as valid STRATA variable values. |
| table | Specifies the input data table. |
| weight | Names the numeric variable to use for a weighted analysis. |
This example uses data from a study on bone marrow transplants for leukemia patients. The data, stored in the `Bmt` table, includes patient survival time, censoring status, and various risk factors. This setup is typical for survival analysis.
| 1 | DATA mycas.Bmt; SET sashelp.Bmt; RUN; |
This example fits a simple Cox proportional hazards model. The survival time is defined by `T`, the censoring variable is `Status` (with event=1), and `Group` is the predictor. The `model` parameter specifies the survival time and censoring information, along with the explanatory variable.
| 1 | PROC CAS; |
| 2 | phreg.cox TABLE={name='Bmt'}, |
| 3 | model={depVars={{name='T', event='Status(1)'}}, effects={{vars={'Group'}}}}; |
| 4 | RUN; |
This example demonstrates fitting a Cox model using a stepwise selection method to identify the most significant predictors from a set of candidates (`Group`, `Age`, `TA`, `DA`). The `selection` parameter is used to specify the method (`stepwise`) and the significance levels for entry (`slEntry`) and stay (`slStay`).
| 1 | PROC CAS; |
| 2 | phreg.cox TABLE={name='Bmt'}, |
| 3 | model={depVars={{name='T', event='Status(1)'}}, effects={{vars={'Group', 'Age', 'TA', 'DA'}}}}, |
| 4 | selection={method='stepwise', slEntry=0.05, slStay=0.05}; |
| 5 | RUN; |
This example performs a stratified Cox regression. The analysis is stratified by the `Group` variable, meaning a separate baseline hazard function is estimated for each group. This is useful when the proportional hazards assumption does not hold for a categorical variable. `Age` and `TA` are included as covariates.
| 1 | PROC CAS; |
| 2 | phreg.cox TABLE={name='Bmt'}, |
| 3 | strata='Group', |
| 4 | model={depVars={{name='T', event='Status(1)'}}, effects={{vars={'Age', 'TA'}}}}; |
| 5 | RUN; |