Learn R Programming

TH (version 1.0.0)

tt2i: Two-Sample t Test with Equal Variances

Description

Compares two independent population means under the assumption of equal population variances.

Usage

tt2i(
  dadosX = NULL,
  dadosY = NULL,
  alfa = 0.05,
  Ha = 1,
  mX = NULL,
  s2X = NULL,
  nX = NULL,
  mY = 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. Use 1 or "two.sided", 2 or "greater", and 3 or "less".

mX

Mean of the first sample.

s2X

Variance of the first sample.

nX

Size of the first sample.

mY

Mean of the second 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 summary statistics and uses the pooled variance of the two samples.

Main assumptions:

  • independent samples;

  • approximately normal populations;

  • equal population variances;

Examples

Run this code
X <- c(18, 20, 19, 21, 22, 20)
Y <- c(14, 15, 16, 15, 14, 16)
tt2i(X, Y, alfa = 0.05, Ha = 1, plot = FALSE)

Run the code above in your browser using DataLab