signif_compare | R Documentation |
Compare significance Identifies statistical significance of differences between a group in a dataframe and other groups.
signif_compare(df, filter_col, filter_val, join_col, est_col, moe_col)
df |
A dataframe with estimate and margin of error columns for different groups. |
filter_col |
The column containing different groups, one of which you want to compare. |
filter_val |
A value that filters the filter column to one unique group. E.g., if the filter column is age-groups, the filter value should pull one age group. |
join_col |
Columns to join the filtered dataframe to the original dataframe by. Columns should result in one-to-one matches between filtered dataframe and original. E.g., if you want to compare differences for 20-30 year olds in a city against all other age groups in the same city, your join columns should be the city column. |
est_col |
The column containing the value you're comparing. |
moe_col |
The column containing the moe you're comparing. |
A dataframe containing four new columns for the estimate/moe of the compare-group, the critical value of the difference between the compare group and other groups, and the statistical-significance level of the difference.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.