FALSEだと等分散性を仮定し ない(Welchの方法) > t.test(seiseki[, 2], seiseki[, 3], paired = TRUE, var.equal = FALSE) Paired t-test data: seiseki[, 2] and seiseki[, 3] t = 2.1301, df = 49, p-value = 0.03821 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.1980557 6.8019443 sample estimates: mean of the differences 3.5
rank sum test with continuity correction data: seiseki[, 2] and seiseki[, 3] W = 1369.5, p-value = 0.4118 alternative hypothesis: true location shift is not equal to 0
– 学部・学科・クラス別 – 担当教員別 etc. 63 student class prof sex faculty score S001 A P03 M F01 86 S002 A P03 F F01 96 S003 A P03 M F01 52 S004 A P03 F F01 72 S005 A P03 F F01 74 … … … … … …
read.csv(file.choose(), header = TRUE) > # 読み込んだデータの最初の3行の確認 > head(seiseki.2, 3) student class prof sex faculty score 1 S001 A P03 M F01 86 2 S002 A P03 F F01 96 3 S003 A P03 M F01 52 > > # 行数と列数の確認 > dim(seiseki.2) [1] 790 6 > # クラス別の学生数 > table(seiseki.2[, 2]) A B C D E F G H I J K L M N O P Q R S 29 28 27 34 34 36 38 46 44 46 53 54 46 46 46 47 46 44 46 > # 担当教員別の学生数 > table(seiseki.2[, 3]) P01 P02 P03 P04 P05 P06 P07 P08 P09 89 80 165 112 80 71 46 101 46
A, y = B)) > p + geom_point() + stat_smooth(method = "lm") > # 散布図と回帰直線(信頼区間の描画なし) > p <- ggplot(seiseki, aes(x = A, y = B)) > p + geom_point() + stat_smooth(method = "lm", se = FALSE) 20 40 60 80 20 40 60 80 A B 20 40 60 80 20 40 60 80 A B