View source: R/get_simulate_fun.R
get_simulate_fun | R Documentation |
Simulate response given linear predictors
get_simulate_fun(family)
family |
A family object, it contains a GLM family |
simulate_fun a function which takes as input a covariate matrix X and a coefficient vector beta. and returns a vector containing simulated responses given X andbeta.
family <- binomial(link = "logit")
fun <- get_simulate_fun(family)
y <- fun(X = matrix(rnorm(100, 0, 1), 10, 10), beta = rnorm(10))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.