Cox Proportional Hazards Model: Example 4 - Model Building and Deployment to New Data

The data set for this example, myeloma.sta, is taken from Krall, Uthoff, and Harley (1975). Multiple myeloma is a malignant disease characterized by the accumulation of abnormal plasma cells, a type of white blood cell, in the bone marrow.

Open the example data file myeloma.sta, and start the Cox Proportional Hazards module. Following are instructions to do this from the ribbon bar and from the classic menus.

Ribbon bar. Select the Home tab. In the File group, click the Open arrow and from the menu, select Open Examples to display the Open a Statistica Data File dialog box. The data set is located in the Datasets folder.

Next, on the Statistics tab, in the Advanced/Multivariate group, click Advanced Models and from the menu, select Cox Proportional Hazards to display the Cox Proportional Hazards Regression dialog box.

Classic menus. Select Open Examples from the File menu to display the Open a STATISTICA Data File dialog box. myeloma.sta is located in the Datasets folder.   

Next, from the Statistics - Advanced Linear/Nonlinear submenu, select Cox Proportional Hazards Models.

Starting the analysis

In the Cox Proportional Hazards Regression dialog box, on the Quick tab, in the Input type group box, select the Survival time, covariates, factors, censor option button.

Click the Variables button to display the variable specification dialog box, and specify variables as shown in the following image.

Click OK.

Specify the codes for the complete and censored values. Enter a value of 1 for the Code for complete responses and a value of 0 for the Code for censored responses.

Select the Options tab. In the Model Building group box, select the Best Subsets option button. Click OK to run the analysis and display the Cox Proportional Hazards Results dialog box.

On the Quick tab, click the Model Building button to produce the results of the best subsets procedure.

This spreadsheet displays the best models for a given number of variables. Notice that as more variables are added to the model, the increase in the score statistic decreases.  

For this data, select the three variable model. To do this, in the Cox Proportional Hazards Results dialog box, click the Modify button to return to the Cox Proportional Hazards Regression dialog box.

On the Quick tab, click the Variables button, and specify variables as shown in the following image.

Click OK.

Select the Options tab. Select All Effects as the Model Building method. Click OK to run the analysis and display the Cox Proportional Hazards Results dialog box.

On the Quick tab, click the Parameter estimates button to review the regression coefficients.

To save this model and deploy it on new data, click the Code Generator button and select PMML script.

You can save the PMML code and use the Rapid Deployment module to deploy the model.

For the second part of this example, which involves deploying the Cox model, open the myeloma2.sta data file.

Start the Rapid Deployment module:

Ribbon bar. Select the Data Mining tab, and in the Deployment group, click Rapid Deployment.

Classic menus. From the Data Mining menu, select Rapid Deployment of Predictive Models (PMML).

In the Rapid Deployment of Predictive Models dialog box, click the Load models from disk button to display the Open PMML files dialog box. Open the MyelomaDeploymentScript.xml file located in the Datasets folder.  

Click the Summary: Predicted & residual values (classifications) button to produce the predicted survival probabilities as a function of the predictors and the observed time.