sclr_ideal_data {sclr} | R Documentation |
Generate ideal data for the scaled logit model
Description
Allows variation of all parameters and the creation of an arbitrary number of covariates.
Usage
sclr_ideal_data(
n = 1000,
theta = 0,
beta_0 = -5,
covariate_list = list(logHI = list(gen_fun = function(n) rnorm(n, 2, 2), true_par =
2)),
outcome_name = "status",
seed = NULL,
attach_true_vals = FALSE,
attach_seed = FALSE
)
Arguments
n |
Number of observations. |
theta |
Baseline risk parameter on the logit scale. |
beta_0 |
Intercept of the linear part. |
covariate_list |
A list in the form of |
outcome_name |
Name to give to the outcome |
seed |
Seed to set. If |
attach_true_vals , attach_seed |
Whether to attach additional attributes. |
Value
A tibble
.
Examples
# One titre
one_titre <- sclr_ideal_data(
covariate_list = list(
logHI = list(gen_fun = function(n) rnorm(n, 2, 2), true_par = 2)
)
)
sclr(status ~ logHI, one_titre) # Verify
# Two titres
two_titre <- sclr_ideal_data(
covariate_list = list(
logHI = list(gen_fun = function(n) rnorm(n, 2, 2), true_par = 2),
logNI = list(gen_fun = function(n) rnorm(n, 2, 2), true_par = 1)
)
)
sclr(status ~ logHI + logNI, two_titre) # Verify
[Package sclr version 0.3.1 Index]