mixor {mixor} | R Documentation |
This function fits mixed-effects ordinal and binary response models. Various link functions are supported including probit, logistic, and complementary log-log. For longitudinal data, the mixor
function allows for individual varying intercepts and slopes across times.
mixor(formula, data, id, which.random.slope = NA, subset, weights, exclude.fixed.effect = NA, CONV = 1e-04, empirical.prior = FALSE, quadrature.dist = "Normal", nAGQ = 11, adaptive.quadrature = TRUE, link = "probit", KG = 0, KS = 0, IADD = -1, indep.re = FALSE, random.effect.mean = TRUE, UNID = 0, vcov = TRUE)
formula |
an object of class " |
data |
an optional |
id |
name of clustering variable in the |
which.random.slope |
|
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
weights |
when supplied, indicates differential weights are used; otherwise each id is weighted equally. |
exclude.fixed.effect |
the RHS of the model includes both fixed and random effects. Variables are identified as random effects using |
CONV |
convergence criteria, default is 0.0001. |
empirical.prior |
logical. If TRUE, uses empirical prior for random effects. |
quadrature.dist |
distribution for random effects. Either |
nAGQ |
number of quadrature nodes per dimension. For one random effect, nAGQ=20 is reasonable but should be reduced to 5-10 for multiple random effects. |
adaptive.quadrature |
logical indicating whether adaptive quadrature (default) or non-adaptive quadrature is performed. |
link |
Link function, either |
KG |
an optional integer reflecting the number of covariates to interact with threshold parameters (the first KG variables on the RHS of the model formula, so the order of the variables on the RHS of the model formula is important when using |
KS |
an optional integer reflecting the number of covariates used in scaling (the first KS variables on the RHS of the model formula, so the order of the variables on the RHS of the model formula is important when using |
IADD |
indicates how XB part of model is included; -1 subtract covariates and mean of random effects from thresholds; 1 add covariates and mean of random effects to thresholds. Default is -1 (subtract XB). |
indep.re |
logical. If TRUE, independent random effects. Default is FALSE which assumes correlated random effects. |
random.effect.mean |
logical. If TRUE, estimate the mean of the random effects. |
UNID |
indicator variable where 0 = random effects are multi-dimensional; 1 = random effects are variables related to a uni-dimensional random effect (e.g., item indicators of a latent variable). |
vcov |
logical. Default is |
A typical model has the form response ~ terms where response is the (numeric) response vector and terms is a series of terms which specifies a linear predictor for response. The response can also be a censored survival response, of the form Surv(time,censorvariable)
A list with components:
call |
Model call formula |
Deviance |
Model deviance |
Quadrature.points |
number of quadrature nodes per dimension used in fit |
Model |
a matrix summarizing the model fit including columns Estimate, SE, Z, and P-value |
varcov |
The variance-covariance matrix |
EBmean |
empirical Bayes estimates of the means of the posterior distribution for each id |
EBvar |
empirical Bayes estimates of posterior variance/covariance for each id) |
RIDGEMAX |
Ridge |
RLOGL |
Log-likelihood |
SE |
a matrix corresponding the standard errors of the parameters estimates in |
AIC |
AIC |
SBC |
Schwarz criterion |
AICD |
Akaike information criterion |
SBCD |
deviance information criterion |
MU |
mean of random effects |
ALPHA |
fixed effects estimates |
SIGMA |
random effects variance-covariance matrix |
GAM |
thresholds |
TAU |
scaling parameter estimates when proportional odds are not assumed. Returns when |
IADD |
indicates how the XB part of model was included; -1 subtract covariates and mean of random effects from thresholds; 1 add covariates and mean of random effects to thresholds. |
Y |
the response from the fitted model. |
X |
the random effects terms from the fitted model. |
W |
the fixed effects terms from the fitted model. |
MAXJ |
the number of ordinal levels. |
random.effect.mean |
If TRUE, the mean of the random effects was estimated. |
KS |
integer reflecting the number of covariates that were specified to use in scaling (the first KS variables on the RHS of the model formula). |
KG |
integer reflecting the number of covariates that were specified to interact with the threshold parameters (the first KG variables on the RHS of the model formula). |
id |
name of clustering variable in the |
which.random.slope |
the number of the predictor variable on the RHS of the model formula having a random slope. When |
ICEN |
if 1 indicates right-censoring was considered in the model fit. |
link |
Link function, either |
terms |
terms from the fitted model. |
This function is essentially a wrapper for the MIXOR stand-alone program by Hedeker and Gibbons with added generic methods in R to enhance functionality. Note that the Fortran wrapper requires missing values to be denoted by -9 rather than NA.
Kellie J. Archer, Donald Hedeker, Rachel Nordgren, Robert D. Gibbons
Hedeker D. and Gibbons R.D. (1996) A computer program for mixed-effects ordinal regression analysis. Computer Methods and Programs in Biomedicine 49, 157-176. Hedeker D and Gibbons R.D. (2006) Longitudinal Data Analysis, Wiley, Hoboken, New Jesery.
See Also as summary.mixor
, predict.mixor
, coef.mixor
, vcov.mixor
, print.mixor
library("mixor") data("SmokingPrevention") # data frame must be sorted by id variable SmokingPrevention<-SmokingPrevention[order(SmokingPrevention$class),] # school model Fitted.school<-mixor(thksord~thkspre+cc+tv+cctv, data=SmokingPrevention, id=school, link="logit") summary(Fitted.school) vcov(Fitted.school) # students in classrooms analysis Fitted.students<-mixor(thksord~thkspre+cc+tv+cctv, data=SmokingPrevention, id=class, link="logit") summary(Fitted.students) coef(Fitted.students) vcov(Fitted.students) cm<-matrix(c(-1,-1,-1,0,0,0,0,0, 0, 0, 0,0,0,0,0,0, 0, 0, 0,1,0,0,0,1),ncol=3,byrow=TRUE) Contrasts(Fitted.students, contrast.matrix=cm)