View source: R/effective_functions.r
optCL | R Documentation |
Calculates the Optimal Visual Testing (OVT) confidence level. The OVT level is a level you can use to make confidence intervals such that the overlapping (or non-overlapping) of confidence intervals preserves the pairwise testing results. That is, statistically different estimates have confidence intervals that do not overlap and statistically indistinguishable intervals have confidence intervals that do overlap. It does not always work perfectly, but it generally results in fewer inferential errors than the nominal level.
optCL(
obj = NULL,
varname = NULL,
b = NULL,
v = NULL,
resdf = Inf,
level = 0.95,
quasi_vars = NULL,
add_ref = TRUE,
grid_range = c(0.75, 0.99),
grid_length = 100,
adjust = p.adjust.methods[c(8, 1:7)]
)
obj |
A model object, on which |
varname |
The name of a variable whose coefficients will be used. |
b |
Optional vector of coefficients to be passed into the function.
it overrides the coefficients in |
v |
Optional variance-covariance matrix. This can be specified
even if |
resdf |
If only |
level |
The confidence level to use for testing. |
quasi_vars |
An optional vector of quasi-variances that will be used to make the confidence intervals. |
add_ref |
If |
grid_range |
The range of values over which to do the grid search. |
grid_length |
The number of values in the grid. |
adjust |
String giving the method used to adjust the p-values for
multiplicity. All methods allowed in |
A list with the following elements:
The optimal confidence levels that all have identical minimal error rates.
The sum of differences between upper and lower bounds that characterize the appropriate visual tests. Larger numbers are better.
The proportion of errors across all simple contrasts.
The proportion of errors made at the nominal significance level.
The total number of comparisons
If there are inferential errors at the nominal level, this is a data frame that has all of the information about which comparisons are not appropriately represented by the overlaps in confidence intervals.
If there are inferential errors at the optimal level, this is a data frame that has all of the information about which comparisons remain not appropriately represented by the overlaps in optimized confidence intervals.
data(wvs)
wvs$civ2 <- "Other"
wvs$civ2 <- ifelse(wvs$civ == 9,
"Western",
wvs$civ2)
wvs$civ2 <- ifelse(wvs$civ == 6,
"Latin American",
wvs$civ2)
wvs$civ2 <- as.factor(wvs$civ2)
intmod <- lm(resemaval ~ civ2 * pct_secondary,
data=wvs)
ss2 <- simple_slopes(intmod,
"pct_secondary",
"civ2")
o2 <- optCL(b=ss2$est$slope, v=ss2$v)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.