Learn R Programming

pgee.mixed (version 0.1.0)

gen_mixed_data: Generate correlated bivariate mixed outcome data

Description

gen_mixed_data returns randomly generated correlated bivariate mixed outcomes, and covariate matrices to model them, based on design parameters set in the function.

Usage

gen_mixed_data(Beta.cont, Beta.bin, N, rho, intercept = TRUE, cov = "same", xcor = 0.25, sigma_yc = 1)

Arguments

Beta.cont
Vector of true regression coefficients for the continuous outcome.
Beta.bin
Vector of true regression coefficients for the binary outcome.
N
Number of pairs of correlated outcomes.
rho
Gaussian copula parameter.
intercept
Assume an intercept (for both outcomes)? (default TRUE). If TRUE, then the first coefficient in Beta.cont and Beta.bin are assumed to correspond to intercepts.
cov
Specify if the covariate matrices for the continuous outcome and the binary outcome should share all covariates (set to "same"), share some covariates (set to "shared"), or share no covariates (set to "separate").
xcor
Correlation parameter for AR(1) correlation structure of covariate design matrices (assumed same for both).
sigma_yc
Marginal variance of continuous responses.

Value

A list of generated data A list of generated data

Details

A Gaussian copula is used to generate the correlated outcomes. Marginally, the continuous outcome follows a normal distribution with identity link to covariates, while the binary outcome follows a Bernoulli distribution with logit link to covariates. Covariates are generated from a zero-mean unit variance multivariate normal distribution, with an AR(1) correlation structure.

Examples

Run this code
# default settings
gen_mixed_data(rnorm(5), rnorm(5), 10, 0.5)
# separate covariate matrices, non-unit continuous variance
gen_mixed_data(rnorm(5), rnorm(5), 10, 0.5, cov = "separate", sigma_yc = 2)

Run the code above in your browser using DataLab