test_equality_between_groups: test_equality_between_groups

Description Usage Arguments Value Examples

Description

Tests if the mean difference between two groups of a quantitative variable is statiscally significant. In order to do so, it first tests if in both groups the quantitative variable is normally distributed, if this is the case then a independent sample t test takes place (in this case it is also computed the Levene test for equal variance between groups). If the hypothesis of normallity is rejected (p.value <= 1-confi) for at least one of the groups, then the wilcox rank sum test takes place. NOTE: both tests (t test and wilcox rank sum test) have as null hypothesis that the quantitative groups' mean do not differ between groups.

Tests if the mean difference between two groups of a quantitative variable is statiscally significant. In order to do so, it first tests if in both groups the quantitative variable is normally distributed, if this is the case then a independent sample t test takes place (in this case it is also computed the Levene test for equal variance between groups). If the hypothesis of normallity is rejected (p.value <= 1-confi) for at least one of the groups, then the wilcox rank sum test takes place. NOTE: both tests (t test and wilcox rank sum test) have as null hypothesis that the quantitative groups' mean do not differ between groups.

Usage

1
2
3
test_equality_between_groups(df, categorical, quantitative, confi = 0.95)

test_equality_between_groups(df, categorical, quantitative, confi = 0.95)

Arguments

df

A data frame.

categorical

The quoted name of the column which contains the group variable.

quantitative

The quoted name of the column which contains the quantitative variable to be compared between groups.

confi

Confidence level.

df

A data frame.

categorical

The quoted name of the column which contains the group variable.

quantitative

The quoted name of the column which contains the quantitative variable to be compared between groups.

confi

Confidence level.

Value

If both groups have the quantitative variable normally distributed it is returned a list with the normality, Levene and t test1s results. Otherwise, it is returned the normality and Wilcox test's results.

If both groups have the quantitative variable normally distributed it is returned a list with the normality, Levene and t test1s results. Otherwise, it is returned the normality and Wilcox test's results.

Examples

1
2
3
test_equality_between_groups(df=data, categorical="blood_type", quantitative="pressure",confi=0.99)

test_equality_between_groups(df=data, categorical="blood_type", quantitative="pressure",confi=0.99)

vinisousa04/AdvancedDataAnalysis documentation built on May 14, 2019, 6:02 p.m.