nice_var {rempsyc} | R Documentation |
Obtain variance per group
Description
Obtain variance per group as well as check for the rule of thumb of one group having variance four times bigger than any of the other groups. Variance ratio is calculated as Max / Min.
Usage
nice_var(data, variable, group, criteria = 4)
Arguments
data |
The data frame |
variable |
The dependent variable to be plotted. |
group |
The group by which to plot the variable. |
criteria |
Desired threshold if one wants something different than four times the variance. |
Value
A dataframe, with the values of the selected variables for each group, their max variance ratio (maximum variance divided by the minimum variance), the selected decision criterion, and whether the data are considered heteroscedastic according to the decision criterion.
See Also
Other functions useful in assumption testing:
nice_assumptions
, nice_density
,
nice_normality
, nice_qq
,
nice_varplot
. Tutorial:
https://rempsyc.remi-theriault.com/articles/assumptions
Examples
# Make the basic table
nice_var(
data = iris,
variable = "Sepal.Length",
group = "Species"
)
# Try on multiple variables
nice_var(
data = iris,
variable = names(iris[1:4]),
group = "Species"
)