sim_Bai | R Documentation |
Simulation functions for binomial, gaussian and poisson outcomes. The simulation equations follow Bai
sim_Bai(n, p, family = binomial(), dispersion = 1)
n |
Integer, sample size |
p |
Integer, number of predictors. The minimum number of predictors is default to 4. If user input p<4, p changes to 4 with a warning message |
family |
Family object, one of |
dispersion |
Double, required for gaussian distribution, match to sd parameter. |
a list contains dat
, eta
, mu
dat a numeric matrix, contains predictors x1
to xp
where p is replaced by the integer value. The outcome variable is named y
etathe linear predictor of the simulated data
muthe mean of the simulated data
# Binomial Outcome
sim_Bai(100, 4)
# Logistic Outcome
sim_Bai(100, 4, family = poisson())
# Gaussian Outcome with measurement error variance = 1
sim_Bai(100, 4, family = gaussian(), dispersion = 1 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.