simulateYX2: Generating Random Variates for Simulation Studies with...

Description Usage Arguments Details Value TODO FIXME Note Author(s) See Also Examples

View source: R/simulateYX2.R

Description

simulateYX2 generates random variates of a response variable under the given conditions of mean and variance-covariance structure of matrices of predictors and their coefficients.

Usage

1
2
3
4
  simulateYX2(N, Ystr = list(ymean, ysigma), param1,
    param2,
    Xstr = list(type = c("mvnorm", "mvbion", "mixed", "multinomial"), Xmean, XR, Xsd, Xmat = NULL),
    shape = NULL, ztrunc, xreg, seed = NULL, ...)

Arguments

N

a number of random variates

Xstr

a structure of covariates X

ztrunc

FALSE by default

xreg

FALSE by default

seed

NULL a random seed

shape

a shape parameter of gamma distribution

...

other arguments

Ystr

structure of responses

param1

a vector of regression parameters 1

param2

a vector of regression parameters 2

Details

The mean parameter of a response variable is a function of linear predictor by a link function in the context of generalized linear models.

Log and logit links are supported.

Default to Xstr is an independent multivariate normal distribution with mean Xmean, correlation R, and standard deviation Xsd.

Value

a list with components

n

the number of observations which are actually realized

y

the n-by-1 vector of response generated

X

the n-by-p-1 matrix (an intercept is excluded)

yX

the n-by-p data frame which includes y and X

TODO

FIXME

Note

Default to a matrix decomposition method is eigen. Other options are chol and svd.

Currently, the link logit is not supported.

Author(s)

Chel Hee Lee <gnustats@gmail.com>

See Also

rmvnorm

Examples

1
# do not run

ipeglim documentation built on May 2, 2019, 4:31 p.m.