rmult.crm(clsize, lin.pred, cor.matrix, intercepts, link = "probit")
clsize
columns. See details for more info."probit"
, "logit"
, "cloglog"
or "cauchit"
.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 responses $Y_{it}$ are determined by extending the latent variable threshold approach of Tutz (1991) to the correlated latent continuous variables. 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.rmult.clm
.
For simulating correlated nominal multinomial responses use rmult.bcl
, and for simulating correlated binary responses use rbin
.## See vignette for more details about the sampling scheme.
set.seed(1)
N <- 500
clsize <- 4
intercepts <- c(-1.5, -0.5, 0.5, 1.5)
cor.matrix <- diag(1, 16)
x <- rnorm(N)
lin.pred <- matrix(rep(x,clsize), N, clsize, byrow=TRUE)
Y <- rmult.crm(clsize, lin.pred, cor.matrix, intercepts, link="probit")
Run the code above in your browser using DataLab