SlideShare ist ein Scribd-Unternehmen logo
1 von 7
R 기초 – 평균차이검정,
  일원배치분산분석

   한림대학교 금융정보통계학과
       이 윤 환
평균차이 검정
t.test(
   x,
   y = NULL,
   alternative = c("two.sided", "less", "greater"),
   mu = 0,
   paired = FALSE,
   var.equal = FALSE,
   conf.level = 0.95
)




 간호 통계                                                이윤환, yoonani72@gmail.com
평균차이 검정

 > setwd("c://r_nur")
 > delivery <- read.table("delivery.txt", header=TRUE)
 > attach(delivery)
 > t.test(time[type==2], time[type==1], var.equal=TRUE)

        Welch Two Sample t-test

 data: time[type == 2] and time[type == 1]
 t = 2.3003, df = 24.777, p-value = 0.03013
 alternative hypothesis: true difference in means is not equal to 0
 95 percent confidence interval:
 0.1999658 3.6358431
 sample estimates:
 mean of x mean of y
 10.473529 8.555625



간호 통계                                                 이윤환, yoonani72@gmail.com
일원배치 분산분석
   > one.way <- read.table("fuel.txt", header=T)
   > attach(one.way)
   > Trt <- factor(trt)
   > one.way.anova <- aov(y ~ Trt)
   > summary.aov(one.way.anova)
   > model.tables(one.way.anova)
   > Tukey <- TukeyHSD(one.way.anova)
   > print(Tukey,3)
   > plot(Tukey)




                      R을 활용한 통계적 개념, 방법, 응용 – 허명회 저 중
간호 통계                                   이윤환, yoonani72@gmail.com
분산분석표

                       Df          Sum Sq                  Mean Sq          F value   Pr(>F)
Trt                     3          1636.5                  545.5            5.4063    0.006876 **
Residuals              20          2018.0                  100.9
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1




   간호 통계                                                             이윤환, yoonani72@gmail.com
다중 비교

        Tukey multiple comparisons of means
          95% family-wise confidence level

        Fit: aov(formula = y ~ Trt)

        $Trt
                 diff      lwr               upr        p adj
        2-1       13        -3.23            29.23      0.146
        3-1         4      -12.23            20.23      0.900
        4-1      -10       -26.23     6.23   0.338
        3-2       -9       -25.23     7.23   0.427
        4-2      -23       -39.23            -6.77      0.004
        4-3      -14       -30.23     2.23   0.107




간호 통계                                                이윤환, yoonani72@gmail.com
다중비교




간호 통계          이윤환, yoonani72@gmail.com

Weitere ähnliche Inhalte

Ähnlich wie R 기초 anova

Bel ventutorial hetero
Bel ventutorial heteroBel ventutorial hetero
Bel ventutorial hetero
Edda Kang
 
eggs_project_interm
eggs_project_intermeggs_project_interm
eggs_project_interm
Roopan Verma
 
Kano GIS Day 2014 - The Application of Multivariate Geostatistical analyses i...
Kano GIS Day 2014 - The Application of Multivariate Geostatistical analyses i...Kano GIS Day 2014 - The Application of Multivariate Geostatistical analyses i...
Kano GIS Day 2014 - The Application of Multivariate Geostatistical analyses i...
eHealth Africa
 
Statistics and Data Mining with Perl Data Language
Statistics and Data Mining with Perl Data LanguageStatistics and Data Mining with Perl Data Language
Statistics and Data Mining with Perl Data Language
maggiexyz
 
One-way ANOVA research paper
One-way ANOVA research paperOne-way ANOVA research paper
One-way ANOVA research paper
Jose Dela Cruz
 
Data Project 1-use a significance level of 0.05Companies in the Do.pdf
Data Project 1-use a significance level of 0.05Companies in the Do.pdfData Project 1-use a significance level of 0.05Companies in the Do.pdf
Data Project 1-use a significance level of 0.05Companies in the Do.pdf
tesmondday29076
 

Ähnlich wie R 기초 anova (20)

Issues in time series econometrics
Issues in time series econometricsIssues in time series econometrics
Issues in time series econometrics
 
Stat2013
Stat2013Stat2013
Stat2013
 
Bel ventutorial hetero
Bel ventutorial heteroBel ventutorial hetero
Bel ventutorial hetero
 
R programming intro with examples
R programming intro with examplesR programming intro with examples
R programming intro with examples
 
Statistical Estimation and Testing Lecture Notes.pdf
Statistical Estimation and Testing Lecture Notes.pdfStatistical Estimation and Testing Lecture Notes.pdf
Statistical Estimation and Testing Lecture Notes.pdf
 
Quantitative Analysis for Emperical Research
Quantitative Analysis for Emperical ResearchQuantitative Analysis for Emperical Research
Quantitative Analysis for Emperical Research
 
Interpreting Logistic Regression.pptx
Interpreting Logistic Regression.pptxInterpreting Logistic Regression.pptx
Interpreting Logistic Regression.pptx
 
L estimation
L estimationL estimation
L estimation
 
eggs_project_interm
eggs_project_intermeggs_project_interm
eggs_project_interm
 
Kano GIS Day 2014 - The Application of Multivariate Geostatistical analyses i...
Kano GIS Day 2014 - The Application of Multivariate Geostatistical analyses i...Kano GIS Day 2014 - The Application of Multivariate Geostatistical analyses i...
Kano GIS Day 2014 - The Application of Multivariate Geostatistical analyses i...
 
Statistics and Data Mining with Perl Data Language
Statistics and Data Mining with Perl Data LanguageStatistics and Data Mining with Perl Data Language
Statistics and Data Mining with Perl Data Language
 
Bigger Data v Better Math
Bigger Data v Better MathBigger Data v Better Math
Bigger Data v Better Math
 
