Last chance! 50% off unlimited learning
Sale ends in
The function generate correlated normal, Bernoulli or Poisson longitudinal data.
data_sim(id, rho, phi, x, beta, x_mis, para, corstr, family, lag_level)
subject id
with-in cluster correlation.
scale parameter in the variance covariance matrix.
covariate associated with the response.
coefficients associated with x.
covariates associated with missing model.
coefficients associated with x_mis.
a character string specifies the working correlation structure. The following are permitted: "independence", "exchangeable","ar1".
a description of the error distribution and link function to be used in the model. This is a character string naming a family function. The following are permitted: "gaussian", "binary", "poisson".
specify how many lags of response y will affect missing probability.
simulated dataset
missing percentage of the response y
Generate normal, poisson and binary longitudinal data based on the specified variance-covariance matrix.
# NOT RUN {
n=500
id=rep(1:n,each=3)
rho=1
phi=1
x=cbind(1,rnorm(length(id)))
beta=c(1,1)
x_mis=cbind(1,rnorm(length(id)))
para=c(1,1,1)
data_sim(id,rho,phi,x,beta,x_mis,para,"independent","gaussian",lag_level = 1)
# }
Run the code above in your browser using DataLab