*! version 1.0 19 Mar 2024

Title

stfform -- Functional form test for Cox Models

Syntax

stfform varlist
[,
options]

should be used afer stcox, the current dataset should be stset before using stfform. If varlist is not specified, stfform performs the functional form test for all the numeric covariates used in the previous call of stcox. Numeric covariates and categorical covariates are classified internally using vl set. If varlist is specified stfform discards variables not included in the previous call of stcox.

Optional
nsimulation(#) sets the number of simulated values for the cumulative martingale residuals. Default value is 1000.

nograph forces stfform not to display the plots.

nplot(#) sets the number of simulations displayed in the plot. Default value is 20.

saving(name) save the simulation data to filename; use replace to overwrite existing filename

noxb forces stfform not to test the functional form of the link function.

nolog forces stfform not to display the progress bar during the execution.

Description

stfform performs test for the functional form and the adequacy of the exponential link function of a previously fit Cox model based on Lin, Wei and Ying (1993) .

Options

Main

nsimulation(#) sets the number of simulations for the cumulative martingale residuals. Default value is 1000.

nograph forces stfform not to display the plots.

nplot(#) sets the number of simulations displayed in the plot. Default value is 20.

saving(name) creates a Stata data file (.dta file) in long format. This dataset contains, for each variable, the values (variable z), the cumulative martingale residuals (variable M) and the simulated realizations of the null process (varlist W*). Variables are identified by variable var.

noxb forces stfform not to test the functional form of the link function.

nolog forces stfform not to display the progress bar during the execution.

Examples

Setup
. webuse drugtr
Show st settings
. stset
Fit Cox proportional hazards model
. stcox drug age
Test the functional form
. stfform

Author

Daniele Spinelli
Department of Statistics and Quantitative Methods
University of Milano-Bicocca, Italy
daniele.spinelli@unimib.it