SIMCRNpoisson_glmm_simple: Simulation function for a Poisson model with fixed mean and...

Description Usage Arguments Details Author(s) Examples

View source: R/SIMCRNpoisson_glmm_simple.R

Description

The function simulates data under a Poisson model with fixed mean lambda and a random intercept with with distribution N(0, sigma^2). For each of the nk simulated datasets, a vector of summary statistics is computed, consisting of the mean 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.

Usage

1
SIMCRNpoisson_glmm_simple(nk, theta, seed, n)

Arguments

nk

integer, number of datasets to be simulated

theta

numeric, parameter vector. theta = c(lambda, sigma)

seed

integer. Seed to simulate the random effect and poisson distributed response.

n

integer, number of observations

Details

The simulations are obtained with the given seed (designed for the use of Common Random Numbers in the Approximate Maximum Likelihood Algorithm).

SIMpoisson_glmm_simple uses simGLMM::simDataGLMM.

This function might be replaced by a more flexible function based on simGLMM::simDataGLMMdesign that uses a design matrix.

Author(s)

Johanna Bertl

Examples

1
2
3
4
5
SIMCRNpoisson_glmm_simple(1, c(1,0.5), 1234, 10)

set.seed(1234)
dat = simDataGLMM(clus=10, rep=1, fixedMean=1, fixedCoef=NULL, fixedMat=NULL, covM = 0.5, disFam=poisson())
mean(dat$res)

johannabertl/ApproxML documentation built on May 22, 2019, 2:19 p.m.