rmult.acl {SimCorMultRes}R Documentation

Simulating Correlated Ordinal Responses Conditional on a Marginal Adjacent-Category Logit Model Specification

Description

Simulates correlated ordinal responses assuming an adjacent-category logit model for the marginal probabilities.

Usage

rmult.acl(clsize = clsize, intercepts = intercepts, betas = betas,
  xformula = formula(xdata), xdata = parent.frame(),
  cor.matrix = cor.matrix, rlatent = NULL)

Arguments

clsize

integer indicating the common cluster size.

intercepts

numerical vector or matrix containing the intercepts of the marginal adjacent-category logit model.

betas

numerical vector or matrix containing the value of the marginal regression parameter vector.

xformula

formula expression as in other marginal regression models but without including a response variable.

xdata

optional data frame containing the variables provided in xformula.

cor.matrix

matrix indicating the correlation matrix of the multivariate normal distribution when the NORTA method is employed (rlatent = NULL).

rlatent

matrix with (clsize * ncategories) columns containing realizations of the latent random vectors when the NORTA method is not preferred. See details for more info.

Details

The formulae are easier to read from either the Vignette or the Reference Manual (both available here).

The assumed marginal adjacent-category logit model is

logPr(Yit=jxit)Pr(Yit=j+1xit)=βtj0+βtxitlog \frac{Pr(Y_{it}=j |x_{it})}{Pr(Y_{it}=j+1 |x_{it})}=\beta_{tj0} + \beta^{'}_{t} x_{it}

For subject ii, YitY_{it} is the tt-th ordinal response and xitx_{it} is the associated covariates vector. Also βtj0\beta_{tj0} is the jj-th category-specific intercept at the tt-th measurement occasion and βt\beta_{t} is the regression parameter vector at the tt-th measurement occasion.

The ordinal response YitY_{it} is obtained by utilizing the threshold approach described in the Vignette. This approach is based on the connection between baseline-category and adjacent-category logit models.

When βtj0=βj0\beta_{tj0}=\beta_{j0} for all tt, then intercepts should be provided as a numerical vector. Otherwise, intercepts must be a numerical matrix such that row tt contains the category-specific intercepts at the tt-th measurement occasion.

betas should be provided as a numeric vector only when βt=β\beta_{t}=\beta for all tt. Otherwise, betas must be provided as a numeric matrix with clsize rows such that the tt-th row contains the value of βt\beta_{t}. In either case, betas should reflect the order of the terms implied by xformula.

The appropriate use of xformula is xformula = ~ covariates, where covariates indicate the linear predictor as in other marginal regression models.

The optional argument xdata should be provided in “long” format.

The NORTA method is the default option for simulating the latent random vectors denoted by eitjO3e^{O3}_{itj} in the Vignette. To import simulated values for the latent random vectors without utilizing the NORTA method, the user can employ the rlatent argument. In this case, row ii corresponds to subject ii and columns (t1)ncategories+1,...,tncategories(t-1)*\code{ncategories}+1,...,t*\code{ncategories} should contain the realization of eit1O3,...,eitJO3e^{O3}_{it1},...,e^{O3}_{itJ}, respectively, for t=1,,clsizet=1,\ldots,\code{clsize}.

Value

Returns a list that has components:

Ysim

the simulated nominal responses. Element (ii,tt) represents the realization of YitY_{it}.

simdata

a data frame that includes the simulated response variables (y), the covariates specified by xformula, subjects' identities (id) and the corresponding measurement occasions (time).

rlatent

the latent random variables denoted by eitjO3e^{O3}_{itj} in the Vignette.

Author(s)

Anestis Touloumis

References

Cario, M. C. and Nelson, B. L. (1997) Modeling and generating random vectors with arbitrary marginal distributions and correlation matrix. Technical Report, Department of Industrial Engineering and Management Sciences, Northwestern University, Evanston, Illinois.

Li, S. T. and Hammond, J. L. (1975) Generation of pseudorandom numbers with specified univariate distributions and correlation coefficients. IEEE Transactions on Systems, Man and Cybernetics 5, 557–561.

Touloumis, A. (2016) Simulating Correlated Binary and Multinomial Responses under Marginal Model Specification: The SimCorMultRes Package. The R Journal 8, 79–91.

Touloumis, A., Agresti, A. and Kateri, M. (2013) GEE for multinomial responses using a local odds ratios parameterization. Biometrics 69, 633–640.

See Also

rbin for simulating correlated binary responses, rmult.clm and rmult.crm for simulating correlated ordinal responses, and rmult.bcl for simulating nominal responses.

Examples

## See Example 3.4 in the Vignette.
beta_intercepts <- c(3, 1, 2)
beta_coefficients <- c(1, 1)
sample_size <- 500
cluster_size <- 3
set.seed(321)
x1 <- rep(rnorm(sample_size), each = cluster_size)
x2 <- rnorm(sample_size * cluster_size)
xdata <- data.frame(x1, x2)
identity_matrix <- diag(4)
equicorrelation_matrix <- toeplitz(c(1, rep(0.95, cluster_size - 1)))
latent_correlation_matrix <- kronecker(equicorrelation_matrix,
  identity_matrix)
simulated_ordinal_dataset <- rmult.acl(clsize = cluster_size,
  intercepts = beta_intercepts, betas = beta_coefficients,
  xformula = ~ x1 + x2, xdata = xdata,
  cor.matrix = latent_correlation_matrix)
suppressPackageStartupMessages(library("multgee"))
ordinal_gee_model <- ordLORgee(y ~ x1 + x2,
  data = simulated_ordinal_dataset$simdata, id = id, repeated = time,
  LORstr = "time.exch", link = "acl")
round(coef(ordinal_gee_model), 2)

[Package SimCorMultRes version 1.9.0 Index]