mbsclf1 {binarySimCLF} | R Documentation |
This function generates a single correlated binary vector. It is called by
mbsclf()
to generate multiple vectors of correlated binary data.
mbsclf1(u, B)
u |
Mean vector. |
B |
Intermediate vector obtained by B = allReg(V) . |
Failure means that the condtional mean is out of range. Using the notation of Qaqish (2003), it means that λ_i is not in the interval [0,1]. This is one of the criteria for CLF compatibility. Note also that even if the code succeeds, this does not mean that we have CLF compatibility. To ensure CLF compatibility, we have to make sure that the largest possible value of λ_i is less than or equal to 1 and the smallest possible value of λ_i is greater than or equal to 0. These concepts are explained in Qaqish (2003).
Returns a list with two components.
succeed |
Indicates whether the routine succeeds or fails. |
y |
The response. If succeed is FALSE , then y
is NULL . If succeed is TRUE , then y
is a binary outcome vector. |
Qaqish, B. F., A family of multivariate binary distributions for simulating correlated binary variables with specified marginal means and correlations. Biometrika 92:455-463, 2003.
#Examples R = cbind( c(1, 0.1, 0.2), c(0.1, 1, 0.3), c(0.2, 0.3, 1) ); mu = c(0.4, 0.5, 0.6); V = cor2var(R, mu) ; B = allReg(V); clf.compat = blrchk(mu,B); if (clf.compat) { y = mbsclf1(mu, B); print("CLF compatible"); } else { print("Not CLF compatible"); }