Description Usage Arguments Examples
View source: R/extractEffect.R
Extracts the effect of a covariate on a set of topics selected by
the user. Different effect types available depending on type of
covariate. Before running this, the user should run a function to
simulate necessary confidence intervals. See
link{estimateEffect}
.
1 2 3 4 5 |
x |
Output of estimateEffect, which calculates simulated betas for plotting or extraction. |
covariate |
String of the name of the main covariate of interest. Must be enclosed in quotes. All other covariates within the formula specified in estimateEffect will be kept at their median. |
model |
Model output, only necessary if labeltype is "prob", "frex", "score", or "lift". Models with more than one spline cannot be used for extract.estimateEffect. |
topics |
Topics to plot. |
method |
Method used for plotting. "pointestimate" estimates mean topic proportions for each value of the covariate. "difference" estimates the mean difference in topic proportions for two different values of the covariate (cov.value1 and cov.value2 must be specified). "continuous" estimates how topic proportions vary over the support of a continuous covariate. |
cov.value1 |
For method "difference", the value or set of values of interest at which to set the covariate. In the case of calculating a treatment/control contrast, set the treatment to cov.value1. |
cov.value2 |
For method "difference", the value or set of values which will be set as the comparison group. cov.value1 and cov.value2 must be vectors of the same length. |
moderator |
When two terms are interacted and one variable in the interaction is the covariate of interest, the user can specify the value of the interaction with moderator.value, and the name of the moderator with moderator. |
moderator.value |
When two terms are interacted and one variable in the interaction is the covariate of interest, the user can specify the value of the interaction term. |
npoints |
Number of unique points to use for simulation along the support of a continuous covariate. For method "continuous" only. |
nsims |
Number of simulations for estimation. |
ci.level |
Confidence level for confidence intervals. |
custom.labels |
A vector of custom.labels if labeltype is equal to "custom". |
labeltype |
Determines the labeltype for the topics. The
default is "number" which prints the topic number. Other options
are "prob", which prints the highest probability words, "score",
"lift", and "frex", from labeltopics (see
|
n |
Number of words to print if "prob", "score", "lift", or "frex" is chosen. to signal how far the function have come. |
frexw |
If "frex" labeltype is used, this will be the frex weight. |
1 2 3 4 5 | ## Not run:
prep <- estimateEffect(1:3 ~ treatment, gadarianFit, gadarian)
effect <- extract.estimateEffect(prep, "treatment", model = gadarianFit, method = "pointestimate")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.