Description Usage Arguments Value Note Examples
Generates a data.frame
or data.table
with a binary outcome, and a logistic model to
describe it.
1 2 3 4 5 6 7 | genBinomDf(b = 2L, f = 2L, c = 1L, n = 20L, nlf = 3L, pb = 0.5,
rc = 0.8, py = 0.5, asFactor = TRUE, model = FALSE, timelim = 5,
speedglm = FALSE)
genBinomDt(b = 2L, f = 2L, c = 1L, n = 20L, nlf = 3L, pb = 0.5,
rc = 0.8, py = 0.5, asFactor = TRUE, model = FALSE, timelim = 5,
speedglm = FALSE)
|
b |
The number of binomial variables
(the number of predictors
which are binary).
|
f |
The number of factor predictors.
|
c |
The number of continuous predictors.
|
n |
The number of observations (rows) in the
|
nlf |
The number of levels in a factor. |
pb |
The probability for binomnial
predictors:
|
rc |
The ratio for continuous variables.
|
py |
The ratio for y,
the ratio of 1s to the total number of observations
for the
binomial predictors.
|
asFactor |
If |
model |
If |
timelim |
function will timeout after |
speedglm |
If |
If model=TRUE
: a list with the following values:
df or dt |
A |
model |
A model fit with |
If model=FALSE
a data.frame
or data.table
as above.
genBinomDt
is faster
and more efficient for large datasets.
Using asFactor=TRUE
with factor
s
which have a large number of levels
(e.g. nlf > 30
)
on large datasets (e.g. n > 1000)
can cause fitting to be excessively slow.
1 2 3 | set.seed(1)
genBinomDf(speedglm=TRUE)
genBinomDt(b=0, c=2, n=100L, rc=0.7, model=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.