Rのメモ

### Chapter 1 †

• p.5: Table 1 をカイ２乗検定してみる：
```> TenseAspect <-matrix(c(12,7,19,6,13,19,18,20,38),3,3)
> TenseAspect
[,1] [,2] [,3]
[1,]   12    6   18
[2,]    7   13   20
[3,]   19   19   38
> chisq.test(TenseAspect)

Pearson's Chi-squared test

data:  TenseAspect
X-squared = 3.8, df = 4, p-value = 0.4337```
• p.7: Partial eta-squared とは Effect size の種類の１つ、どのくらい特定の独立変数の従属変数への影響が大きいかを示す
```Partial η2 (Partial eta-squared): Partial eta-squared describes
the "proportion of total variation attributable to the factor,
partialling out (excluding) other factors from the total nonerror variation"
(Pierce, Block & Aguinis, 2004, p. 918). Partial eta squared is often higher than eta squared.```
```Cohen (1992) suggests effect sizes for various indexes, including &#402;
(where 0.1 is a small effect, 0.25 is a medium effect and 0.4 is a large effect).
He also offers a conversion table (see Cohen, 1988, p. 283) for eta squared (η2) where 0.0099
constitutes a small effect, 0.0588 a medium effect and 0.1379 a large effect. Though, considering that
η2 are comparable to r2 when df of the numerator equals 1 (both measures proportion of variance
accounted for), these guidelines may overestimate the size of the effect. If going by the r guidelines
(0.1 is a small effect, 0.3 a medium effect and 0.5 a large effect) then the equivalent guidelines for eta-
squared would be the squareroot of these, i.e. 01 is a small effect, 0.09 a medium effect and 0.25 a
large effect, and these should also be applicable to eta-squared. When the df of the numerator exceeds
1, eta-squared is comparable to R-squared (Levine & Hullett, 2002).```
• p.24: Occam's razor (or Ockham's razor), often expressed in Latin as the lex parsimoniae, translating to law of parsimony, law of economy or law of succinctness, is a principle that generally recommends selecting the competing hypothesis that makes the fewest new assumptions, when the hypotheses are equal in other respects. For instance, they must both sufficiently explain available data in the first place. --Wikipedia
• p.34: the probability p to lose 60 times or moer just by chance is 0.02844397, 2.8%
• 計算は以下のようにしているはず：
```> 1-pbinom(40,100,0.5,lower.tail=FALSE)
[1] 0.02844397```
• p.45: Figure 11 の図に近いものを作る
```> curve(dnorm(x,mean=0,sd=1),from=-4,to=4)
> abline(v=qnorm(0.05, lower.tail=TRUE))
> abline(v=qnorm(0.95, lower.tail=TRUE))```