0
Hi                           oshima.                          2012-02-11 HiRoshima.R #2 @Friday, February 10, 12          ...
0.Friday, February 10, 12        2
0.         •                               (SAKAUE, Tatsuya)                     •        :               ...             ...
Friday, February 10, 12   5
Agenda                          1. R                          2.                          3.                          4.  ...
Agenda                          1. R                          2.                          3.                          4.  ...
•          •                        Ross Ihaka & Robert Gentleman (R & R)                          •   Ross Ihaka and Robe...
Friday, February 10, 12   10
•               IBM SPSS Statistics   10   ...          •          •Friday, February 10, 12                               ...
•                          •                          •                •                          •Friday, February 10, 12...
UgeeeeeeeeeFriday, February 10, 12                 13
Excel     SPSS   ...         •         •                          • Excel         •Friday, February 10, 12                ...
Excel                          SPSSFriday, February 10, 12           15
-Install / Update / Uninstall-Friday, February 10, 12                  16
1. http://www.r-project.org/            2. “download R”            3. JAPAN            4.                OSFriday, Februar...
• Windows: : http://cran.md.tsukuba.ac.jp/bin/windows/base/                          • Download R 2.14.0 for Windows      ...
Friday, February 10, 12   19
Friday, February 10, 12   20
Friday, February 10, 12   21
Friday, February 10, 12   22
Friday, February 10, 12   23
Friday, February 10, 12   24
1. http://www.r-project.org/                    2.                    3.Friday, February 10, 12                           ...
•                          •             •                Windows                          •Friday, February 10, 12       ...
• Windows          • [ Windows XP]          →          • [ Windows 7 ]         →    • Mac OS X          • /Applications   ...
• Windows             • START → Program → R → R 2.14.1       • Mac OS X             • /Applications   R                   ...
• Windows       Mac OS X                  1. q()                  2.                  3.           RFriday, February 10, 1...
...                 •        help(sth)                 • seekR  (http://seekr.jp/)                 • R SEEK  (http://www.r...
•              •              •           help(sth) !!Friday, February 10, 12                  31
Excel                          SPSSFriday, February 10, 12           32
Agenda                          1. R                          2.                          3.                          4.  ...
Agenda                          1. R                          2.                          3.                          4.  ...
Friday, February 10, 12   35
•                    [Enter]                          • > 3+5 [Enter]                          • > 10-3 [Enter]           ...
•                          •   > 100^1/2                          •   > 100^(1/2)Friday, February 10, 12                  ...
Friday, February 10, 12   38
Friday, February 10, 12   39
Friday, February 10, 12   40
“I dont know !” by fmgbain http://www.flickr.com/photos/fmgbain/4382010455/Friday, February 10, 12                         ...
Friday, February 10, 12   42
sqrt()                          • > sqrt(2)                          • > sqrt(144)                          • > sqrt(10497...
(   )       •       •q()               help(sth)       •Friday, February 10, 12                44
Friday, February 10, 12   45
Friday, February 10, 12   46
Friday, February 10, 12   47
Friday, February 10, 12   48
Friday, February 10, 12   49
“I dont know !” by fmgbain http://www.flickr.com/photos/fmgbain/4382010455/Friday, February 10, 12                         ...
Friday, February 10, 12   51
“hako”     •         > hako <- c(1,2,3,4,5)     •         > hako                  • c()   concatenate/combine             ...
c()   “<-”        hako <- c(1,2,3,4,5)      “<-”                                  ←Friday, February 10, 12                ...
+        ...                      •              [Enter]                          • [STOP]                          • [Esc...
•                      •   TabFriday, February 10, 12         55
hako                 1        5          5Friday, February 10, 12                  56
Friday, February 10, 12   57
•   > sqrt(hako)                      • > log(hako)Friday, February 10, 12                  58
sqrt(1), sqrt(2) ... sqrt(5)                           log(1), log (2) ... log (5)Friday, February 10, 12                 ...
Friday, February 10, 12   60
Friday, February 10, 12   61
•                    summary()               •                  table()               •          sum()               •    ...
•               mean()          •                        max(), min()          •               median()          •        ...
•R               •                 • q(), help(), sqrt(), log(), c()               •Friday, February 10, 12               ...
OKFriday, February 10, 12        65
Agenda                          1. R                          2.                          3.                          4.  ...
Agenda                          1. R                          2.                          3.                          4.  ...
Sub topics                          1.                          2.                          3.Friday, February 10, 12     ...
Friday, February 10, 12   69
Friday, February 10, 12   70
...            •            •            •             TOEICFriday, February 10, 12           71
...                          A   180     75                          B   170     65                          C   165     6...
RFriday, February 10, 12       73
Friday, February 10, 12   74
1   2   3                          4   5   6                          7   8   9Friday, February 10, 12               75
Friday, February 10, 12   76
1   2   3                          4   5   6                          7   8   9Friday, February 10, 12               77
1   2   3                          4   5   6                          7   8   9Friday, February 10, 12               78
1   2   3                          4   5   6                          7   8   9Friday, February 10, 12               79
Friday, February 10, 12   80
1   2   3                          4   5   6                          7   8   9Friday, February 10, 12               81
1   2   3                          4   5   6                          7   8   9Friday, February 10, 12               82
1   2   3                          4   5   6                          7   8   9Friday, February 10, 12               83
Friday, February 10, 12   84
matrix()Friday, February 10, 12    85
matrix()            •            • matrix(         ,      ,   )            •Friday, February 10, 12                      86
A   180   75                          B   170   65                          C   165   60                          D   175 ...
karada <- matrix(c(180, 170, 165,           175, 190, 75, 65, 60, 70, 80), 5, 2)              1. c()              2. matri...
> karadaFriday, February 10, 12              89
matrix(1:9,nrow=3,ncol=3)                          1       4      7                          2       5      8             ...
matrix(1:9,nrow=3,ncol=3,byrow=TRUE)                          1   2   3                          4   5   6                ...
1.                   2.Friday, February 10, 12   92
demo <- matrix(1:30,nrow=5,ncol=6)        http://gyazo.com/76c58d5d6c8426a44f160897cda99671.pngFriday, February 10, 12    ...
2               → demo[2,]                          2               → demo[,2]               http://gyazo.com/6726084afd9e...
2       4                              → demo[c(2,4),]                          2       4                              → d...
http://gyazo.com/a116c0e2f1284ea7d38bf7024d92f1cc.pngFriday, February 10, 12                                              ...
•              •              •Friday, February 10, 12   97
Sub topics                          1.                          2.                          3.Friday, February 10, 12     ...
•                    •                    •Friday, February 10, 12   99
B   175   65                          B   177   70                          B   174   75                          A   179 ...
• Excel   WS                      •                      •Friday, February 10, 12              101
...               • data.frame()   (p.240)               •                (p.243)               •                     (p.2...
...Friday, February 10, 12         103
“173.365 - Come on, feel the noise” by Je the Trojan                             http://www. ickr.com/photos/trojanguy/304...
Friday, February 10, 12   105
Sub topics                          1.                          2.                          3.Friday, February 10, 12     ...
Friday, February 10, 12   107
...                • Excel                •                          →Friday, February 10, 12             108
•              ...                          •                          •Friday, February 10, 12             109
• Windows            →                  •       “MyDocuments”               • Mac OS X           →               • Linux u...
•                          • getwd()                             • > getwd()                          • setwd()           ...
• read.csv()                • CSV                • CSV: Comma Separated ValueFriday, February 10, 12                      ...
1. demo.csv                          • XLS/XLSX                          • CSV             UTF-8            2. > test <- r...
CSV                                ...Friday, February 10, 12               114
• read.delim()                •                • delim: delimiterFriday, February 10, 12              115
1. demo.xls         2. > test2 <- read.delim("clipboard")                          Mac   : read.delim(pipe(“pbpaste”))    ...
> table(test2[,1])                          •              1                    > mean(test2[,2])                         ...
•          • CSV                read.csv()          •               orFriday, February 10, 12                     118
CSV                          Excel                                  “y2.d175 | Lasershow! Relax!” by B Rosen              ...
Excel                          SPSSFriday, February 10, 12           120
Agenda                          1. R                          2.                          3.                          4.  ...
Agenda                          1. R                          2.                          3.                          4.  ...
Friday, February 10, 12   123
Friday, February 10, 12   124
1.                    2.Friday, February 10, 12   125
2                          Excel       SPSS                                      ... orzFriday, February 10, 12           ...
Friday, February 10, 12   127
> age <- c(18, 23, 14, 19,                     21, 29, 22, 21, 23, 19, 20, 20,                     26, 18, 14, 6, 8, 16, 2...
Friday, February 10, 12   129
> score <- c(60, 50, 72, 43, 50,                  55, 43, 50, 85, 40)                  > words <- c(340, 190, 465, 170,   ...
Friday, February 10, 12   131
> high <- c(350, 285, 315, 340,              210, 185, 120, 740, 425, 155)              > coll <- c(365, 570, 645, 540, 64...
1.                    2.                    3.                          twitter, FBFriday, February 10, 12                ...
Excel                          “y2.d175 | Lasershow! Relax!” by B Rosen                          http://www.flickr.com/phot...
Agenda                          1. R                          2.                          3.                          4.  ...
Agenda                          1. R                          2.                          3.                          4.  ...
Friday, February 10, 12   137
tFriday, February 10, 12       138
tFriday, February 10, 12       139
•                     H0    •                     H1    •       H0                 (t, χ2, F )    •Friday, February 10, 12...
t                   •                   •R     t.test()Friday, February 10, 12              141
t             •      > like <- c(6,10,6,10,7,8,7,9,10,4)      > dislike <- c(3,5,6,4,4,8,4,5,4,7)      > t.test(like,disli...
t      > t.test(like,dislike,var.equal=TRUE)              Two Sample t-test      data: like and dislike      t = 3.3041, d...
t               ...         “          t                    Welch           t                   Welch           t         ...
Welch !Friday, February 10, 12             145
!                     !                ―                                                           Welch                 ―...
...      > t.test(like,dislike,var.equal=FALSE)              Welch Two Sample t-test      data: like and dislike      t = ...
t                      t                                       ...      •       t                t                        ...
tFriday, February 10, 12       149
Friday, February 10, 12   150
•                  •                  •       A   B           •Friday, February 10, 12           151
:           “      ”                                                               “however”                              ...
> freq <- c(109,347,8)    > chisq.test(freq,correct=FALSE)             Chi-squared test for given probabilities        dat...
tFriday, February 10, 12       154
Friday, February 10, 12   155
•3                  •       t            • ANOVA           ANalysis Of VAriance            •F                       FFrida...
A        B       C                              10       9       6                               8       7       4        ...
> test <- read.csv("demo.csv", head=T)   > anova(lm(Class ~ Score, data=test))   Analysis of Variance Table   Response: Cl...
•                          •   t                          •                •                 !                          • ...
Friday, February 10, 12   160
Friday, February 10, 12   161
Friday, February 10, 12   162
Friday, February 10, 12   163
2,940   1,785   3,780Friday, February 10, 12                   164
One more thing...Friday, February 10, 12                       165
22       19              R                                         R                          R    R          http://www.o...
Excel                          SPSSFriday, February 10, 12           167
twitter: @sakaue                          e-mail: tsakaue<AT>hiroshima-u.ac.jpFriday, February 10, 12                     ...
Upcoming SlideShare
Loading in...5
×

HiRoshima.R #2 入門者講習資料

872

Published on

Published in: Education, Technology
1 Comment
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total Views
872
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
9
Comments
1
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "HiRoshima.R #2 入門者講習資料"

  1. 1. Hi oshima. 2012-02-11 HiRoshima.R #2 @Friday, February 10, 12 1
  2. 2. 0.Friday, February 10, 12 2
  3. 3. 0. • (SAKAUE, Tatsuya) • : ... • Nagoya.R / HiRoshima.R • ID: sakaue • ...Friday, February 10, 12 4
  4. 4. Friday, February 10, 12 5
  5. 5. Agenda 1. R 2. 3. 4. 5. RFriday, February 10, 12 7
  6. 6. Agenda 1. R 2. 3. 4. 5. RFriday, February 10, 12 8
  7. 7. • • Ross Ihaka & Robert Gentleman (R & R) • Ross Ihaka and Robert Gentleman. R: A language for data analysis and graphics. Journal of Computational and Graphical Statistics, 5(3):299-314, 1996. • http://biostat.mc.vanderbilt.edu/twiki/pub/Main/Je reyHorner/JCGSR.pdf •Friday, February 10, 12 9
  8. 8. Friday, February 10, 12 10
  9. 9. • IBM SPSS Statistics 10 ... • •Friday, February 10, 12 11
  10. 10. • • • • •Friday, February 10, 12 12
  11. 11. UgeeeeeeeeeFriday, February 10, 12 13
  12. 12. Excel SPSS ... • • • Excel •Friday, February 10, 12 14
  13. 13. Excel SPSSFriday, February 10, 12 15
  14. 14. -Install / Update / Uninstall-Friday, February 10, 12 16
  15. 15. 1. http://www.r-project.org/ 2. “download R” 3. JAPAN 4. OSFriday, February 10, 12 17
  16. 16. • Windows: : http://cran.md.tsukuba.ac.jp/bin/windows/base/ • Download R 2.14.0 for Windows • Mac OS X: http://cran.md.tsukuba.ac.jp/bin/macosx/ • R-2.14.0.pkg (latest version)Friday, February 10, 12 18
  17. 17. Friday, February 10, 12 19
  18. 18. Friday, February 10, 12 20
  19. 19. Friday, February 10, 12 21
  20. 20. Friday, February 10, 12 22
  21. 21. Friday, February 10, 12 23
  22. 22. Friday, February 10, 12 24
  23. 23. 1. http://www.r-project.org/ 2. 3.Friday, February 10, 12 25
  24. 24. • • • Windows •Friday, February 10, 12 26
  25. 25. • Windows • [ Windows XP] → • [ Windows 7 ] → • Mac OS X • /Applications /Library Frameworks R. framework CleanAppFriday, February 10, 12 27
  26. 26. • Windows • START → Program → R → R 2.14.1 • Mac OS X • /Applications R RFriday, February 10, 12 28
  27. 27. • Windows Mac OS X 1. q() 2. 3. RFriday, February 10, 12 29
  28. 28. ... • help(sth) • seekR (http://seekr.jp/) • R SEEK (http://www.rseek.org/) • RjpWiki (http://www.okada.jp.org/RWiki/) • R-Tips (http://cse.naro.a rc.go.jp/takezawa/r-tips/r.html) •R (http://aoki2.si.gunma-u.ac.jp/R/)Friday, February 10, 12 30
  29. 29. • • • help(sth) !!Friday, February 10, 12 31
  30. 30. Excel SPSSFriday, February 10, 12 32
  31. 31. Agenda 1. R 2. 3. 4. 5. RFriday, February 10, 12 33
  32. 32. Agenda 1. R 2. 3. 4. 5. RFriday, February 10, 12 34
  33. 33. Friday, February 10, 12 35
  34. 34. • [Enter] • > 3+5 [Enter] • > 10-3 [Enter] • > 2*3 [Enter] • > 100/20 [Enter] • > (12 + 34 -56) * 78 / 90 [Enter]Friday, February 10, 12 36
  35. 35. • • > 100^1/2 • > 100^(1/2)Friday, February 10, 12 37
  36. 36. Friday, February 10, 12 38
  37. 37. Friday, February 10, 12 39
  38. 38. Friday, February 10, 12 40
  39. 39. “I dont know !” by fmgbain http://www.flickr.com/photos/fmgbain/4382010455/Friday, February 10, 12 41
  40. 40. Friday, February 10, 12 42
  41. 41. sqrt() • > sqrt(2) • > sqrt(144) • > sqrt(104976)Friday, February 10, 12 43
  42. 42. ( ) • •q() help(sth) •Friday, February 10, 12 44
  43. 43. Friday, February 10, 12 45
  44. 44. Friday, February 10, 12 46
  45. 45. Friday, February 10, 12 47
  46. 46. Friday, February 10, 12 48
  47. 47. Friday, February 10, 12 49
  48. 48. “I dont know !” by fmgbain http://www.flickr.com/photos/fmgbain/4382010455/Friday, February 10, 12 50
  49. 49. Friday, February 10, 12 51
  50. 50. “hako” • > hako <- c(1,2,3,4,5) • > hako • c() concatenate/combine •Friday, February 10, 12 52
  51. 51. c() “<-” hako <- c(1,2,3,4,5) “<-” ←Friday, February 10, 12 53
  52. 52. + ... • [Enter] • [STOP] • [Esc]Friday, February 10, 12 54
  53. 53. • • TabFriday, February 10, 12 55
  54. 54. hako 1 5 5Friday, February 10, 12 56
  55. 55. Friday, February 10, 12 57
  56. 56. • > sqrt(hako) • > log(hako)Friday, February 10, 12 58
  57. 57. sqrt(1), sqrt(2) ... sqrt(5) log(1), log (2) ... log (5)Friday, February 10, 12 59
  58. 58. Friday, February 10, 12 60
  59. 59. Friday, February 10, 12 61
  60. 60. • summary() • table() • sum() • length()Friday, February 10, 12 62
  61. 61. • mean() • max(), min() • median() • sd()Friday, February 10, 12 63
  62. 62. •R • • q(), help(), sqrt(), log(), c() •Friday, February 10, 12 64
  63. 63. OKFriday, February 10, 12 65
  64. 64. Agenda 1. R 2. 3. 4. 5. RFriday, February 10, 12 66
  65. 65. Agenda 1. R 2. 3. 4. 5. RFriday, February 10, 12 67
  66. 66. Sub topics 1. 2. 3.Friday, February 10, 12 68
  67. 67. Friday, February 10, 12 69
  68. 68. Friday, February 10, 12 70
  69. 69. ... • • • TOEICFriday, February 10, 12 71
  70. 70. ... A 180 75 B 170 65 C 165 60 D 175 70 E 190 80Friday, February 10, 12 72
  71. 71. RFriday, February 10, 12 73
  72. 72. Friday, February 10, 12 74
  73. 73. 1 2 3 4 5 6 7 8 9Friday, February 10, 12 75
  74. 74. Friday, February 10, 12 76
  75. 75. 1 2 3 4 5 6 7 8 9Friday, February 10, 12 77
  76. 76. 1 2 3 4 5 6 7 8 9Friday, February 10, 12 78
  77. 77. 1 2 3 4 5 6 7 8 9Friday, February 10, 12 79
  78. 78. Friday, February 10, 12 80
  79. 79. 1 2 3 4 5 6 7 8 9Friday, February 10, 12 81
  80. 80. 1 2 3 4 5 6 7 8 9Friday, February 10, 12 82
  81. 81. 1 2 3 4 5 6 7 8 9Friday, February 10, 12 83
  82. 82. Friday, February 10, 12 84
  83. 83. matrix()Friday, February 10, 12 85
  84. 84. matrix() • • matrix( , , ) •Friday, February 10, 12 86
  85. 85. A 180 75 B 170 65 C 165 60 D 175 70 E 190 80Friday, February 10, 12 87
  86. 86. karada <- matrix(c(180, 170, 165, 175, 190, 75, 65, 60, 70, 80), 5, 2) 1. c() 2. matrix() • 5 2 3. karadaFriday, February 10, 12 88
  87. 87. > karadaFriday, February 10, 12 89
  88. 88. matrix(1:9,nrow=3,ncol=3) 1 4 7 2 5 8 3 6 9Friday, February 10, 12 90
  89. 89. matrix(1:9,nrow=3,ncol=3,byrow=TRUE) 1 2 3 4 5 6 7 8 9Friday, February 10, 12 91
  90. 90. 1. 2.Friday, February 10, 12 92
  91. 91. demo <- matrix(1:30,nrow=5,ncol=6) http://gyazo.com/76c58d5d6c8426a44f160897cda99671.pngFriday, February 10, 12 93
  92. 92. 2 → demo[2,] 2 → demo[,2] http://gyazo.com/6726084afd9e1cc4b03df85fe6bc0f29.pngFriday, February 10, 12 94
  93. 93. 2 4 → demo[c(2,4),] 2 4 → demo[, c(2,4)]Friday, February 10, 12 95
  94. 94. http://gyazo.com/a116c0e2f1284ea7d38bf7024d92f1cc.pngFriday, February 10, 12 96
  95. 95. • • •Friday, February 10, 12 97
  96. 96. Sub topics 1. 2. 3.Friday, February 10, 12 98
  97. 97. • • •Friday, February 10, 12 99
  98. 98. B 175 65 B 177 70 B 174 75 A 179 70 O 170 60Friday, February 10, 12 100
  99. 99. • Excel WS • •Friday, February 10, 12 101
  100. 100. ... • data.frame() (p.240) • (p.243) • (p.243)Friday, February 10, 12 102
  101. 101. ...Friday, February 10, 12 103
  102. 102. “173.365 - Come on, feel the noise” by Je the Trojan http://www. ickr.com/photos/trojanguy/3046207115/Friday, February 10, 12 104
  103. 103. Friday, February 10, 12 105
  104. 104. Sub topics 1. 2. 3.Friday, February 10, 12 106
  105. 105. Friday, February 10, 12 107
  106. 106. ... • Excel • →Friday, February 10, 12 108
  107. 107. • ... • •Friday, February 10, 12 109
  108. 108. • Windows → • “MyDocuments” • Mac OS X → • Linux up to you...Friday, February 10, 12 110
  109. 109. • • getwd() • > getwd() • setwd() • > setwd("/Users/sakaue/Desktop/")Friday, February 10, 12 111
  110. 110. • read.csv() • CSV • CSV: Comma Separated ValueFriday, February 10, 12 112
  111. 111. 1. demo.csv • XLS/XLSX • CSV UTF-8 2. > test <- read.csv(“demo.csv”) 3. > test [Enter]Friday, February 10, 12 113
  112. 112. CSV ...Friday, February 10, 12 114
  113. 113. • read.delim() • • delim: delimiterFriday, February 10, 12 115
  114. 114. 1. demo.xls 2. > test2 <- read.delim("clipboard") Mac : read.delim(pipe(“pbpaste”)) 3. > test2 [Enter]Friday, February 10, 12 116
  115. 115. > table(test2[,1]) • 1 > mean(test2[,2]) • 2 > hist(test2[,2]) • 2Friday, February 10, 12 117
  116. 116. • • CSV read.csv() • orFriday, February 10, 12 118
  117. 117. CSV Excel “y2.d175 | Lasershow! Relax!” by B Rosen http://www.flickr.com/photos/rosengrant/4751386872/Friday, February 10, 12 119
  118. 118. Excel SPSSFriday, February 10, 12 120
  119. 119. Agenda 1. R 2. 3. 4. 5. RFriday, February 10, 12 121
  120. 120. Agenda 1. R 2. 3. 4. 5. RFriday, February 10, 12 122
  121. 121. Friday, February 10, 12 123
  122. 122. Friday, February 10, 12 124
  123. 123. 1. 2.Friday, February 10, 12 125
  124. 124. 2 Excel SPSS ... orzFriday, February 10, 12 126
  125. 125. Friday, February 10, 12 127
  126. 126. > age <- c(18, 23, 14, 19, 21, 29, 22, 21, 23, 19, 20, 20, 26, 18, 14, 6, 8, 16, 23, 20) > hist(age)Friday, February 10, 12 128
  127. 127. Friday, February 10, 12 129
  128. 128. > score <- c(60, 50, 72, 43, 50, 55, 43, 50, 85, 40) > words <- c(340, 190, 465, 170, 130, 225,140, 310, 580, 120) > plot(score,words)Friday, February 10, 12 130
  129. 129. Friday, February 10, 12 131
  130. 130. > high <- c(350, 285, 315, 340, 210, 185, 120, 740, 425, 155) > coll <- c(365, 570, 645, 540, 645, 665, 880, 550, 410, 585) > boxplot(high, coll, names=c("High", "Coll"))Friday, February 10, 12 132
  131. 131. 1. 2. 3. twitter, FBFriday, February 10, 12 133
  132. 132. Excel “y2.d175 | Lasershow! Relax!” by B Rosen http://www.flickr.com/photos/rosengrant/4751386872/Friday, February 10, 12 134
  133. 133. Agenda 1. R 2. 3. 4. 5. RFriday, February 10, 12 135
  134. 134. Agenda 1. R 2. 3. 4. 5. RFriday, February 10, 12 136
  135. 135. Friday, February 10, 12 137
  136. 136. tFriday, February 10, 12 138
  137. 137. tFriday, February 10, 12 139
  138. 138. • H0 • H1 • H0 (t, χ2, F ) •Friday, February 10, 12 140
  139. 139. t • •R t.test()Friday, February 10, 12 141
  140. 140. t • > like <- c(6,10,6,10,7,8,7,9,10,4) > dislike <- c(3,5,6,4,4,8,4,5,4,7) > t.test(like,dislike,var.equal=TRUE)Friday, February 10, 12 142
  141. 141. t > t.test(like,dislike,var.equal=TRUE) Two Sample t-test data: like and dislike t = 3.3041, df = 18, p-value = 0.003946 alternative hypothesis: true difference in means is not equal to 0 # 95 percent confidence interval: # 0.9831754 4.4168246 sample estimates: mean of x mean of y 7.7 5.0Friday, February 10, 12 143
  142. 142. t ... “ t Welch t Welch t ” http://aoki2.si.gunma-u.ac.jp/lecture/Average/bunsan1.htmlFriday, February 10, 12 144
  143. 143. Welch !Friday, February 10, 12 145
  144. 144. ! ! ― Welch ― • http://oku.edu.mie-u.ac.jp/~okumura/blog/node/2262 • http://aoki2.si.gunma-u.ac.jp/lecture/BF/index.html • Donald W. Zimmerman, ``Some properties of preliminary tests of equality of variances in the two-sample location problem, The Journal of General Psychology, Vol.123, pp. 217-231 (1996) • The unequal variance t-test is an underused alternative to Students t-test and the Mann-Whitney U test -- Ruxton 17 (4): 688 -- Behavioral Ecology • : Mann-Whitney U http://qdai.way- nifty.com/qjes/2005/02/mannwhitneyu.htmlFriday, February 10, 12 146
  145. 145. ... > t.test(like,dislike,var.equal=FALSE) Welch Two Sample t-test data: like and dislike t = 3.3041, df = 16.795, p-value = 0.004249 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.9743014 4.4256986 sample estimates: mean of x mean of y 7.7 5.0Friday, February 10, 12 147
  146. 146. t t ... • t t ... • Student t t • s^2 s t ... • http://ja.wikipedia.org/wiki/%E3%82%A6%E3%82%A3%E3%83%AA %E3%82%A2%E3%83%A0%E3%83%BB%E3%82%B4%E3%82%BB%E3%83%83%E3%83%88 • http://ja.wikipedia.org/wiki/%E8%87%AA%E7%94%B1%E5%BA%A6 • http://mat.isc.chubu.ac.jp/fpr/fpr1997/0119.html • http://www.pol.geophys.tohoku.ac.jp/~hanawa/ori/ori/054.htmlFriday, February 10, 12 148
  147. 147. tFriday, February 10, 12 149
  148. 148. Friday, February 10, 12 150
  149. 149. • • • A B •Friday, February 10, 12 151
  150. 150. : “ ” “however” 109 347 8 493 [ ] , .... [ ] ..., , .... [ ] ..., .Friday, February 10, 12 152
  151. 151. > freq <- c(109,347,8) > chisq.test(freq,correct=FALSE) Chi-squared test for given probabilities data: freq X-squared = 391.7371, df = 2, p-value < 2.2e-16 # 2 # http://homepage2.nifty.com/nandemoarchive/toukei_kiso/t_F_chi.htmFriday, February 10, 12 153
  152. 152. tFriday, February 10, 12 154
  153. 153. Friday, February 10, 12 155
  154. 154. •3 • t • ANOVA ANalysis Of VAriance •F FFriday, February 10, 12 156
  155. 155. A B C 10 9 6 8 7 4 9 4 3 6 5 9 9 2 2 5 8 6 7 4 2 9 2 4 8 8 3 10 4 9Friday, February 10, 12 157
  156. 156. > test <- read.csv("demo.csv", head=T) > anova(lm(Class ~ Score, data=test)) Analysis of Variance Table Response: Class Df Sum Sq Mean Sq F value Pr(>F) Score 1 5.2389 5.2389 9.9376 0.00384 ** Residuals 28 14.7611 0.5272 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1Friday, February 10, 12 158
  157. 157. • • t • • ! • ...Friday, February 10, 12 159
  158. 158. Friday, February 10, 12 160
  159. 159. Friday, February 10, 12 161
  160. 160. Friday, February 10, 12 162
  161. 161. Friday, February 10, 12 163
  162. 162. 2,940 1,785 3,780Friday, February 10, 12 164
  163. 163. One more thing...Friday, February 10, 12 165
  164. 164. 22 19 R R R R http://www.occn.zaq.ne.jp/cuhxr802/epi_20120126.pdfFriday, February 10, 12 166
  165. 165. Excel SPSSFriday, February 10, 12 167
  166. 166. twitter: @sakaue e-mail: tsakaue<AT>hiroshima-u.ac.jpFriday, February 10, 12 168
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×