cpmgee | R Documentation |
This function function fits cumulative probability models (CPMs) clustered/longitudinal continuous response data based on GEE methods for ordinal data.
cpmgee(
formula,
subjects,
data,
corr.mod = "independence",
alpha = 0.5,
fit.opt = rep(NA, 5)
)
formula |
an R formula object |
subjects |
a character string specifying the name of the subject variable |
data |
a data frame including response data and covariates |
corr.mod |
a character string specifying the working correlation structure ("independence", "exchangeable", and "ar1") |
alpha |
an initial value for the association parameter in the range of 0.05 to 0.95. |
fit.opt |
a vector of options to control the behavior of the fitting algorithm |
CPMs are useful for the analysis of continuous response data which may need to be transformed prior to fitting standard regression models. CPMs are semi-parametric linear transformation models; they nonparametrically estimate the appropriate transformation as part of the fitting procedure.
We propose two feasible and computationally efficient approaches to fit CPMs for clustered continuous response variables with different working correlation structures (independence, exchangeable and AR1 working correlation structures).
CPMs with independence working correlation can be efficiently fit to clustered continuous responses with thousands of distinct values based on CPMs and sandwich estimator for variances.
To improve efficiency, CPMs with more complex working correlation structures (exchangeable and AR1) can be fit with a one-step GEE estimator for repolr (repeated measures proportional odds logistic regression proposed by Parsons). The number of distinct response values can be further reduced by equal-quantile binning or rounding.
Estimates of the mean, quantiles, and exceedance probabilities conditional on covariates (new data) can be derived from the model fit.
A list containing the following components:
max.id |
number of clusters |
fitted.values |
a vector of the fitted values |
linear.predictors |
a vector of linear predictors |
coefficients |
a vector of interecept and regression parameters |
robust.var |
the robust (sandwich) variance matrix |
alpha |
the estimate of the association parameter |
Tian et al. (2023) "Analyzing clustered continuous response variables with ordinal regression models." Biometrics.
Parsons, N. (2017). repolr: an R package for fitting proportional-odds models to repeated ordinal scores. R package version 3.4 https://CRAN.R-project.org/package=repolr
Harrell, F. (2020). rms: Regression modeling strategies. R package version 6.1.0. https://CRAN.R-project.org/package=rms
Liu, Q., Shepherd, B. E., Li, C., & Harrell Jr, F. E. (2017). Modeling continuous response variables using ordinal regression. Statistics in Medicine, 36(27), 4316-4335.
cdf_cpmgee, quantile_cpmgee, mean_cpmgee
data(data)
# y_continuous: continuous outcome
# y: continuous outcome binned to 50 categories
# independence working correlation structure
mod_cpmgee_ind <- cpmgee(formula = y_continuous ~ x + t, data = data,
subjects = 'id', corr.mod = 'independence')
# exchangeable working correlation structure
mod_cpmgee_ex <- cpmgee(formula = y ~ x + t, data = data,
subjects = 'id', corr.mod = 'exchangeable', alpha = 0.5)
# new data
new_data <- data.frame(x = c(0,1), t = 0.2)
# conditional quantities for independence working correlation structure
mean_ind <- mean_cpmgee(mod_cpmgee_ind, data$y_continuous, new_data)
median_ind <- quantile_cpmgee(mod_cpmgee_ind, data$y_continuous, new_data, 0.5)
cdf_ind <- cdf_cpmgee(mod_cpmgee_ind, data$y_continuous, new_data, 5)
# conditional quantities for exchangeable working correlation structure
mean_ex <- mean_cpmgee(mod_cpmgee_ex, data$y, new_data)
median_ex <- quantile_cpmgee(mod_cpmgee_ex, data$y, new_data, 0.5)
cdf_ex <- cdf_cpmgee(mod_cpmgee_ex, data$y, new_data, 5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.