본문 바로가기
R코드 모아보기 (Quick R)

[R 코드 모아보기] 사후검정 4가지

by 만다린망고 2021. 9. 9.
반응형

 

@목차
Tukey test
Scheffe test
Games-Howell test 
Bonferroni test

Tukey

#data 는 x열 y열이 있는 데이터프레임
#분산분석 (x는 독립변수, y는 종속변수)
res=aov(y~x,data)
#사후분석 
TukeyHSD(res)

 

 

Scheffe

#data 는 x열 y열이 있는 데이터프레임
#패키지
library(agricolae)
#분산분석 (x는 독립변수, y는 종속변수)
res=aov(y~x,data)
#사후분석 
scheffe.test(res,"x",console=TRUE)

 

Games-Howell

#data 는 x열 y열이 있는 데이터프레임
#패키지
library(rstatix)
#사후분석 
games_howell_test(data,y~x)

 

Bonferroni

#data 는 x열 y열이 있는 데이터프레임
#패키지
library(agricolae)
#분산분석 (x는 독립변수, y는 종속변수)
res=aov(y~x,data)
#사후분석 
LSD.test(res,"x",p.adj="bonferroni",group=F)

참고 자료

반응형

댓글