Adjusted Natural Cubic Spline [snp7: STB-22] ------------------------------ ^sp_adj^ yvar xvar [[^if^ exp] [^in^ range] [^, n^knots^(^#^)^ ^kn^ots^(^#,...,#^)^ ^a^djust^(^varlist^)^ ^reg^ress^(^string^)^ ^gen(^newvar^)^ ^nog^raph graph_options ] Description ----------- ^sp_adj^ fits a natural cubic spline in xvar to yvar adjusting for the variables in ^adjust^ and, by default, plots the fitted smooth curve. The regression can be carried out with any ^estimate^ command, the default being ^regress^ (ordinary least squares). ^sp_adj^ optionally saves the adjusted smooth transformation. Options ------- ^knots^ specifies the exact location of the interior knots. ^nknots^ specifies the number of interior knots. (Ignored if the locations are specified). ^regress(^estimate^)^ fits the cubic spline using the command "estimate". The default is ^regress^. If ^cox^ is used, the censoring variable may be specified using ^dead^. Similarly the option ^strata^ may be used with ^clogit^. If using ^blogit^, ^bprobit^, ^glogit^, or ^gprobit^, put the pop_var as the first varaible in ^adjust^. ^adjust^ provides a list of additional variables to be included in the regression. If using logit or probit with grouped data, the first varaible in ^adjust^ should be the pop_var. ^nograph^ suppresses the graph. ^gen(^newvar^)^ creates newvar containing the smooth transformation of yvar. The variable is in the scale of the linear predictor (index) in the chosen regression model. graph_options are any of the options allowed with ^graph, twoway^; see ^help graph^. Remarks ------- The natural cubic spline has knots at the ends of xvar as well at the interior sites. It is constrained to be linear beyond the the extreme knots and to be everywhere twice continuously differentiable. By default the interior knots are placed at equally spaced quantiles. Author ------ Peter Sasieni Imperial Cancer Research Fund, London FAX 011-44-71-269-3429 Also see -------- Manual: [4] estimate STB: snp7 (STB-22) On-line: ^help^ for ^graph^, ^spline^, and ^spbase^