Your SlideShare is downloading. ×
0
Japan.R #2 @                                    2011-11-26Saturday, November 26, 11                        2
0.Saturday, November 26, 11    3
(SAKAUE, Tatsuya)                    •           :              ...                    •       Nagoya.R / HiRoshima.R     ...
Saturday, November 26, 11   6
Agenda                            1. R                            2.                            3.                        ...
Agenda                            1. R                            2.                            3.                        ...
•         •                       Ross Ihaka & Robert Gentleman (R & R)                     •      Ross Ihaka and Robert G...
Saturday, November 26, 11   11
•                  IBM SPSS Statistics   10   ...         •         •Saturday, November 26, 11                            ...
•                            •                            •               •                            •Saturday, November...
UgeeeeeeeeeSaturday, November 26, 11                 14
Excel     SPSS   ...        •        •                            • Excel        •Saturday, November 26, 11               ...
Excel                            SPSSSaturday, November 26, 11           16
-Install / Update / Uninstall-Saturday, November 26, 11               17
1. http://www.r-project.org/           2. “download R”           3. JAPAN           4.                OSSaturday, November...
• Windows: : http://cran.md.tsukuba.ac.jp/bin/windows/base/                     • Download R 2.14.0 for Windows           ...
Saturday, November 26, 11   20
Saturday, November 26, 11   21
Saturday, November 26, 11   22
Saturday, November 26, 11   23
Saturday, November 26, 11   24
Saturday, November 26, 11   25
1. http://www.r-project.org/                  2.                  3.Saturday, November 26, 11                        26
•                            •            •                   Windows                            •Saturday, November 26, 1...
• Windows          • [ Windows XP]        →          • [ Windows 7 ]       →    • Mac OS X          • /Applications       ...
• Windows            • START → Program → R → R 2.14.0      • Mac OS X            • /Applications     R                    ...
• Windows         Mac OS X                1. q()                2.                3.              RSaturday, November 26, ...
•                   OK            •                              Win                  • [ ]→[GUI           ]              ...
...                •        help(sth)                • seekR     (http://seekr.jp/)                • R SEEK     (http://ww...
•            •            •               help(sth) !!Saturday, November 26, 11                  33
Excel                            SPSSSaturday, November 26, 11           34
Agenda                            1. R                            2.                            3.                        ...
Agenda                            1. R                            2.                            3.                        ...
Saturday, November 26, 11   37
•                        [Enter]                            • > 3+5 [Enter]                            • > 10-3 [Enter]   ...
•                            •   > 100^1/2                            •   > 100^(1/2)Saturday, November 26, 11            ...
Saturday, November 26, 11   40
Saturday, November 26, 11   41
Saturday, November 26, 11   42
“I dont know !” by fmgbain http://www.flickr.com/photos/fmgbain/4382010455/Saturday, November 26, 11                       ...
Saturday, November 26, 11   44
sqrt()                    • > sqrt(2)                    • > sqrt(144)                    • > sqrt(104976)                ...
(   )       •       •q()                 help(sth)       •Saturday, November 26, 11                46
Saturday, November 26, 11   47
Saturday, November 26, 11   48
Saturday, November 26, 11   49
Saturday, November 26, 11   50
Saturday, November 26, 11   51
“I dont know !” by fmgbain http://www.flickr.com/photos/fmgbain/4382010455/Saturday, November 26, 11                       ...
Saturday, November 26, 11   53
“hako”     •        > hako <- c(1,2,3,4,5)     •        > hako                • c()       concatenate/combine             ...
c()     “<-”       hako <- c(1,2,3,4,5)        “<-”                                   ←Saturday, November 26, 11          ...
+        ...                    •                  [Enter]                            • [STOP]                            ...
•                    •       TabSaturday, November 26, 11         57
hako               1            5          5Saturday, November 26, 11                  58
Saturday, November 26, 11   59
•       > sqrt(hako)                    • > log(hako)Saturday, November 26, 11                  60
sqrt(1), sqrt(2) ... sqrt(5)                             log(1), log (2) ... log (5)Saturday, November 26, 11             ...
Saturday, November 26, 11   62
Saturday, November 26, 11   63
•                       summary()              •                     table()              •             sum()             ...
•                  mean()         •                           max(), min()         •                  median()         •  ...
•R              •                • q(), help(), sqrt(), log(), c()              •Saturday, November 26, 11                ...
OKSaturday, November 26, 11        67
Agenda                            1. R                            2.                            3.                        ...
Agenda                            1. R                            2.                            3.                        ...
Sub topics                            1.                            2.                            3.Saturday, November 26,...
Saturday, November 26, 11   71
Saturday, November 26, 11   72
...           •           •           •                TOEICSaturday, November 26, 11           73
...                            A   180     75                            B   170     65                            C   165...
RSaturday, November 26, 11   75
Saturday, November 26, 11   76
1   2   3                            4   5   6                            7   8   9Saturday, November 26, 11              ...
Saturday, November 26, 11   78
1   2   3                            4   5   6                            7   8   9Saturday, November 26, 11              ...
1   2   3                            4   5   6                            7   8   9Saturday, November 26, 11              ...
1   2   3                            4   5   6                            7   8   9Saturday, November 26, 11              ...
Saturday, November 26, 11   82
1   2   3                            4   5   6                            7   8   9Saturday, November 26, 11              ...
1   2   3                            4   5   6                            7   8   9Saturday, November 26, 11              ...
1   2   3                            4   5   6                            7   8   9Saturday, November 26, 11              ...
Saturday, November 26, 11   86
matrix()Saturday, November 26, 11   87
matrix()           •           • matrix(            ,      ,   )           •Saturday, November 26, 11                     ...
A   180   75                            B   170   65                            C   165   60                            D ...
karada <- matrix(c(180, 170, 165,          175, 190, 75, 65, 60, 70, 80), 5, 2)            1. c()            2. matrix()  ...
> karadaSaturday, November 26, 11              91
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.Saturday, November 26, 11   94
demo <- matrix(1:30,nrow=5,ncol=6)       http://gyazo.com/76c58d5d6c8426a44f160897cda99671.pngSaturday, November 26, 11   ...
2            → demo[2,]                            2            → demo[,2]              http://gyazo.com/6726084afd9e1cc4b...
2       4                                → demo[c(2,4),]                            2       4                             ...
http://gyazo.com/a116c0e2f1284ea7d38bf7024d92f1cc.pngSaturday, November 26, 11                                            98
•             •             •Saturday, November 26, 11   99
Sub topics                            1.                            2.                            3.Saturday, November 26,...
•                  •                  •Saturday, November 26, 11   101
B   175   65                            B   177   70                            B   174   75                            A ...
• Excel   WS                    •                    •Saturday, November 26, 11          103
...             • data.frame()   (p.240)             •                (p.243)             •                     (p.243)Sat...
...Saturday, November 26, 11         105
“173.365 - Come on, feel the noise” by Je the Trojan                               http://www. ickr.com/photos/trojanguy/3...
Saturday, November 26, 11   107
Sub topics                            1.                            2.                            3.Saturday, November 26,...
Saturday, November 26, 11   109
...               • Excel               •                     →Saturday, November 26, 11         110
•                 ...                            •                            •Saturday, November 26, 11             111
• Windows            →                 •       “MyDocuments”              • Mac OS X           →              • Linux up t...
•                            • getwd()                               • > getwd()                            • setwd()     ...
• read.csv()               • CSV               • CSV: Comma Separated ValueSaturday, November 26, 11                     114
1. demo.csv                       • XLS/XLSX                       • CSV               UTF-8           2. > test <- read.c...
CSV                                  ...Saturday, November 26, 11               116
• read.delim()               •               • delim: delimiterSaturday, November 26, 11           117
1. demo.xls        2. > test2 <- read.delim("clipboard")                            Mac   : read.delim(pipe(“pbpaste”))   ...
> table(test2[,1])                            •          1                  > mean(test2[,2])                            •...
•         • CSV                   read.csv()         •                  orSaturday, November 26, 11                     120
CSV                            Excel                                    “y2.d175 | Lasershow! Relax!” by B Rosen          ...
Excel                            SPSSSaturday, November 26, 11           122
Agenda                            1. R                            2.                            3.                        ...
Agenda                            1. R                            2.                            3.                        ...
Saturday, November 26, 11   125
Saturday, November 26, 11   126
1.                   2.Saturday, November 26, 11   127
2                            Excel       SPSS                                        ... orzSaturday, November 26, 11     ...
Saturday, November 26, 11   129
> age <- c(18, 23, 14, 19,                   21, 29, 22, 21, 23, 19, 20, 20,                   26, 18, 14, 6, 8, 16, 23, 2...
Saturday, November 26, 11   131
> score <- c(60, 50, 72, 43, 50,                55, 43, 50, 85, 40)                > words <- c(340, 190, 465, 170,       ...
Saturday, November 26, 11   133
> high <- c(350, 285, 315, 340,            210, 185, 120, 740, 425, 155)            > coll <- c(365, 570, 645, 540, 645,  ...
1.                   2.                   3.                            twitter, FBSaturday, November 26, 11              ...
Excel                            “y2.d175 | Lasershow! Relax!” by B Rosen                            http://www.flickr.com/...
Agenda                            1. R                            2.                            3.                        ...
Agenda                            1. R                            2.                            3.                        ...
Saturday, November 26, 11   139
tSaturday, November 26, 11       140
tSaturday, November 26, 11       141
t, χ2, FSaturday, November 26, 11              142
t                            t.test()Saturday, November 26, 11              143
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...
t     > t.test(like,dislike,var.equal=TRUE)             Two Sample t-test     data: like and dislike     t = 3.3041, df = ...
t              ...        “         t                      Welch            t                 Welch              t        ...
Welch !Saturday, November 26, 11             147
!                     !              ―                                                           Welch                    ...
...     > t.test(like,dislike,var.equal=FALSE)             Welch Two Sample t-test     data: like and dislike     t = 3.30...
t                         t                                           ...     •t                         t                ...
tSaturday, November 26, 11       151
Saturday, November 26, 11   152
•                •                •           A   B          •Saturday, November 26, 11           153
:         “        ”                                                              “however”                               ...
> freq <- c(109,347,8)    > chisq.test(freq,correct=FALSE)            Chi-squared test for given probabilities        data...
tSaturday, November 26, 11       156
Saturday, November 26, 11   157
•3                 •t           • ANOVA          ANalysis Of VAriance           •F                     FSaturday, November...
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...
Saturday, November 26, 11   161
Saturday, November 26, 11   162
One more thing...Saturday, November 26, 11                 163
Hi                       oshima.Saturday, November 26, 11             164
HiRoshima.R     •                                      R                 • 2-3     •                 •                    ...
HiRoshima.R     •                               ...     •                      R           • Tsukuba.R / Tokyo.R / Osaka.R...
HiRoshima.R         •R           • HiRoshima.R           •                       !!Saturday, November 26, 11              ...
1            22                            14%                                   23%                            64%Saturda...
HiRoshima.R     •                       →Lightning Talks          •          •Saturday, November 26, 11                   ...
HiRoshima.R             •                        •   R   R                        •             •                        •...
HiRoshima.R           •                +   Speaker   !!                      •                      •                     ...
HiRoshima.R                  •                            •   1                            •   2   #1                     ...
•Speaker                       •                       • Lightning Talks                          •        R            OK...
•Feedback                            • blog / twitter                                • #HiRoshimaR   @sakaue              ...
Saturday, November 26, 11   178
Saturday, November 26, 11   179
Saturday, November 26, 11   180
2,940       1,785   3,780Saturday, November 26, 11                   181
Excel                            SPSSSaturday, November 26, 11           182
twitter: @sakaue                            e-mail: tsakaue<AT>hiroshima-u.ac.jpSaturday, November 26, 11                 ...
Upcoming SlideShare
Loading in...5
×

Japan.R #2 Introduction to R

5,477

Published on

Published in: Education, Technology

Transcript of "Japan.R #2 Introduction to R"

  1. 1. Japan.R #2 @ 2011-11-26Saturday, November 26, 11 2
  2. 2. 0.Saturday, November 26, 11 3
  3. 3. (SAKAUE, Tatsuya) • : ... • Nagoya.R / HiRoshima.R • ID: sakaue • ...Saturday, November 26, 11 5
  4. 4. Saturday, November 26, 11 6
  5. 5. Agenda 1. R 2. 3. 4. 5. RSaturday, November 26, 11 8
  6. 6. Agenda 1. R 2. 3. 4. 5. RSaturday, November 26, 11 9
  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 •Saturday, November 26, 11 10
  8. 8. Saturday, November 26, 11 11
  9. 9. • IBM SPSS Statistics 10 ... • •Saturday, November 26, 11 12
  10. 10. • • • • •Saturday, November 26, 11 13
  11. 11. UgeeeeeeeeeSaturday, November 26, 11 14
  12. 12. Excel SPSS ... • • • Excel •Saturday, November 26, 11 15
  13. 13. Excel SPSSSaturday, November 26, 11 16
  14. 14. -Install / Update / Uninstall-Saturday, November 26, 11 17
  15. 15. 1. http://www.r-project.org/ 2. “download R” 3. JAPAN 4. OSSaturday, November 26, 11 18
  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)Saturday, November 26, 11 19
  17. 17. Saturday, November 26, 11 20
  18. 18. Saturday, November 26, 11 21
  19. 19. Saturday, November 26, 11 22
  20. 20. Saturday, November 26, 11 23
  21. 21. Saturday, November 26, 11 24
  22. 22. Saturday, November 26, 11 25
  23. 23. 1. http://www.r-project.org/ 2. 3.Saturday, November 26, 11 26
  24. 24. • • • Windows •Saturday, November 26, 11 27
  25. 25. • Windows • [ Windows XP] → • [ Windows 7 ] → • Mac OS X • /Applications /Library Frameworks R. framework CleanAppSaturday, November 26, 11 28
  26. 26. • Windows • START → Program → R → R 2.14.0 • Mac OS X • /Applications R RSaturday, November 26, 11 29
  27. 27. • Windows Mac OS X 1. q() 2. 3. RSaturday, November 26, 11 30
  28. 28. • OK • Win • [ ]→[GUI ] • Font [MS Mincho]Saturday, November 26, 11 31
  29. 29. ... • 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/)Saturday, November 26, 11 32
  30. 30. • • • help(sth) !!Saturday, November 26, 11 33
  31. 31. Excel SPSSSaturday, November 26, 11 34
  32. 32. Agenda 1. R 2. 3. 4. 5. RSaturday, November 26, 11 35
  33. 33. Agenda 1. R 2. 3. 4. 5. RSaturday, November 26, 11 36
  34. 34. Saturday, November 26, 11 37
  35. 35. • [Enter] • > 3+5 [Enter] • > 10-3 [Enter] • > 2*3 [Enter] • > 100/20 [Enter] • > (12 + 34 -56) * 78 / 90 [Enter]Saturday, November 26, 11 38
  36. 36. • • > 100^1/2 • > 100^(1/2)Saturday, November 26, 11 39
  37. 37. Saturday, November 26, 11 40
  38. 38. Saturday, November 26, 11 41
  39. 39. Saturday, November 26, 11 42
  40. 40. “I dont know !” by fmgbain http://www.flickr.com/photos/fmgbain/4382010455/Saturday, November 26, 11 43
  41. 41. Saturday, November 26, 11 44
  42. 42. sqrt() • > sqrt(2) • > sqrt(144) • > sqrt(104976) •[ ]2 • 2 3 1 • > 2^(1/3)Saturday, November 26, 11 45
  43. 43. ( ) • •q() help(sth) •Saturday, November 26, 11 46
  44. 44. Saturday, November 26, 11 47
  45. 45. Saturday, November 26, 11 48
  46. 46. Saturday, November 26, 11 49
  47. 47. Saturday, November 26, 11 50
  48. 48. Saturday, November 26, 11 51
  49. 49. “I dont know !” by fmgbain http://www.flickr.com/photos/fmgbain/4382010455/Saturday, November 26, 11 52
  50. 50. Saturday, November 26, 11 53
  51. 51. “hako” • > hako <- c(1,2,3,4,5) • > hako • c() concatenate/combine •Saturday, November 26, 11 54
  52. 52. c() “<-” hako <- c(1,2,3,4,5) “<-” ←Saturday, November 26, 11 55
  53. 53. + ... • [Enter] • [STOP] • [Esc]Saturday, November 26, 11 56
  54. 54. • • TabSaturday, November 26, 11 57
  55. 55. hako 1 5 5Saturday, November 26, 11 58
  56. 56. Saturday, November 26, 11 59
  57. 57. • > sqrt(hako) • > log(hako)Saturday, November 26, 11 60
  58. 58. sqrt(1), sqrt(2) ... sqrt(5) log(1), log (2) ... log (5)Saturday, November 26, 11 61
  59. 59. Saturday, November 26, 11 62
  60. 60. Saturday, November 26, 11 63
  61. 61. • summary() • table() • sum() • length()Saturday, November 26, 11 64
  62. 62. • mean() • max(), min() • median() • sd()Saturday, November 26, 11 65
  63. 63. •R • • q(), help(), sqrt(), log(), c() •Saturday, November 26, 11 66
  64. 64. OKSaturday, November 26, 11 67
  65. 65. Agenda 1. R 2. 3. 4. 5. RSaturday, November 26, 11 68
  66. 66. Agenda 1. R 2. 3. 4. 5. RSaturday, November 26, 11 69
  67. 67. Sub topics 1. 2. 3.Saturday, November 26, 11 70
  68. 68. Saturday, November 26, 11 71
  69. 69. Saturday, November 26, 11 72
  70. 70. ... • • • TOEICSaturday, November 26, 11 73
  71. 71. ... A 180 75 B 170 65 C 165 60 D 175 70 E 190 80Saturday, November 26, 11 74
  72. 72. RSaturday, November 26, 11 75
  73. 73. Saturday, November 26, 11 76
  74. 74. 1 2 3 4 5 6 7 8 9Saturday, November 26, 11 77
  75. 75. Saturday, November 26, 11 78
  76. 76. 1 2 3 4 5 6 7 8 9Saturday, November 26, 11 79
  77. 77. 1 2 3 4 5 6 7 8 9Saturday, November 26, 11 80
  78. 78. 1 2 3 4 5 6 7 8 9Saturday, November 26, 11 81
  79. 79. Saturday, November 26, 11 82
  80. 80. 1 2 3 4 5 6 7 8 9Saturday, November 26, 11 83
  81. 81. 1 2 3 4 5 6 7 8 9Saturday, November 26, 11 84
  82. 82. 1 2 3 4 5 6 7 8 9Saturday, November 26, 11 85
  83. 83. Saturday, November 26, 11 86
  84. 84. matrix()Saturday, November 26, 11 87
  85. 85. matrix() • • matrix( , , ) •Saturday, November 26, 11 88
  86. 86. A 180 75 B 170 65 C 165 60 D 175 70 E 190 80Saturday, November 26, 11 89
  87. 87. karada <- matrix(c(180, 170, 165, 175, 190, 75, 65, 60, 70, 80), 5, 2) 1. c() 2. matrix() • 5 2 3. karadaSaturday, November 26, 11 90
  88. 88. > karadaSaturday, November 26, 11 91
  89. 89. matrix(1:9,nrow=3,ncol=3) 1 4 7 2 5 8 3 6 9Saturday, November 26, 11 92
  90. 90. matrix(1:9,nrow=3,ncol=3,byrow=TRUE) 1 2 3 4 5 6 7 8 9Saturday, November 26, 11 93
  91. 91. 1. 2.Saturday, November 26, 11 94
  92. 92. demo <- matrix(1:30,nrow=5,ncol=6) http://gyazo.com/76c58d5d6c8426a44f160897cda99671.pngSaturday, November 26, 11 95
  93. 93. 2 → demo[2,] 2 → demo[,2] http://gyazo.com/6726084afd9e1cc4b03df85fe6bc0f29.pngSaturday, November 26, 11 96
  94. 94. 2 4 → demo[c(2,4),] 2 4 → demo[, c(2,4)]Saturday, November 26, 11 97
  95. 95. http://gyazo.com/a116c0e2f1284ea7d38bf7024d92f1cc.pngSaturday, November 26, 11 98
  96. 96. • • •Saturday, November 26, 11 99
  97. 97. Sub topics 1. 2. 3.Saturday, November 26, 11 100
  98. 98. • • •Saturday, November 26, 11 101
  99. 99. B 175 65 B 177 70 B 174 75 A 179 70 O 170 60Saturday, November 26, 11 102
  100. 100. • Excel WS • •Saturday, November 26, 11 103
  101. 101. ... • data.frame() (p.240) • (p.243) • (p.243)Saturday, November 26, 11 104
  102. 102. ...Saturday, November 26, 11 105
  103. 103. “173.365 - Come on, feel the noise” by Je the Trojan http://www. ickr.com/photos/trojanguy/3046207115/Saturday, November 26, 11 106
  104. 104. Saturday, November 26, 11 107
  105. 105. Sub topics 1. 2. 3.Saturday, November 26, 11 108
  106. 106. Saturday, November 26, 11 109
  107. 107. ... • Excel • →Saturday, November 26, 11 110
  108. 108. • ... • •Saturday, November 26, 11 111
  109. 109. • Windows → • “MyDocuments” • Mac OS X → • Linux up to you...Saturday, November 26, 11 112
  110. 110. • • getwd() • > getwd() • setwd() • > setwd("/Users/sakaue/Desktop/")Saturday, November 26, 11 113
  111. 111. • read.csv() • CSV • CSV: Comma Separated ValueSaturday, November 26, 11 114
  112. 112. 1. demo.csv • XLS/XLSX • CSV UTF-8 2. > test <- read.csv(“demo.csv”) 3. > test [Enter]Saturday, November 26, 11 115
  113. 113. CSV ...Saturday, November 26, 11 116
  114. 114. • read.delim() • • delim: delimiterSaturday, November 26, 11 117
  115. 115. 1. demo.xls 2. > test2 <- read.delim("clipboard") Mac : read.delim(pipe(“pbpaste”)) 3. > test2 [Enter]Saturday, November 26, 11 118
  116. 116. > table(test2[,1]) • 1 > mean(test2[,2]) • 2 > hist(test2[,2]) • 2Saturday, November 26, 11 119
  117. 117. • • CSV read.csv() • orSaturday, November 26, 11 120
  118. 118. CSV Excel “y2.d175 | Lasershow! Relax!” by B Rosen http://www.flickr.com/photos/rosengrant/4751386872/Saturday, November 26, 11 121
  119. 119. Excel SPSSSaturday, November 26, 11 122
  120. 120. Agenda 1. R 2. 3. 4. 5. RSaturday, November 26, 11 123
  121. 121. Agenda 1. R 2. 3. 4. 5. RSaturday, November 26, 11 124
  122. 122. Saturday, November 26, 11 125
  123. 123. Saturday, November 26, 11 126
  124. 124. 1. 2.Saturday, November 26, 11 127
  125. 125. 2 Excel SPSS ... orzSaturday, November 26, 11 128
  126. 126. Saturday, November 26, 11 129
  127. 127. > age <- c(18, 23, 14, 19, 21, 29, 22, 21, 23, 19, 20, 20, 26, 18, 14, 6, 8, 16, 23, 20) > hist(age)Saturday, November 26, 11 130
  128. 128. Saturday, November 26, 11 131
  129. 129. > 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)Saturday, November 26, 11 132
  130. 130. Saturday, November 26, 11 133
  131. 131. > 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"))Saturday, November 26, 11 134
  132. 132. 1. 2. 3. twitter, FBSaturday, November 26, 11 135
  133. 133. Excel “y2.d175 | Lasershow! Relax!” by B Rosen http://www.flickr.com/photos/rosengrant/4751386872/Saturday, November 26, 11 136
  134. 134. Agenda 1. R 2. 3. 4. 5. RSaturday, November 26, 11 137
  135. 135. Agenda 1. R 2. 3. 4. 5. RSaturday, November 26, 11 138
  136. 136. Saturday, November 26, 11 139
  137. 137. tSaturday, November 26, 11 140
  138. 138. tSaturday, November 26, 11 141
  139. 139. t, χ2, FSaturday, November 26, 11 142
  140. 140. t t.test()Saturday, November 26, 11 143
  141. 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,dislike,var.equal=TRUE)Saturday, November 26, 11 144
  142. 142. 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.0Saturday, November 26, 11 145
  143. 143. t ... “ t Welch t Welch t ” http://aoki2.si.gunma-u.ac.jp/lecture/Average/bunsan1.htmlSaturday, November 26, 11 146
  144. 144. Welch !Saturday, November 26, 11 147
  145. 145. ! ! ― 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.htmlSaturday, November 26, 11 148
  146. 146. ... > 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.0Saturday, November 26, 11 149
  147. 147. t t ... •t t ... • Student t t • s^2 s t ... • %E3%82%B4%E3%82%BB%E3%83%83%E3%83%88 http://ja.wikipedia.org/wiki/%E3%82%A6%E3%82%A3%E3%83%AA%E3%82%A2%E3%83%A0%E3%83%BB • 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.htmlSaturday, November 26, 11 150
  148. 148. tSaturday, November 26, 11 151
  149. 149. Saturday, November 26, 11 152
  150. 150. • • • A B •Saturday, November 26, 11 153
  151. 151. : “ ” “however” 109 347 8 493 [ ] , .... [ ] ..., , .... [ ] ..., .Saturday, November 26, 11 154
  152. 152. > 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.htmSaturday, November 26, 11 155
  153. 153. tSaturday, November 26, 11 156
  154. 154. Saturday, November 26, 11 157
  155. 155. •3 •t • ANOVA ANalysis Of VAriance •F FSaturday, November 26, 11 158
  156. 156. 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 9Saturday, November 26, 11 159
  157. 157. > 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 1Saturday, November 26, 11 160
  158. 158. Saturday, November 26, 11 161
  159. 159. Saturday, November 26, 11 162
  160. 160. One more thing...Saturday, November 26, 11 163
  161. 161. Hi oshima.Saturday, November 26, 11 164
  162. 162. HiRoshima.R • R • 2-3 • • ...Saturday, November 26, 11 165
  163. 163. HiRoshima.R • ... • R • Tsukuba.R / Tokyo.R / Osaka.R / Nagoya.R • Internet (computer) literacy • ...Saturday, November 26, 11 166
  164. 164. HiRoshima.R •R • HiRoshima.R • !!Saturday, November 26, 11 168
  165. 165. 1 22 14% 23% 64%Saturday, November 26, 11 169
  166. 166. HiRoshima.R • →Lightning Talks • •Saturday, November 26, 11 171
  167. 167. HiRoshima.R • • R R • • • •Saturday, November 26, 11 172
  168. 168. HiRoshima.R • + Speaker !! • • • •R •RSaturday, November 26, 11 173
  169. 169. HiRoshima.R • • 1 • 2 #1 • 3 Lightning Talks •Saturday, November 26, 11 174
  170. 170. •Speaker • • Lightning Talks • R OK • 5 OKSaturday, November 26, 11 176
  171. 171. •Feedback • blog / twitter • #HiRoshimaR @sakaue •Saturday, November 26, 11 177
  172. 172. Saturday, November 26, 11 178
  173. 173. Saturday, November 26, 11 179
  174. 174. Saturday, November 26, 11 180
  175. 175. 2,940 1,785 3,780Saturday, November 26, 11 181
  176. 176. Excel SPSSSaturday, November 26, 11 182
  177. 177. twitter: @sakaue e-mail: tsakaue<AT>hiroshima-u.ac.jpSaturday, November 26, 11 183
  1. A particular slide catching your eye?

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

×