# Hypothesis Testing for Diffrence of Average

Hypothesis testing for diffrence of average is the most used
hypothesis testing
in
SPC
.

Basic way of this testing is for the difference between 2 groups.

##
Difference of Average between 2 Groups

There are 2 methods,
Student's t-test and
Welch's t-test.

Student's t-test needs "variance is equal". But Welch's do not need.

##
Example by R

In Excel, ttest function is for this test.

###
Student's t-test

**setwd("C:/Rtest") **

Data <- read.csv("Data.csv", header=T)

t.test(x=Data$X1,y=Data$X2,var.equal=T,paired=F) # Student's t-test

###
Welch's t-test

**setwd("C:/Rtest")**

Data <- read.csv("Data.csv", header=T)

t.test(x=Data$X1,y=Data$X2,var.equal=F,paired=F) # Welch's t-test

##
ANOVA and Paired t-test

ANOVA
is used for the case that more than 3 groups.
Paired t-test
is used for the paired data.

These methods have other use.

NEXT ANOVA