Learn R Programming

SimCorMultRes (version 1.4.0)

rmult.clm: Simulating Correlated Ordinal Multinomial Responses under a Marginal Cumulative Link Model

Description

Simulates correlated ordinal multinomial responses assuming that a cumulative link model holds for the marginal probabilities.

Usage

rmult.clm(clsize, lin.pred, cor.matrix, intercepts, link = "probit")

Arguments

clsize
integer indicating the common cluster size.
lin.pred
matrix with clsize columns. See details for more info.
cor.matrix
matrix indicating the correlation matrix of the multivariate normal distribution in the NORTA method.
intercepts
numerical vector or matrix containing the intercepts of the marginal cumulative link model. See details for more info.
link
character string indicating the link function of the cumulative link model. Options include "probit", "logit", "cloglog" or "cauchit".

Value

  • Ysimthe correlated ordinal multinomial responses. Element ($i$,$t$) represents the realization of $Y_{it}$.
  • correlationthe correlation matrix of the multivariate normal distribution in the NORTA method.
  • rlatentthe latent random vectors.

Details

The assumed marginal cumulative link model is $$Pr(Y_{it}\le j |x_{it})=F(\beta_{t0j} +\beta^{'}_{t} x_{it})$$ where $F$ is the cumulative distribution function determined by link. For subject $i$, $Y_{it}$ is the $t$-th multinomial response and $x_{it}$ is the associated covariates vector. Finally, $\beta_{t0j}$ is the $j$-th category specific intercept and $\beta^{'}_{t}$ is the regression parameter vector corresponding to the $t$-th measurement occasion. The multinomial response $Y_{it}$ takes the value $j$ if and only if the corresponding latent random variable lies on $(\beta_{t0(j-1)}-\beta^{'}_{t}x_{it},\beta_{t0j}-\beta^{'}_{t}x_{it}]$. See vignette for more info. The sample is equal to the number of rows in lin.pred. Row $i$ corresponds to subject $i$. The ($i,t$)-th element of lin.pred equals $\beta^{'}_{t} x_{it}$. When $\beta_{0tj}=\beta_{0j}$ for all $t$, then intercepts should be provided as a numerical vector. Otherwise, intercepts must be a numerical matrix such that $t$ contains the category specific intercepts at the $t$-th measurement occasion.

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 Transacions on Systems, Man and Cybernetics, 5, 557--561. McCullagh, P. (1980) Regression models for ordinal data. Journal of the Royal Statistical Society B, 42, 109--142. Touloumis, A., Agresti, A. and Kateri, M. (2013) GEE for multinomial responses using a local odds ratios parameterization. Biometrics, 69, 633--640.

See Also

For simulating correlated ordinal multinomial responses see also rmult.crm. For simulating correlated nominal multinomial responses use rmult.bcl and for simulating correlated binary responses use rbin.

Examples

Run this code
## See vignette for the sampling scheme.
set.seed(12345)
N <- 500
clsize <- 4
intercepts <- c(-1.5, -0.5, 0.5, 1.5)
cor.matrix <- toeplitz(c(1, 0.85, 0.5, 0.15))
lin.pred <- rsmvnorm(N, toeplitz(c(1, rep(0.85, clsize-1))))
Y <- rmult.clm(clsize, lin.pred, cor.matrix, intercepts, "probit")$Ysim
data <- cbind(c(t(Y)), c(t(lin.pred)))
data <- data.frame(data)
data$id <- rep(1:N, each=clsize)
data$time <- rep(1:clsize, N)
colnames(data) <- c("y", "x", "id", "time")

## Fit a GEE model (Touloumis et al., 2013) to estimate the regression coefficients.
library(multgee)
fitmod <- ordLORgee(y~x, data=data, id=id, repeated=time, link="probit", IM="cholesky")
coef(fitmod)

Run the code above in your browser using DataLab