rmult.crm {SimCorMultRes}R Documentation

Simulating Correlated Ordinal Responses Conditional on a Marginal Continuation-Ratio Model Specification

Description

Simulates correlated ordinal responses assuming a continuation-ratio model for the marginal probabilities.

Usage

rmult.crm(clsize = clsize, intercepts = intercepts, betas = betas,
  xformula = formula(xdata), xdata = parent.frame(), link = "logit",
  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 continuation-ratio model.

betas

numerical vector or matrix containing the value of the marginal regression parameter vector associated with the covariates (i.e., excluding intercepts).

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.

link

character string indicating the link function of the marginal continuation-ratio model. Options include 'probit', 'logit', 'cloglog' or 'cauchit'. Required when rlatent = NULL.

cor.matrix

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

rlatent

matrix with clsize rows and ncategories columns containing realizations of the latent random vectors when the NORTA method is not employed. 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 continuation-ratio model is

Pr(Yit=jYitj,xit)=F(βtj0+βtxit)Pr(Y_{it}=j |Y_{it} \ge j,x_{it})=F(\beta_{tj0} +\beta^{'}_{t} x_{it})

where FF is the cumulative distribution function determined by link. For subject ii, YitY_{it} is the tt-th multinomial response and xitx_{it} is the associated covariates vector. Finally, βtj0\beta_{tj0} is the jj-th category-specific intercept at the tt-th measurement occasion and βtj\beta_{tj} is the jj-th category-specific regression parameter vector at the tt-th measurement occasion.

The ordinal response YitY_{it} is determined by extending the latent variable threshold approach of Tutz (1991) as suggested in Touloumis (2016).

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 eitjO2e^{O2}_{itj} in Touloumis (2016). In this case, the algorithm forces cor.matrix to respect the local independence assumption. 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 eit1O2,...,eitJO2e^{O2}_{it1},...,e^{O2}_{itJ}, respectively, for t=1,,clsizet=1,\ldots,\code{clsize}.

Value

Returns a list that has components:

Ysim

the simulated ordinal 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 eitO2e^{O2}_{it} in Touloumis (2016).

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 (forthcoming).

Tutz, G. (1991) Sequential models in categorical regression. Computational Statistics & Data Analysis 11, 275–295.

See Also

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

Examples

## See Example 3.3 in the Vignette.
set.seed(1)
sample_size <- 500
cluster_size <- 4
beta_intercepts <- c(-1.5, -0.5, 0.5, 1.5)
beta_coefficients <- 1
x <- rnorm(sample_size * cluster_size)
categories_no <- 5
identity_matrix <- diag(1, (categories_no - 1) * cluster_size)
equicorrelation_matrix <- toeplitz(c(0, rep(0.24, categories_no - 2)))
ones_matrix <- matrix(1, cluster_size, cluster_size)
latent_correlation_matrix <- identity_matrix +
  kronecker(equicorrelation_matrix, ones_matrix)
simulated_ordinal_dataset <- rmult.crm(clsize = cluster_size,
  intercepts = beta_intercepts, betas = beta_coefficients, xformula = ~x,
  cor.matrix = latent_correlation_matrix, link = "probit")
head(simulated_ordinal_dataset$Ysim)

[Package SimCorMultRes version 1.9.0 Index]