Description Usage Arguments Value Details References See Also Examples
View source: R/estimate_mdiff_contrast_bs.R
estimate_mdiff_contrast_bs
returns the point estimate and
confidence interval for the mean difference in a linear contrast:
\mjdeqn \psi = \sum_i=1^ac_iM_i psi = sum(contrasts*means)
Where there are a groups, and M is each group mean and c is each group
weight; see Kline, equation 7.1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | estimate_mdiff_contrast_bs(
data = NULL,
grouping_variable = NULL,
outcome_variable = NULL,
means = NULL,
sds = NULL,
ns = NULL,
group_labels = NULL,
grouping_variable_name = "My grouping variable",
outcome_variable_name = "My outcome variable",
contrast = NULL,
conf_level = 0.95,
assume_equal_variance = FALSE,
save_raw_data = TRUE
)
|
data |
For raw data - a dataframe or tibble |
grouping_variable |
For raw data - The column name of the grouping variable, or a vector of group names |
outcome_variable |
For raw data - The column name of the outcome variable, or a vector of numeric data |
means |
For summary data - A vector of 2 or more means |
sds |
For summary data - A vector of standard deviations, same length as means |
ns |
For summary data - A vector of sample sizes, same length as means |
group_labels |
For summary data - An optional vector of group labels, same length as means |
grouping_variable_name |
Optional friendly name for the grouping variable. Defaults to 'My grouping variable' or the grouping variable column name if a data.frame is passed. |
outcome_variable_name |
Optional friendly name for the outcome variable. Defaults to 'My outcome variable' or the outcome variable column name if a data frame is passed. |
contrast |
A vector of group weights. |
conf_level |
The confidence level for the confidence interval. Given in decimal form. Defaults to 0.95. |
assume_equal_variance |
Defaults to FALSE |
save_raw_data |
For raw data; defaults to TRUE; set to FALSE to save memory by not returning raw data in estimate object |
Returnsobject of class esci_estimate
This is a friendly version of CI_mdiff_contrast_bs
This friendly version can handle raw data and summary data input.
This friendly version returns an esci_estimate object which provides additional supporting information beyond the effect size and CI.
All the computational details for this analayis are documented in
CI_mdiff_contrast_bs
Cumming, G., & Calin-Jageman, R. J. (2017). Introduction to the new statistics: Estimation, open science, and beyond. Routledge.
plot_mdiff_contrast_bs
to visualize the results
CI_mdiff_contrast_bs
for a version of this function focused
just on the effect size and CI
1 2 3 4 5 6 7 8 9 10 11 | # From Raw Data ------------------------------------
# Just pass in the data source, grouping column, and outcome column.
# You can pass these in by position, skipping the labels:
# Note... not sure if PlantGrowth dataset meets assumptions for this analysis
estimate_mdiff_contrast_bs(
PlantGrowth,
group,
weight,
contrast = c('ctrl' = -1, 'trt1' = 1)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.