sibp_amce {texteffect} | R Documentation |
Infer Treatments on the Test Set
Description
sibp_amce
uses an sibp object fitted on a training set to estimate the AMCE with the test set.
Usage
sibp_amce(sibp.fit, X, Y, G = NULL, seed = 0, level = 0.05, thresh = 0.5)
sibp_amce_plot(sibp.amce, xlab = "Feature", ylab = "Outcome", subs = NULL)
Arguments
sibp.fit |
A |
X |
The covariates for the full data set. The division between the training and test set is handled inside the function. |
Y |
The outcomes for the full data set. The division between the training and test set is handled inside the function. |
G |
A group membership matrix. The AMCE for a given treatment is permitted to vary as a function of the individual's group. |
seed |
The seed |
level |
The level of the confidence intervals to be obtained. |
thresh |
The treatment will = 1 when nu >= thresh and 0 otherwise. This avoids problems due to misclassification error. |
sibp.amce |
The table returned by codesibp_amce. |
xlab |
The label for the x-axis of the plot. |
ylab |
The label for the y-axis of the plot. |
subs |
The susbet of the coefficients to plot. By default, plots all coefficients. |
Details
Nothing
Value
sibp.amce |
A table where the first column is the index of the treatment, the second column ("effect") is the estimated AMCE, the third column ("L") is the lower bound of the confidence interval, and the fourth column ("U") is the upper bound of the confidence interval. |
Author(s)
Christian Fong
References
Fong, Christian and Justin Grimmer. 2016. “Discovery of Treatments from Text Corpora” Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics. https://aclweb.org/anthology/P/P16/P16-1151.pdf
See Also
Examples
##Load the sample of Wikipedia biography data
data(BioSample)
# Divide into training and test sets
Y <- BioSample[,1]
X <- BioSample[,-1]
set.seed(1)
train.ind <- sample(1:nrow(X), size = 0.5*nrow(X), replace = FALSE)
# Fit an sIBP on the training data
sibp.fit <- sibp(X, Y, K = 2, alpha = 4, sigmasq.n = 0.8,
train.ind = train.ind)
sibp.amce <- sibp_amce(sibp.fit, X, Y)
sibp_amce_plot(sibp.amce)