Learn R Programming

TH (version 1.0.0)

tf2: F Test for Two Variances

Description

Performs an F test for comparing two population variances.

Usage

tf2(
  dadosX = NULL,
  dadosY = NULL,
  alfa = 0.05,
  Ha = 1,
  s2X = NULL,
  nX = NULL,
  s2Y = NULL,
  nY = NULL,
  plot = TRUE
)

Value

Invisibly returns an object of classes th_test and htest containing the test statistic, degrees of freedom when applicable, p-value, estimates, critical values, significance level, and decision. When plot = TRUE, the educational graph is produced as a side effect.

Arguments

dadosX

Numeric vector for the first sample. Use NULL when summary statistics are supplied.

dadosY

Numeric vector for the second sample. Use NULL when summary statistics are supplied.

alfa

Significance level.

Ha

Alternative hypothesis: 1 or "two.sided" for a two-sided test; 2 or "greater" for variance of X greater than variance of Y.

s2X

Variance of the first sample.

nX

Size of the first sample.

s2Y

Variance of the second sample.

nY

Size of the second sample.

plot

Logical. If TRUE (default), draw the educational graph; if FALSE, return the result without plotting.

Author

Willian Silva Barros

Details

Raw-data and summary-statistics modes are mutually exclusive. The function accepts raw data or the sample variances and sample sizes.

Main assumptions:

  • independent samples;

  • normal populations;

Examples

Run this code
X <- c(8, 12, 16, 20, 24, 28)
Y <- c(14, 15, 14, 15, 14, 15)
tf2(X, Y, alfa = 0.05, Ha = 2, plot = FALSE)

Run the code above in your browser using DataLab