Natural Cubic Spline [snp7: STB-22] --------------------- ^spline^ yvar xvar [[^if^ exp] [^in^ range] [^, n^knots^(^#^)^ ^kn^ots^(^#,...,#^)^ ^logit^ ^reg^ress^(^string^)^ ^gen(^newvar^)^ ^nog^raph graph_options ] Description ----------- ^spline^ fits a natural cubic spline in xvar to yvar and, by default, plots the original data together with the fitted smooth curve. The regression can be carried out with any estimation command, the default being ^regress^ (ordinary least squares). ^spline^ optionally saves the smoothed variable. 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^. Use ^sp_adj^ instead of ^spline^ for ^blogit^, ^bprobit^, ^clogit^, ^glogit^, or ^gprobit^ or ^cox^ with ^dead^. ^logit^ transforms the fitted values and plots the y-axis on a logit scale. The observations are automatically jittered in the vertical scale and are plotted just outside the range of the smoothed curve. ^nograph^ suppresses the graph. ^gen(^newvar^)^ creates newvar containing the smoothed values of yvar. 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^, ^spbase^, and ^sp_adj^