var_test performs tests on the equality of standard deviations (variances).

var_test_shiny(data, variable1, variable2, alternative = c("less", "greater",
  "all"))

Arguments

data

a dataframe

variable1

character; name of sample 1 in data frame

variable2

character; name of sample 2 in data frame

alternative

a character string specifying the alternative hypothesis, must be one of "both" (default), "greater", "less" or "all". You can specify just the initial letter.

Value

var_test returns an object of class "var_test". An object of class "var_test" is a list containing the following components:

f

f statistic

lower

lower one-sided p-value

upper

upper one-sided p-value

two_tail

two-sided p-value

vars

variances for each level of the grouping variable

avgs

means for each level of the grouping variable

sds

standard deviations for each level of the grouping variable

ses

standard errors for each level of the grouping variable

avg

combined mean

sd

combined standard deviation

se

estimated combined standard error

n1

numerator degrees of freedom

n2

denominator degrees of freedom

lens

number of observations for each level of grouping variable

len

number of observations

lev

levels of the grouping variable

type

alternative hypothesis

References

Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.

See also

var.test

Examples

# using two variables # lower tail var_test_shiny(hsb, 'read', 'write', alternative = 'less')
#> Variance Ratio Test #> -------------------------------------------------- #> Group Obs Mean Std. Err. Std. Dev. #> -------------------------------------------------- #> read 200 52.23 0.72 10.25 #> write 200 52.77 0.67 9.48 #> -------------------------------------------------- #> combined 400 52.5 0.49 9.86 #> -------------------------------------------------- #> #> Lower Tail Test #> --------------- #> ratio = sd(read) / (write) #> Ho: ratio = 1 #> Ha: ratio < 1 #> #> Variance Ratio Test #> ------------------------------------ #> F Num DF Den DF p #> ------------------------------------ #> 1.1701 199 199 0.8656 #> ------------------------------------
# upper tail var_test_shiny(hsb, 'read', 'write', alternative = 'greater')
#> Variance Ratio Test #> -------------------------------------------------- #> Group Obs Mean Std. Err. Std. Dev. #> -------------------------------------------------- #> read 200 52.23 0.72 10.25 #> write 200 52.77 0.67 9.48 #> -------------------------------------------------- #> combined 400 52.5 0.49 9.86 #> -------------------------------------------------- #> #> Upper Tail Test #> --------------- #> Ho: ratio = 1 #> Ha: ratio > 1 #> #> Variance Ratio Test #> ------------------------------------ #> F Num DF Den DF p #> ------------------------------------ #> 1.1701 199 199 0.1344 #> ------------------------------------
# all tails var_test_shiny(hsb, 'read', 'write', alternative = 'all')
#> Variance Ratio Test #> -------------------------------------------------- #> Group Obs Mean Std. Err. Std. Dev. #> -------------------------------------------------- #> read 200 52.23 0.72 10.25 #> write 200 52.77 0.67 9.48 #> -------------------------------------------------- #> combined 400 52.5 0.49 9.86 #> -------------------------------------------------- #> #> Variance Ratio Test #> -------------------------------------------------- #> F Num DF Den DF #> -------------------------------------------------- #> 1.1701 199 199 #> -------------------------------------------------- #> #> Null & Alternate Hypothesis #> ---------------------------------------- #> ratio = sd(read) / (write) #> Ho: ratio = 1 #> #> Ha: ratio < 1 Ha: ratio > 1 #> Pr(F < f) = 0.8656 Pr(F > f) = 0.1344 #> ----------------------------------------