Description Usage Arguments Value Examples
View source: R/grouped_proptest.R
Function to run proportion test on grouped data.
1 | grouped_proptest(data, grouping.vars, measure, ...)
|
data |
Dataframe (or tibble) from which variables are to be taken. |
grouping.vars |
Grouping variables. |
measure |
A variable for which proportion test needs to be carried out
for each combination of levels of factors entered in |
... |
Currently ignored. |
Dataframe with percentages and statistical details from a proportion test.
1 2 3 4 5 6 7 8 | # for reproducibility
set.seed(123)
groupedstats::grouped_proptest(
data = mtcars,
grouping.vars = cyl,
measure = am
)
|
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Registered S3 method overwritten by 'broom.mixed':
method from
tidy.gamlss broom
# A tibble: 3 x 8
cyl `0` `1` statistic p.value parameter method significance
<dbl> <chr> <chr> <dbl> <dbl> <dbl> <chr> <chr>
1 4 27.27% 72.7… 2.27 0.132 1 Chi-squared test … ns
2 6 57.14% 42.8… 0.143 0.705 1 Chi-squared test … ns
3 8 85.71% 14.2… 7.14 0.00753 1 Chi-squared test … **
Warning message:
In stats::chisq.test(xtab) : Chi-squared approximation may be incorrect
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.