RRsimu(numRep, n, pi, model, p, rho, complyRates = c(1, 1), sysBias = c(0,
0), method = c("RRuni", "RRcor", "RRlog"), alpha = 0.05,
groupRatio = 0.5, MLest = TRUE, nCPU = 1)vector)vector), see RRunilist)list)RRgenRRcor is available.betavector)RRuni if pi is outside of [0,1]RRsimu which contains the estimated parameters parEsts and a matrix results with mean parameters and standard errors across replicationsrho.
In case of two dichotomous RR variables, the true group membership of individuals is sampled from a 2x2 cross table. Within this table, probabilities are chosen in a way, to obtain the point-tetrachoric correlation defined by rho
Note, that for the FR model with multiple response categories (e.g., from 0 to 4), the specified rho is not the exact target of the sampling procedure. It assumes a normal distribution for each true state, with constant differences between the groups (i.e., it assumes an interval scaled variable).# Simulate data according to the Warner model
mcsim <- RRsimu(numRep=5, n=200, pi=.3, model="Warner", p=2/12, rho=.6)
mcsim
plot(mcsim)Run the code above in your browser using DataLab