sta_var: F Test to Compare Two Variances

Description Usage Arguments Examples

View source: R/sta_var.R

Description

Performs an F test to compare the variances of two samples from normal populations.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
sta_var(
  data = NULL,
  formula = NULL,
  x = NULL,
  y = NULL,
  ratio = 1,
  alternative = "two.sided",
  conf.level = 0.95,
  obj = TRUE,
  na.action = getOption("na.action"),
  ...
)

Arguments

data

an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formula).

formula

a formula of the form lhs ~ rhs where lhs is a numeric variable giving the data values and rhs a factor with two levels giving the corresponding groups.

x

numeric vectors of data values, or fitted linear model objects (inheriting from class "lm").

y

numeric vectors of data values, or fitted linear model objects (inheriting from class "lm").

ratio

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

alternative

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

conf.level

confidence level for the returned confidence interval.

obj

a logical whether the test object of stats::var.test() should be returned.

na.action

a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action").

...

further arguments to be passed to or from methods.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
library(magrittr)
data(big_five, package = "inductive")

big_five %>% 
  sta_var(Extraversion ~ Gender)

big_five %>% 
  sta_var(Extraversion ~ Neuroticism)

big_five %>% 
  sta_var(x = Extraversion, y = Neuroticism)

sta_var(big_five, x = Extraversion, y = Neuroticism)

sta_var(x = big_five$Extraversion, y = big_five$Neuroticism)

sta_var(big_five, Extraversion ~ Gender)

## End(Not run)

j3ypi/inductive documentation built on Feb. 7, 2020, 12:37 p.m.