1 + 1 3 - 4 5 * 2 6 / 3 4 ^ 2 sqrt(16) sqrt(4 ^ 2) x <- 1 x + 1 x a a <- 2 * 3 a + 1 # コメントです # 1 + 1 1 + 1 # t検定のテストデータ d <- c(-1, -1, 0, 0, 1, 3, 5, 6, 7, 7) # 期待値の計算 ((-1) + (-1) + 0 + 0 + 1 + 3 + 5 + 6 + 7 + 7) / 10 mean(d) kitaiti <- mean(d) kitaiti # 標準誤差の計算 sd(d) # 標準偏差 length(d) # サンプルサイズ hyoujunGosa <- sd(d) / sqrt(length(d)) hyoujunGosa # t値 tValue <- (kitaiti - 0) / hyoujunGosa tValue # p値 (1-pt(tValue, df=length(d)-1))*2 # t検定 t.test(d)