One-way ANOVA research paper
One-way ANOVA research paperOne-way ANOVA research paper
One-way ANOVA research paper
 
Two Means, Two Dependent Samples, Matched Pairs
Two Means, Two Dependent Samples, Matched PairsTwo Means, Two Dependent Samples, Matched Pairs
Two Means, Two Dependent Samples, Matched Pairs
 
Statistical ppt
Statistical pptStatistical ppt
Statistical ppt
 
Data Project 1-use a significance level of 0.05Companies in the Do.pdf
Data Project 1-use a significance level of 0.05Companies in the Do.pdfData Project 1-use a significance level of 0.05Companies in the Do.pdf
Data Project 1-use a significance level of 0.05Companies in the Do.pdf
 
Hypothesis testing
Hypothesis testingHypothesis testing
Hypothesis testing
 
Engineering Statistics
Engineering Statistics Engineering Statistics
Engineering Statistics
 
Inferences about Two Proportions
 Inferences about Two Proportions Inferences about Two Proportions
Inferences about Two Proportions
 
BUS173 Lecture 4.pptx
BUS173 Lecture 4.pptxBUS173 Lecture 4.pptx
BUS173 Lecture 4.pptx
 

Mehr von Yoonwhan Lee (20)

R 기초 : R Basics
R 기초 : R BasicsR 기초 : R Basics
R 기초 : R Basics
 
03.기술통계 자료의 중심과 퍼진정도
03.기술통계 자료의 중심과 퍼진정도03.기술통계 자료의 중심과 퍼진정도
03.기술통계 자료의 중심과 퍼진정도
 
02.자료다루기
02.자료다루기02.자료다루기
02.자료다루기
 
01.r 기초
01.r 기초01.r 기초
01.r 기초
 
13.상관과 회귀
13.상관과 회귀13.상관과 회귀
13.상관과 회귀
 
12.세표본 이상의 평균비교
12.세표본 이상의 평균비교12.세표본 이상의 평균비교
12.세표본 이상의 평균비교
 
11.두표본의 평균비교
11.두표본의 평균비교11.두표본의 평균비교
11.두표본의 평균비교
 
10.단일표본 평균 모비율
10.단일표본 평균 모비율10.단일표본 평균 모비율
10.단일표본 평균 모비율
 
09.통계적가설검정
09.통계적가설검정09.통계적가설검정
09.통계적가설검정
 
08.추정
08.추정08.추정
08.추정
 
07.표본분포
07.표본분포07.표본분포
07.표본분포
 
06.확률분포
06.확률분포06.확률분포
06.확률분포
 
05.확률
05.확률05.확률
05.확률
 
00.통계학입문
00.통계학입문00.통계학입문
00.통계학입문
 
14.범주형자료분석
14.범주형자료분석14.범주형자료분석
14.범주형자료분석
 
Smart work 자료 1
Smart work 자료 1Smart work 자료 1
Smart work 자료 1
 
통계자료 분석을 위한 R
통계자료 분석을 위한 R통계자료 분석을 위한 R
통계자료 분석을 위한 R
 
통계자료분석을 ㅇ
통계자료분석을 ㅇ통계자료분석을 ㅇ
통계자료분석을 ㅇ
 
PHP를 이용한 간단한 방명록 만들기
PHP를 이용한 간단한 방명록 만들기PHP를 이용한 간단한 방명록 만들기
PHP를 이용한 간단한 방명록 만들기
 
Class10
Class10Class10
Class10
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Kürzlich hochgeladen (20)

Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

R 기초 anova

  • 1. R 기초 – 평균차이검정, 일원배치분산분석 한림대학교 금융정보통계학과 이 윤 환
  • 2. 평균차이 검정 t.test( x, y = NULL, alternative = c("two.sided", "less", "greater"), mu = 0, paired = FALSE, var.equal = FALSE, conf.level = 0.95 ) 간호 통계 이윤환, yoonani72@gmail.com
  • 3. 평균차이 검정 > setwd("c://r_nur") > delivery <- read.table("delivery.txt", header=TRUE) > attach(delivery) > t.test(time[type==2], time[type==1], var.equal=TRUE) Welch Two Sample t-test data: time[type == 2] and time[type == 1] t = 2.3003, df = 24.777, p-value = 0.03013 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.1999658 3.6358431 sample estimates: mean of x mean of y 10.473529 8.555625 간호 통계 이윤환, yoonani72@gmail.com
  • 4. 일원배치 분산분석 > one.way <- read.table("fuel.txt", header=T) > attach(one.way) > Trt <- factor(trt) > one.way.anova <- aov(y ~ Trt) > summary.aov(one.way.anova) > model.tables(one.way.anova) > Tukey <- TukeyHSD(one.way.anova) > print(Tukey,3) > plot(Tukey) R을 활용한 통계적 개념, 방법, 응용 – 허명회 저 중 간호 통계 이윤환, yoonani72@gmail.com
  • 5. 분산분석표 Df Sum Sq Mean Sq F value Pr(>F) Trt 3 1636.5 545.5 5.4063 0.006876 ** Residuals 20 2018.0 100.9 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 간호 통계 이윤환, yoonani72@gmail.com
  • 6. 다중 비교 Tukey multiple comparisons of means 95% family-wise confidence level Fit: aov(formula = y ~ Trt) $Trt diff lwr upr p adj 2-1 13 -3.23 29.23 0.146 3-1 4 -12.23 20.23 0.900 4-1 -10 -26.23 6.23 0.338 3-2 -9 -25.23 7.23 0.427 4-2 -23 -39.23 -6.77 0.004 4-3 -14 -30.23 2.23 0.107 간호 통계 이윤환, yoonani72@gmail.com
  • 7. 다중비교 간호 통계 이윤환, yoonani72@gmail.com