Input fixed variables, sample size, and number of within variables, returns design matrix.
sim_fixef_single(
fixed,
fixed_vars,
n,
cov_param,
cor_vars = NULL,
fact_vars = list(NULL),
contrasts = NULL,
knot_args = list(NULL)
)
One sided formula for fixed effects in the simulation.
Character vector of covariates for design matrix.
Number of clusters.
List of arguments to pass to the continuous generating function. Required arguments include:
dist_fun: This is a quoted R distribution function.
var_type: This is the level of variable to generate. Must be 'single'. Must be same order as fixed formula above.
Optional arguments to the distribution functions are in a nested list, see the examples for example code for this. Does not include intercept, time, factors, or interactions.
A vector of correlations between variables.
A nested list of factor, categorical, or ordinal variable specification, each list must include:
numlevels = Number of levels for ordinal or factor variables.
var_type = Must be 'single'.
Optional arguments passed on to sample in a nested list. These include:
replace
prob
value.labels
See also sample
for use of these optional arguments.
An optional list that specifies the contrasts to be used
for factor variables (i.e. those variables with .f or .c).
See contrasts
for more detail.
A nested list of named knot arguments. See sim_knot
for more details. Arguments must include:
var
knot_locations
Simulates the fixed effects for the sim_reg
function when
simulating a simple regression model.