GenerateMixData: Generates simulated data according to a specified INAR...

Description Usage Arguments Value Author(s) Examples

View source: R/simulations.R

Description

This function generates data according to a user-specified INAR mixture model. It returns a data frame which can be used immediately by inarmix.

Usage

1
2
GenerateMixData(m, coefs, autocorr, scale=NULL, mix, design.mat,
                return.labels=F,poisson=F)

Arguments

m

a numeric scalar (the number of subjects)

coefs

a numeric vector

autocorr

a numeric scalar

scale

a numerica scalar

mix

a numeric vector

design.mat

a numeric matrix (the design matrix)

return.labels

an indicator of whether or not to return the class labels

poisson

an indicator of whether or not the data should have marginal Poisson distributions.

Value

A data frame which contains the response and a subject identifier. The other columns contain the data entered from the design.mat argument.

Author(s)

Nicholas Henderson

Examples

1
2
3
4
5
6
7
8
XX <- cbind(rep(1,9),c(0:8)/4)
colnames(XX) <- c("const","time")
coefs <- rbind(c(-.2,0),c(1.2,.3))
autocorr <- c(.2,.2)
scale <- c(1.5,1.5)
mix.prop <- c(.8,.2)

testdat <- GenerateMixData(1000,coefs,autocorr,scale,mix.prop,XX)

Example output

Loading required package: Matrix

inarmix documentation built on May 2, 2019, 5:11 a.m.