rhglm | R Documentation |
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 |
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 |
... |
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.
Other simulation:
cov_matrix()
rhglm(10, 1:5)
rhglm(10, 1:5, family = binomial())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.