Simulate predictor, covariate, and continuous outcome data
SimData(
n = 100,
M = 5,
sigsq.true = 0.5,
beta.true = 2,
hfun = 3,
Zgen = "norm",
ind = 1:2,
family = "gaussian"
)
Number of observations
Number of predictor variables to generate
Variance of normally distributed residual error
Coefficient on the covariate
An integer from 1 to 3 identifying which predictor-response function to generate
Method for generating the matrix Z of exposure variables, taking one of the values c("unif", "norm", "corr", "realistic")
select which predictor(s) will be included in the h
function; how many predictors that can be included will depend on which h
function is being used.
a description of the error distribution and link function to be used in the model. Currently implemented for gaussian
and binomial
families.
a list containing the parameter values and generated variables of the simulated datasets
hfun = 1
: A nonlinear function of the first predictor
hfun = 2
: A linear function of the first two predictors and their product term
hfun = 3
: A nonlinear and nonadditive function of the first two predictor variables
# NOT RUN {
set.seed(5)
dat <- SimData()
# }
Run the code above in your browser using DataLab