Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- table(a); table(b)
- a
- 1 2 3 4 5
- 12 38 46 73 81
- b
- 1 2 3 4 5
- 20 37 68 73 52
- summary(a); summary(b)
- a: Min. 1st Qu. Median Mean 3rd Qu. Max.
- 1.000 3.000 4.000 3.692 5.000 5.000
- b: Min. 1st Qu. Median Mean 3rd Qu. Max.
- 1.0 3.0 3.5 3.4 4.0 5.0
- t.test(a,b)
- Welch Two Sample t-test
- data: a and b
- t = 2.7127, df = 497.97, p-value = 0.006905
- alternative hypothesis: true difference in means
- is not equal to 0
- 95 percent confidence interval:
- 0.0805107 0.5034893
- sample estimates:
- mean of x mean of y
- 3.692 3.400
- wilcox.test(a,b)$p.val
- [1] 0.004490969
- DTA = rbind(tabulate(a), tabulate(b))
- ab.out = chisq.test(DTA); ab.out
- Pearson's Chi-squared test
- data: DTA
- X-squared = 12.582, df = 4, p-value = 0.01351
- ab.out$obs
- [,1] [,2] [,3] [,4] [,5]
- [1,] 12 38 46 73 81
- [2,] 20 37 68 73 52
- ab.out$exp
- [,1] [,2] [,3] [,4] [,5]
- [1,] 16 37.5 57 73 66.5
- [2,] 16 37.5 57 73 66.5
- ab.out$resi
- [,1] [,2] [,3] [,4] [,5]
- [1,] -1 0.08164966 -1.456986 0 1.778104
- [2,] 1 -0.08164966 1.456986 0 -1.778104
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement