repolr(formula, subjects, data, times, categories, corr.mod = "independence", alpha = 0.5, po.test = FALSE, fixed = FALSE, poly = NULL, space = NULL, diffmeth = "analytic", fit.opt = rep(NA, 5))
alpha) during model fitting.
alpha. The folowing are available:
summary.repolris used to obtain and print a summary of the fitted model.The fitted model is an object of class
repolr and has the following values:
repolrfunction fits models for repeated ordinal scores using GEE methodology.
The user is required to specify, as a minimum: (i) a data set name (
data), (ii) a model formula (
formula), (iii) a cluster identification variable (
subjects), (iv) a time variable (
time) and (v) the number of categories used for the response variable (
The data may contain records with missing data for either the response variable or the explanatory variables. The response variable must have at least three ordered categories (K greater than or equal to 3) and, as K-1 cut-point parameters are estimated, an additional intercept term can not be explicitly included in the model formula. A subject variable, which takes integer values from 1 to N with no missing values allowed, indicates the data clusters (patients or experimental units) and a time variable indicates the within cluster ordering; times must be ordered integers starting from one and spaced to indicate the relative distance between successive times. For instance, four observations at equally spaced times would be entered as 1, 2, 3 and 4, whereas if the first two observations were separated by half the time interval of the other observations then coding would be 1, 2, 4 and 6. The data must be pre-sorted by time clusters within each subject, and complete, i.e. where data is missing for a particular time it must be indicated as such. the datasets provided with this package provide exemplars of the required data formatting; e.g.
The available options for the correlation model (
corstr) are AR1, uniform, fixed and independence, with default setting independence.
Additionally there are a number of other algorithm related options.
The algorithm is generally robust to the initial value for
alpha (default setting = 0.5), where estimation is rerquired, however a starting value for
alpha can be set. If required the correlation parameter, set via
alpha, can be fixed throughout model fitting, and not updated, by setting the option
The partial derivatives of the log of the determinant of the robust variance matrix (generalized variance), with respect to
alpha, can either be determined analytically (
analytic setting for
diffmeth) or numerically by finite differencing (
numeric setting for
diffmeth). The latter method is often quicker for complex regression models, or if K is large.
poly, specifies the order of fitted orthogonal polynomial contrasts for the cut-point parameters; the default setting for repolr is to fit the complete set of cut-point parameters. Fitting polynomial contrasts can be particularly useful for long ordinal scores, where K is large, or where a particular form for the cut-point parameters is preferred; e.g. increasing uniformly at the extremes of the score scale. The order of the polynomial must be an integer less than K-1. The function requires one additional argument,
space, that indicates the spacing between categories. This is normally set to 1:
categories when all categories are observed, but can be modified to provide more realsitic models if for instance some categories are not observed.
The proportional odds assumption can be tested, using a score test, by setting the option
po.test to TRUE.
fit.opt argument provides control of the fitting algorithm; the defaults are
c(cmaxit = 10, omaxit = 5, ctol = 0.001, otol = 0.00001, h = 0.01).
These control the maximum number of iterations for updating estimates of
alpha, the maximum number of iterations for updating the regression parameters within each of the updating steps for
alpha, the convergence tolerances for estimation of
alpha and the regression parameters, and the interval
h for finite differencing, if the
numeric option is selected.
Model fitting is implemented via a suite of of functions developed using RcppArmadillo (Rcpp) that construct correlations between derived binary variables at each time-point (
smat) and between time-points (
cmat). Complete (sparse) model covariance matrices are constructed using
alphpow, with model parameter estimation implemented in
ordgee, using current estimates of the inverse of the correlation matrix from
upalpha provides updates of correlation parameter estimates, and
potest implements the test of proportional odds. These functions are not documented in detail here as they are primarily for internal use within repolr. There use outside of this setting is not recommended.
Parsons NR, Edmondson RN, Gilmour SG. A generalized estimating equation method for fitting autocorrelated ordinal score data with an application in horticultural research. Journal of the Royal Statistical Society C 2006; 55:507-524.
Stiger TR, Barnhart HX, Williamson JM. Testing proportionality in the proportional odds model fitted with GEE. Statistics in Medicine 1999; 18:1419-1433.
Parsons NR. Proportional-odds models for repeated composite and long ordinal outcome scales. Statistics in Medicine 2013; 32:3181-3191.
data(HHSpain) mod.0 <- repolr(HHSpain~Sex*Time, data=HHSpain, categories=4, subjects="Patient", times=c(1,2,5), corr.mod="uniform", alpha=0.5) summary(mod.0) summary(update(mod.0, diffmeth = "numeric")) summary(update(mod.0, fixed = TRUE, alpha =0.5))
Run the code above in your browser using DataCamp Workspace