simDataGLMM: Simulated data to use in GLMM

Description Usage Arguments Value Examples

Description

Simulated data to use in GLMM

Usage

1
simDataGLMM(clus, rep, fixedMean, covM, disFam)

Arguments

clus

The number of clusters wanted.

rep

The number of repetitions in each cluster.

fixedMean

A fixed value to enter the linear predictor. In case of multivariate data, the dimension needs to equal the number of variables.

covM

The variance of the random component representing variation between clusters. In case of multidimensional data, the dimension needs to equal the number of variables.

disFam

The distribution family. The canonical link function is chosen.

Value

A data frame with columns 'Observation' (number of observation), 'Cluster' (factor) and one column for each output dimension, 'X1', 'X2', etc.

Examples

1
2
3
4
5
6
# Simulates 3 blocks with 5 repetitions in each. The linear predictor is 10+random component with variance 5.
data1dim <- simDataGLMM(clus=3,rep=5,fixedMean=10,covM=5,disFam = poisson())
# Simulates 3 blocks with 5 repetitions in each for 3 variables. The linear predictor is 10+random component with defined covariance matrix.
A <- matrix(runif(3^2)*2-1, ncol=3)
sigma <- t(A) %*% A
data3dim <- simDataGLMM(clus=3,rep=5,fixedMean=rep(10,3),covM=sigma,disFam = poisson())

JeanettPetersen/simGLMM documentation built on May 21, 2019, 4:03 a.m.