An S-Plus function to calculate relative risks and adjusted means for regression models using natural splines
Related Experiment Video
Updated: Jul 20, 2026

An R-Based Landscape Validation of a Competing Risk Model
Published on: September 16, 2022
Jiguo Cao1, Marie-France Valois, Mark S Goldberg
1Department of Mathematics and Statistics, McGill University, Montreal, Quebec H3A 1A1, Canada.
Abstract:
We provide for generalized linear regression models that use natural cubic splines to model predictors an S-Plus function to calculate relative risks (RR), log relative risk (logRR), mean percent change (MPC) for continuous covariates modeled using a logarithmic link as well as adjusted means differences (MD) for the identity link. The function makes explicit use of the natural spline basis functions, the estimated coefficients for each natural spline basis function, and the fitted correlation matrix for the estimated coefficients and can thus accommodate any number of degrees of freedom. The main function produces a publication-quality graph of all of these quantities as compared to a user-specified reference value as well as the associated confidence limits. In another function, specific values of these statistics comparing a vector of values of the independent variable to the reference value can be calculated rather than plotted.
Related Concept Videos
Residuals and Least-Squares Property
If the observed data point lies above the line, the residual is positive, and the line underestimates the actual data value for y. If the observed data point lies below the line, the residual is negative, and the line overestimates the actual data value for y.
The process of fitting the best-fit...
Parametric Survival Analysis: Weibull and Exponential Methods
Weibull Distribution
The Weibull distribution is a flexible model used in parametric survival analysis. It can handle both increasing and decreasing hazard rates, depending on its shape parameter...
Assumptions of Survival Analysis
Relative Risk
Introduction To Survival Analysis
The primary goal of survival analysis is to estimate survival time—the time until a...
Regression Analysis
In regression analysis, a regression equation is determined based on the line of best fit– a line that best fits the data points plotted in a graph. This line is also called the regression line. The algebraic equation for the regression line is called the regression equation. It is represented as:
