Description Usage Arguments Details Author(s) See Also
View source: R/SIMCRNpoisson_glmm_regr_ind.R
The function simulates data under a Poisson model with given explanatory variables x
and parameter vector theta
, consisting of the coefficients of the fixed effects, beta, and sigma, the standard deviation of a single random effect with distribution N(0, sigma^2)
. For each of the nk
simulated datasets, a vector of summary statistics is computed, consisting of the regression coefficients estimated in a Poisson model without random effects, and an estimate of the dispersion based on the Pearson statistic (sum of the squared Pearson residuals) of this model. The function is designed to estimate theta by the approximate maximum likelihood algorithm in KDKW.FD
or KDKW.SP
.
1 | SIMCRNpoisson_glmm_regr_ind(nk, theta, seed, x)
|
nk |
integer, number of datasets to be simulated |
theta |
numeric, parameter vector. theta = c(beta, sigma) |
seed |
integer. Seed to simulate the random effect and poisson distributed response. |
x |
numeric matrix, explanatory variables |
The simulations are obtained with the given seed (designed for the use of Common Random Numbers in the Approximate Maximum Likelihood Algorithm).
SIMpoisson_glmm uses glm
to obtain the summary statistics. This probably has a lot of overhead and could maybe be replaced by a faster alternative.
Note that this is an experimental function that is only for use with x consisting of a set of dummy variables that is equivalent to a single factor that defines groups. The summary statistics are computed separately for each independent group.
Johanna Bertl
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.