ME_Data | R Documentation |
This function aims to generate artificial data with error-prone covariates.
ME_Data(X,beta,type="normal",sigmae,pr0=0.5)
X |
An (n,p) matrix of the "unobserved" covariates provided by users. |
beta |
An p-dimensional vector of parameters provided by users. |
type |
A regression model that is specified to generate the response. "normal" means the linear regression model with the error term generated by the standard normal distribution; "binary" means the logistic regression model; "poisson" means the Poisson regression model. In addition, the accelerated failure time (AFT) model is considered to fit length-biased and interval-censored survival data. Specifically, "AFT-normal" generates the length-biased and interval-censored survival data under the AFT model with the error term being normal distributions; "AFT-loggamma" generates the length-biased and interval-censored survival data under the AFT model with the error term being log-gamma distributions. |
sigmae |
An (p,p) covariance matrix of the noise term in the classical measurement error model. Given |
pr0 |
A numerical value in an interval (0,1). It is used to determine the censoring rate for the length-biased and interval-censored data. The default value is 0.5. |
This function aims to generate artificial data with error-prone covariates. Given generalized linear models (GLM), we generate an n-dimensional vector of responses. Linear regression models, logistic regression models, and Poisson regression models are particularly considered. In survival analysis, accelerated failure time (AFT) models are perhaps commonly used formulations. We use AFT models to generate length-biased and interval-censored responses. In addition to responses generated by specific regression models, we also employ the classical measurement error model to generate the mismeasured covariates.
response |
Responses generated by a specific regression model. |
ME_covariate |
an (n,p) matrix of error-prone covariates. |
Bangxu Qiu and Li-Pang Chen
##### Example 1: A linear model with precisely measured covariates ##########
X<-matrix(rnorm((20)*400),nrow=400,ncol=20,byrow=TRUE)
data=ME_Data(X=X,beta=c(1,1,1,rep(0,dim(X)[2]-3)),type="normal",diag(0,dim(X)[2]))
Y<-data$response
Xstar<-data$ME_covariate
##### Example 2: A linear model with error-prone covariates ##########
X<-matrix(rnorm((20)*400),nrow=400,ncol=20,byrow=TRUE)
data=ME_Data(X=X,beta=c(1,1,1,rep(0,dim(X)[2]-3)),type="normal",diag(0.3,dim(X)[2]))
Y<-data$response
Xstar<-data$ME_covariate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.