View source: R/supporting_functions.R
gee.generator | R Documentation |
A function for generating longitudinal data without missingness. All covariates (except for intercept) are normally distributed.
gee.generator(beta,samplesize,time,num.time.dep,num.time.indep, rho,x.rho,dist,cor.str,x.cor.str)
beta |
A vector containing underlying true coefficients for each covariate in the model (including the intercept). |
samplesize |
The sample size. |
time |
The number of observations per subject. |
num.time.dep |
The number of time-dependent covariates. |
num.time.indep |
The number of time-independent covariates (not include intercept). |
rho |
The correlation coefficient for residuals across time. |
x.rho |
The correlation coefficient for time-dependent covariates across time. |
dist |
A specified distribution. It can be "gaussian", "poisson",and "binomial". |
cor.str |
The correlation structure for residuals across time. It can be "independence","exchangeable", and "ar1". |
x.cor.str |
The correlation structure for time-dependent covariates across time. It can be "independence","exchangeable", and "ar1". |
x: a matrix containing continuous covariates. The first column should contain all ones corresponding to the intercept.
y: a vector containing outcomes.
id: a vector indicating subject id.
beta<-c(-1,1,0.5,0) samplesize<-100 geesimdata<-gee.generator(beta=beta,samplesize=samplesize,time=3,num.time.dep=2, num.time.indep=1,rho=0.4,x.rho=0.2,dist="poisson",cor.str="exchangeable", x.cor.str="exchangeable") geesimdata$y
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.