Description Usage Arguments Value Examples
Estimation of average treatment effect with known outcome misclassification probabilities, i.e., known sensitivity and specificity
1 2 | KnownError(data, indA, indYerror, indX, sensitivity, specificity,
confidence = 0.95)
|
data |
The dataset to be analyzed in the form of R data frame without missing data |
indA |
A column name indicating the binary treatment variable |
indYerror |
A column name indicating the misclassified binary outcome variable |
indX |
A vector of column names indicating the covariates included in the treatment model |
sensitivity |
The specified sensitivity between 0 and 1 |
specificity |
The specified specificity between 0 and 1 |
confidence |
The confidence level between 0 and 1; the default is 0.95 corresponding to a 95 per cent confidence interval |
A list of the estimate of average treatment effect, sandwich-variance-based standard error and confidence interval
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #create a dataset with sensitivity=0.95 and specificity=0.85
set.seed(100)
X1=rnorm(2000)
A=rbinom(2000,1,1/(1+exp(-0.2-X1)))
Y=rbinom(2000,1,1/(1+exp(-0.2-A-X1)))
y1=which(Y==1)
y0=which(Y==0)
Yast=Y
Yast[y1]=rbinom(length(y1),1,0.95)
Yast[y0]=rbinom(length(y0),1,0.15)
da=data.frame(X1=X1,A=A,Yast=Yast)
head(da)
#apply the correction method with sensitivity=0.95 and specificity=0.85
KnownError(da,"A","Yast","X1",0.95,0.85,0.95)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.