powered by
A simple data generator for testing and example purposes.
rhglm( n, beta, sigma = diag(length(beta) - 1L), family = gaussian(), truncate_mu = FALSE, as_list = FALSE, ... )
A data.frame (or list) containing the generated data.
data.frame
list
the number of observations to be created.
a numeric vector giving the magnitude of the coefficients (the first element is assumed to be the intercept).
a positive-definite symmetric matrix giving the covariance structure of the covariates (passed to MASS::mvrnorm).
MASS::mvrnorm
the family of the inverse link.
a logical giving if mu should be truncated if necessary.
a logical (default is FALSE), if TRUE a list is returned otherwise a data.frame is returned.
FALSE
TRUE
addtional optional parameters. The arguments are passed to the random variables generating function of the response.
Other simulation: cov_matrix()
cov_matrix()
rhglm(10, 1:5) rhglm(10, 1:5, family = binomial())
Run the code above in your browser using DataLab