Random HGLM Data
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, ... )
n
: the number of observations to be created.beta
: a numeric vector giving the magnitude of the coefficients (the first element is assumed to be the intercept).sigma
: a positive-definite symmetric matrix giving the covariance structure of the covariates (passed to MASS::mvrnorm
).family
: the family of the inverse link.truncate_mu
: a logical giving if mu should be truncated if necessary.as_list
: a logical (default is FALSE
), if TRUE
a list
is returned otherwise a data.frame
is returned....
: addtional optional parameters. The arguments are passed to the random variables generating function of the response.A data.frame
(or list
) containing the generated data.
rhglm(10, 1:5) rhglm(10, 1:5, family = binomial())
Other simulation: cov_matrix()
Useful links