Learn R Programming

simglm (version 0.8.0)

sim_continuous: Simulate continuous variables

Description

Function that simulates continuous variables. Any distribution function in R is supported.

Usage

sim_continuous(
  k = NULL,
  n,
  p,
  dist_fun,
  var_type = c("level1", "level2", "level3", "single"),
  ...
)

Arguments

k

Number of third level clusters.

n

Number of clusters or number of observations for single level

p

Number of within cluster observations for multilevel

dist_fun

A distribution function. This argument takes a quoted R distribution function (e.g. 'rnorm').

var_type

Variable type for the variable, must be either "level1", "level2", "level3", or "single"

...

Additional parameters to pass to the dist_fun argument.