sibp_amce: Infer Treatments on the Test Set

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/sibp_amce.R

Description

sibp_amce uses an sibp object fitted on a training set to estimate the AMCE with the test set.

Usage

1
2
	  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 sibp object.

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

sibp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
##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)

texteffect documentation built on May 2, 2019, 12:05 p.m.