PRNGCorrPoi: Pseudo-Random Number Generation of Correlated Count (Poisson)...

Description Usage Arguments Examples

View source: R/PRNGCorrPoi.R

Description

This function produces pseudo-random numbers for both predictors and responses for correlated (longitudinal) data. The responses are generated as count (Poisson) data. The predictors can be either continuous or binary, and can include both time-independent and time-dependent covariates. Time-dependent covariates can be controlled as either Type I, Type II, Type III, or Type IV time-dependent covariates. The function returns a response vector, a design matrix for the time-dependent covariates (with intercept column), and a design matrix for the time-independent covariates.

Usage

1
PRNGCorrPoi(seed, S, Tvec, rhoyy, rhoxy, rhoyx, TDCTypes, dataTypes, beta, pred)

Arguments

seed

The seed used to control pseudo-random number generation.

S

The number of subjects or groups to be generated. These are assumed to be collections of auto-correlated data.

Tvec

The vector indicating the number of times (for each subject) or the number of units (for each group) to be generated.

rhoyy

The auto-regressive weight, a correlation between responses from the same subject or group.

rhoxy

The weight representing the correlation between "previous" time-dependent covariate values on response values. This is associated with Type II time-dependent covariates.

rhoyx

The weight representing the correlation between "previous" responses and time-dependent covariate values. This is associated with Type IV time-dependent covariates.

TDCTypes

The vector indicating the type (0, 1, 2, 3, or 4) of each time-dependent covariate. A type of "0" indicates a time-independent covariate. This vector should be ordered by time-independent covariates first.

dataTypes

The vector indicating the type of each predictor. Either 'b' for binary or 'c' for continuous. This includes all time-independent covariates, all time-dependent covariates, in that order, but not the intercept.

beta

The vector of "true" parameter values according to which data will be randomly generated. This includes coefficients for an intercept, all time-independent covariates, and all time-dependent covariates, in that order.

pred

A vector of parameters describing the distributions of predictors. Each binary predictor should have an associated probability of success, while each continuous predictor should have an associated standard deviation. This includes all time-dependent covariates, all time-independent covariates, but not the intercept. Continuous predictors will be assumed to be "centered" (mean of 0) but not "standardized" (variance can be other than 1).

Examples

1

lalondetl/PRNG documentation built on May 20, 2019, 3:06 p.m.