binaryOutcome | R Documentation |
generate.cluster.data
Given a vector of frailties, say x_1,... it creates a binary variable from a logistic model with log odds ratio μ + x
binaryOutcome(mu)
mu |
Constant term μ |
A vector of binary variables.
David A. Schoenfeld
generatedData=generate.cluster.data(.25,npats=25,clusts=c(12,8),beta=c(-5,5), outcomeModel=binaryOutcome(0)) ## The function is currently defined as function (mu) { outpt = function(x) { m = length(x) p = exp(mu + x)/(1 + exp(mu + x)) return(rbinom(m, 1, p)) } return(outpt) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.