Spline regression often represents a less biased and more efficient alternative to standard linear, curvilinear, or categorical analyses of continuous exposures and confounders. Benefits of restricted cubic and quadratic splines have been described in the epidemiologic and biomedical literature.1-2 Analogous to the SAS (SAS Institute, Inc., Cary, North Carolina) code provided by Harrell3 for estimating restricted cubic splines, we present straightforward SAS code for estimating restricted quadratic splines. Using data from the HIV clinical cohort at the University of North Carolina Center for AIDS Research,4 we illustrate use of restricted quadratic splines in regression modeling for trend analysis and control of a continuous confounder. Details regarding the functional form of the restricted quadratic splines as well as SAS code for estimating restricted quadratic spline functions are provided in the eAppendix (http://links.lww.com). The data and SAS code used to generate the results included in this paper are also in the eAppendix. First, we illustrate the use of a restricted quadratic splines when estimating the association between log10 HIV-1 viral load centered at 2.301 log10 copies/ml and mortality. Figures S1 A-1C show the unadjusted association between centered log10 HIV-1 viral load at therapy initiation and the relative hazard of death estimated from several Cox proportional hazards models that (A) assume a log-linear relationship, (B) use indicators corresponding to quartiles of centered log10 HIV-1 viral load, or (C) include restricted quadratic splines with 4 equal knots based on the case distribution. Figure 1 Unadjusted associations between centered log10 HIV-1 viral load at therapy initiation and relative hazard of death among 557 male participants in the University of North Carolina Center for AIDS Research HIV clinical cohort, 1999-2010. HIV-1 viral load ... Based on the Akaike information criterion (AIC),5 presented in Figure 1, the restricted quadratic splines model provides the best fit to the data. The P- value for a joint Wald test of the three restricted quadratic splines basis functions included in the model was 0.010. The restricted quadratic splines model suggests a non-log-linear relationship between centered log10 HIV-1 viral load at therapy initiation and the relative hazard of death. Second, we illustrate the use of restricted quadratic splines when controlling for centered log10 HIV-1 viral load as a confounder using a Cox model. The table shows the hazard ratios for the association between an indicator of CD4 cell count ≤350 cells/mm3 at therapy initiation and hazard of death, both unadjusted and adjusted for confounding by viral load at therapy initiation. Adjusting for viral load using a log-linear term attenuated the point estimate corresponding to the CD4 cell count indicator by 26%. Adjustment using restricted quadratic splines with 4 equal knots based on the case distribution attenuated the point estimate by 30%. Attenuation upon control for viral load is expected given that higher viral load was associated with lower CD4 cell count (http://links.lww.com), and an elevated risk of subsequent mortality. Similar results were observed when restricted cubic splines was used instead of a restricted quadratic splines with the same degrees of freedom and comparable knot locations (http://links.lww.com). Table Hazard ratio for association between CD4 cell count less than or equal to 350 cells/mm3 versus greater than 350 cells/mm3 at therapy initiation and death among 557 male participants in the University of North Carolina Center for AIDS Research HIV clinical ... For the first example, use of restricted quadratic splines rather than linear terms or indicators provided a better fit, revealing non-linear relationships that otherwise may have not been apparent. In the second example, use of a restricted quadratic spline resulted in stronger attenuation of a crude association, which likely represents better control of confounding by viral load. The macro presented here offers users a straightforward SAS option for implementing restricted quadratic splines regression. This code is intended to aid in model selection as well as assessing robustness of inferences when comparing various modeling strategies.3,6-7 Furthermore, we hope the examples and code will facilitate the use of splines among researchers hesitant to employ less intuitive but largely equivalent modeling strategies,3,7 and in turn broaden the use of splines in applied epidemiologic research.
Read full abstract