×
[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。
吉田寿夫・森 敏昭 (1990). 心理学のためのデータ解析テクニカルブック 北大路書房
# 1要因対応のなし。p. 87
dat <- data.frame(
a = factor(rep(c("a1","a2","a3","a4"),each=8)),
result = c(9,7,8,8,12,11,8,13, 6,5,6,3,6,7,10,9, 10,13,8,13,12,14,14,16, 9,11,13,14,16,12,15,14)
)
dat
# 1要因対応のあり。p. 92
dat <- data.frame(
a1=c(9,7,8,8,12,11,8,13),
a2=c(6,5,6,3,6,7,10,9),
a3=c(10,13,8,13,12,14,14,16),
a4=c(9,11,13,14,16,12,15,14)
)
dat
# 2要因参加者間。p95
dat <- data.frame(
a=factor(rep(c("a1", "a2"), each=20)),
b=factor(rep(c("b1","b2", "b3","b4"), each=5, time=2)),
result = c(3,3,1,3,5, 4,3,4,5,7, 6,6,6,4,8, 5,7,8,7,9, 3,5,2,4,6, 2,6,3,6,4, 3,2,3,6,5, 2,3,3,4,6))
dat
# 2要因混合p. 107
dat <- data.frame(
a=factor(rep(c("a1", "a2"), each=5)),
b1=c(3, 3, 1, 3, 5, 3, 5, 2, 4, 6),
b2=c(4, 3, 4, 5, 7, 2, 6, 3, 6, 4),
b3=c(6, 6, 6, 4, 8, 3, 2, 3, 6, 5),
b4=c(5, 7, 8, 7, 9, 2, 3, 3, 4, 6)
)
dat
# 2要因対応あり。p117
dat <- data.frame(
a1b1=c(3, 3, 1, 3, 5),
a1b2=c(4, 3, 4, 5, 7),
a1b3=c(6, 6, 6, 4, 8),
a1b4=c(5, 7, 8, 7, 9),
a2b1=c(3, 5, 2, 4, 6),
a2b2=c(2, 6, 3, 6, 4),
a2b3=c(3, 2, 3, 6, 5),
a2b4=c(2, 3, 3, 4, 6)
)
dat
# 3要因対応なし p121
dat <- data.frame(
a = rep(c("a1", "a2"), each=24),
b = rep(c("b1", "b2", "b1", "b2"), each=12),
c = rep(c("c1", "c2", "c3", "c1", "c2", "c3","c1", "c2", "c3", "c1", "c2", "c3"), each=4),
val = c(2,6,5,7, 5,7,9,9, 9,10,13,14, 6,6,8,10, 3,6,5,8, 6,7,5,6,
1,2,5,2, 2,1,4,5, 1, 5, 3, 5, 5,3,4, 6, 5,6,6,7, 5,5,9,7)
)
dat
# 3要因混合 (1要因対応あり) p137
dat <- data.frame(
a = rep(c("a1", "a2"), each=8),
b = rep(c("b1", "b2", "b1", "b2"), each=4),
c1 = c(2,6,5,7,6,6,8,10,1,2,5,2,5,3,4,6),
c2 = c(5,7,9,9,3,6,5,8,2,1,4,5,5,6,6,7),
c3 = c(9,10,13,14,6,7,5,6,1,5,3,5,5,5,9,7)
)
# 3要因混合 (2要因対応あり) 。p144
dat <- data.frame(
a=factor(c(rep("a1", 4), rep("a2", 4))),
b1c1=c(2,6,5,7,1,2,5,2), b1c2=c(5,7,9,9,2,1,4,5), b1c3=c(9,10,13,14,1,5,3,5),
b2c1=c(6,6,8,10,5,3,4,6), b2c2=c(3,6,5,8,5,6,6,7), b2c3=c(6,7,5,6,5,5,9,7)
)
dat
# 3要因被験者内 p152
dat <- data.frame(
a1b1c1 = c(2,6,5,7),
a1b1c2 = c(5,7,9,9),
a1b1c3 = c(9,10,13,14),
a1b2c1 = c(6,6,8,10),
a1b2c2 = c(3,6,5,8),
a1b2c3 = c(6,7,5,6),
a2b1c1 = c(1,2,5,2),
a2b1c2 = c(2,1,4,5),
a2b1c3 = c(1,5,3,5),
a2b2c1 = c(5,3,4,6),
a2b2c2 = c(5,6,6,7),
a2b2c2 = c(5,5,9,7)
)
##南風原朝和 (2002). 心理統計学の基礎――統合的理解のために―― 有斐閣
## p. 9 表1-1、逸脱行動と変化量データ。
sex <- factor(rep(c("male", "female"), each=20))
sixth <- c(4,9,14,16,15,14,7,13,18,20,12,6,10,16,12,16,13,12,12,15,3,9,4,8,8,5,5,7,12,11,8,11,13,10,15,10,12,10,8,9)
eighth <- c(8,12,11,20,16,18,7,19,20,14,14,12,16,14,13,17,19,10,19,14,12,9,10,13,13,10,7,18,17,14,12,18,17,20,13,16,13,12,12,13)
cng <- c(4,3,-3,4,1,4,0,6,2,-6,2,6,6,-2,1,1,6,-2,7,-1,9,0,6,5,5,5,2,11,5,3,4,7,4,10,-2,6,1,2,4,4)
dat <- data.frame(sex, sixth, eighth, cng)
dat
# p226 。表8-1。50組の母子の協調性データ。
x1 <- c(12,12,7,17,14,9,10,13,15,12,12,15,11,14,17,17,16,15,15,10,12,9,12,12,19,11,14,15,15,15,16,15,12,10,11,12,15,13,15,12,12,12,13,17,13,11,14,16,12,12) # 母親価値
x2 <- c(2,2,2,3,2,2,3,3,3,1,3,3,2,2,4,2,4,3,4,2,2,1,2,2,4,2,3,2,3,3,2,3,2,2,3,1,2,3,2,2,2,3,3,3,2,3,2,4,2,2) # 通園年数
y <- c(6,11,11,13,13,10,10,15,11,11,16,14,10,13,12,15,16,14,14,8,13,12,12,11,16,9,12,13,13,14,12,15,8,12,11,6,12,15,9,13,9,11,14,12,13,9,11,14,16,8) # 協調性
dat <- data.frame(x1,x2, y)
dat
# p271 表9-1、ねたみ感情の測定データ
dat <- data.frame(
dmn = factor(rep(c("app", "acd", "aff"), each=15)),
att = factor(rep(rep(c("fr", "mid","hst"), each=5), 3)),
envy = c(2,4,3,2,1,7,4,6,5,8,4,3,2,5,2,2,2,1,2,2,3,4,2,1,2,1,3,3,2,1,3,1,1,0,1,4,7,5,6,4,3,2,1,2,1)
)
dat
# 表9-6 ブロック別の妬み感情データ
blc <- factor(1:15)
app <- c(1,2,2,2,2,3,3,4,4,4,5,5,6,7,8)
acd <- c(1,1,1,1,2,2,2,2,2,2,2,3,3,3,4)
aff <- c(0,1,1,1,1,1,2,2,3,3,4,4,5,6,7)
dat <- data.frame(blc,app,acd,aff)
# 縦長
blc <- rep(blc, 3)
fct <- factor(rep(c("app", "acd", "aff"),each=15))
val <- c(app, acd, aff)
dat <- data.frame(blc, fct, val)
# p312. 表9-8、共分散分析のためのデータ
dmn <- factor(rep(c("app", "acd", "aff"), each=15)) # 優越属性
cv <- c(4,9,6,2,1,14,10,13,11,15,8,7,3,12,5,6,10,2,8,5,13,15,9,4,7,1,12,14,11,3,9,4,2,1,6,12,15,13,14,11,10,7,5,8,3) # 共変量
envy <- c(2,4,3,2,1,7,4,6,5,8,4,3,2,5,2,2,2,1,2,2,3,4,2,1,2,1,3,3,2,1,3,1,1,0,1,4,7,5,6,4,3,2,1,2,1) # ねたみ感情
dat <- data.frame(dmn, cv, envy)
## http://www.psychology.emory.edu/clinical/mcdowell/PSYCH560/factorw.htm
dat <- data.frame(
ps=paste("p", 1:27, sep=""),
trt=gl(3, 9, labels=c("a1", "a2", "a3")), # "notreat", "spaced", "massed"
grp=rep(gl(3, 3, labels=c("b1", "b2", "b3")),3), #"washers", "checkers", "seekers"
value=c(5,4,5,4,5,3,3,5,4,5,6,3,4,6,3,12,10,13,10,12,16,11,10,12,13,12,10)
)
dat
# p318 相関行列
mat <- matrix(c(
1.000,0.033,0.315,0.456,0.266,0.607,0.228,0.419,
0.033,1.000,0.637,0.250,0.528,0.195,0.522,0.420,
0.315,0.637,1.000,0.333,0.880,0.237,0.750,0.328,
0.456,0.250,0.333,1.000,0.362,0.432,0.398,0.449,
0.266,0.528,0.880,0.362,1.000,0.252,0.738,0.269,
0.607,0.195,0.237,0.432,0.252,1.000,0.335,0.463,
0.228,0.522,0.750,0.398,0.738,0.335,1.000,0.238,
0.419,0.420,0.328,0.449,0.269,0.463,0.238,1.000),
nrow=8, dimnames=list(c("onw", "yok", "gai", "sin", "sha", "kyo", "sek", "sun"), c("onw", "yok", "gai", "sin", "sha", "kyo", "sek", "sun"))
)
# 表10-8 観測変数間の相関係数 p354
mat <- matrix(c(
1.000,0.160,0.302,0.461,0.299,0.152,0.134,0.182,0.251,0.372,0.157,0.203,
0.160,1.000,0.341,0.400,0.404,0.320,0.403,0.374,0.285,0.100,0.291,-0.014,
0.302,0.341,1.000,0.372,0.552,0.476,0.467,0.572,0.316,0.408,0.393,0.369,
0.461,0.400,0.372,1.000,0.302,0.225,0.256,0.255,0.164,0.236,0.229,0.224,
0.299,0.404,0.552,0.302,1.000,0.708,0.623,0.776,0.361,0.294,0.472,0.342,
0.152,0.320,0.476,0.225,0.708,1.000,0.324,0.769,0.295,0.206,0.351,0.202,
0.134,0.403,0.467,0.256,0.623,0.324,1.000,0.724,0.260,0.071,0.204,0.152,
0.182,0.374,0.572,0.255,0.776,0.769,0.724,1.000,0.284,0.142,0.320,0.189,
0.251,0.285,0.316,0.164,0.361,0.295,0.260,0.284,1.000,0.295,0.290,0.418,
0.372,0.100,0.408,0.236,0.294,0.206,0.071,0.142,0.295,1.000,0.468,0.351,
0.157,0.291,0.393,0.229,0.472,0.351,0.204,0.320,0.290,0.468,1.000,0.385,
0.203,-0.014,0.369,0.224,0.342,0.202,0.152,0.189,0.418,0.351,0.385,1.000),
nr=12,
dimnames = list(paste("y", 1:12, sep=""), paste("y", 1:12, sep=""))
)
mat
## 媒介分析。http://davidakenny.net/dtt/mediate.htm
library(foreign)
dat <- data.frame(read.spss("http://davidakenny.net/dtt/morse_et_al.sav"))
dat
## 信頼区間グラフ
## Masson, M. E. J., & Loftus, G. R. (2003). Using confidence intervals for graphically based data interpretation. Canadian Journal of Experimental Psychology, 57, 203-220.
# http://web.uvic.ca/psyc/masson/ML.pdf
dat <- data.frame(
incong=c(784,853,622,954,634,751,918,894),
cong=c(632,702,598,873,600,729,877,801),
neutral=c(651,689,606,855,595,740,893,822))
dat
# 1要因対応のなし。p. 87
dat <- data.frame(
a = factor(rep(c("a1","a2","a3","a4"),each=8)),
result = c(9,7,8,8,12,11,8,13, 6,5,6,3,6,7,10,9, 10,13,8,13,12,14,14,16, 9,11,13,14,16,12,15,14)
)
dat
# 1要因対応のあり。p. 92
dat <- data.frame(
a1=c(9,7,8,8,12,11,8,13),
a2=c(6,5,6,3,6,7,10,9),
a3=c(10,13,8,13,12,14,14,16),
a4=c(9,11,13,14,16,12,15,14)
)
dat
# 2要因参加者間。p95
dat <- data.frame(
a=factor(rep(c("a1", "a2"), each=20)),
b=factor(rep(c("b1","b2", "b3","b4"), each=5, time=2)),
result = c(3,3,1,3,5, 4,3,4,5,7, 6,6,6,4,8, 5,7,8,7,9, 3,5,2,4,6, 2,6,3,6,4, 3,2,3,6,5, 2,3,3,4,6))
dat
# 2要因混合p. 107
dat <- data.frame(
a=factor(rep(c("a1", "a2"), each=5)),
b1=c(3, 3, 1, 3, 5, 3, 5, 2, 4, 6),
b2=c(4, 3, 4, 5, 7, 2, 6, 3, 6, 4),
b3=c(6, 6, 6, 4, 8, 3, 2, 3, 6, 5),
b4=c(5, 7, 8, 7, 9, 2, 3, 3, 4, 6)
)
dat
# 2要因対応あり。p117
dat <- data.frame(
a1b1=c(3, 3, 1, 3, 5),
a1b2=c(4, 3, 4, 5, 7),
a1b3=c(6, 6, 6, 4, 8),
a1b4=c(5, 7, 8, 7, 9),
a2b1=c(3, 5, 2, 4, 6),
a2b2=c(2, 6, 3, 6, 4),
a2b3=c(3, 2, 3, 6, 5),
a2b4=c(2, 3, 3, 4, 6)
)
dat
# 3要因対応なし p121
dat <- data.frame(
a = rep(c("a1", "a2"), each=24),
b = rep(c("b1", "b2", "b1", "b2"), each=12),
c = rep(c("c1", "c2", "c3", "c1", "c2", "c3","c1", "c2", "c3", "c1", "c2", "c3"), each=4),
val = c(2,6,5,7, 5,7,9,9, 9,10,13,14, 6,6,8,10, 3,6,5,8, 6,7,5,6,
1,2,5,2, 2,1,4,5, 1, 5, 3, 5, 5,3,4, 6, 5,6,6,7, 5,5,9,7)
)
dat
# 3要因混合 (1要因対応あり) p137
dat <- data.frame(
a = rep(c("a1", "a2"), each=8),
b = rep(c("b1", "b2", "b1", "b2"), each=4),
c1 = c(2,6,5,7,6,6,8,10,1,2,5,2,5,3,4,6),
c2 = c(5,7,9,9,3,6,5,8,2,1,4,5,5,6,6,7),
c3 = c(9,10,13,14,6,7,5,6,1,5,3,5,5,5,9,7)
)
# 3要因混合 (2要因対応あり) 。p144
dat <- data.frame(
a=factor(c(rep("a1", 4), rep("a2", 4))),
b1c1=c(2,6,5,7,1,2,5,2), b1c2=c(5,7,9,9,2,1,4,5), b1c3=c(9,10,13,14,1,5,3,5),
b2c1=c(6,6,8,10,5,3,4,6), b2c2=c(3,6,5,8,5,6,6,7), b2c3=c(6,7,5,6,5,5,9,7)
)
dat
# 3要因被験者内 p152
dat <- data.frame(
a1b1c1 = c(2,6,5,7),
a1b1c2 = c(5,7,9,9),
a1b1c3 = c(9,10,13,14),
a1b2c1 = c(6,6,8,10),
a1b2c2 = c(3,6,5,8),
a1b2c3 = c(6,7,5,6),
a2b1c1 = c(1,2,5,2),
a2b1c2 = c(2,1,4,5),
a2b1c3 = c(1,5,3,5),
a2b2c1 = c(5,3,4,6),
a2b2c2 = c(5,6,6,7),
a2b2c2 = c(5,5,9,7)
)
##南風原朝和 (2002). 心理統計学の基礎――統合的理解のために―― 有斐閣
## p. 9 表1-1、逸脱行動と変化量データ。
sex <- factor(rep(c("male", "female"), each=20))
sixth <- c(4,9,14,16,15,14,7,13,18,20,12,6,10,16,12,16,13,12,12,15,3,9,4,8,8,5,5,7,12,11,8,11,13,10,15,10,12,10,8,9)
eighth <- c(8,12,11,20,16,18,7,19,20,14,14,12,16,14,13,17,19,10,19,14,12,9,10,13,13,10,7,18,17,14,12,18,17,20,13,16,13,12,12,13)
cng <- c(4,3,-3,4,1,4,0,6,2,-6,2,6,6,-2,1,1,6,-2,7,-1,9,0,6,5,5,5,2,11,5,3,4,7,4,10,-2,6,1,2,4,4)
dat <- data.frame(sex, sixth, eighth, cng)
dat
# p226 。表8-1。50組の母子の協調性データ。
x1 <- c(12,12,7,17,14,9,10,13,15,12,12,15,11,14,17,17,16,15,15,10,12,9,12,12,19,11,14,15,15,15,16,15,12,10,11,12,15,13,15,12,12,12,13,17,13,11,14,16,12,12) # 母親価値
x2 <- c(2,2,2,3,2,2,3,3,3,1,3,3,2,2,4,2,4,3,4,2,2,1,2,2,4,2,3,2,3,3,2,3,2,2,3,1,2,3,2,2,2,3,3,3,2,3,2,4,2,2) # 通園年数
y <- c(6,11,11,13,13,10,10,15,11,11,16,14,10,13,12,15,16,14,14,8,13,12,12,11,16,9,12,13,13,14,12,15,8,12,11,6,12,15,9,13,9,11,14,12,13,9,11,14,16,8) # 協調性
dat <- data.frame(x1,x2, y)
dat
# p271 表9-1、ねたみ感情の測定データ
dat <- data.frame(
dmn = factor(rep(c("app", "acd", "aff"), each=15)),
att = factor(rep(rep(c("fr", "mid","hst"), each=5), 3)),
envy = c(2,4,3,2,1,7,4,6,5,8,4,3,2,5,2,2,2,1,2,2,3,4,2,1,2,1,3,3,2,1,3,1,1,0,1,4,7,5,6,4,3,2,1,2,1)
)
dat
# 表9-6 ブロック別の妬み感情データ
blc <- factor(1:15)
app <- c(1,2,2,2,2,3,3,4,4,4,5,5,6,7,8)
acd <- c(1,1,1,1,2,2,2,2,2,2,2,3,3,3,4)
aff <- c(0,1,1,1,1,1,2,2,3,3,4,4,5,6,7)
dat <- data.frame(blc,app,acd,aff)
# 縦長
blc <- rep(blc, 3)
fct <- factor(rep(c("app", "acd", "aff"),each=15))
val <- c(app, acd, aff)
dat <- data.frame(blc, fct, val)
# p312. 表9-8、共分散分析のためのデータ
dmn <- factor(rep(c("app", "acd", "aff"), each=15)) # 優越属性
cv <- c(4,9,6,2,1,14,10,13,11,15,8,7,3,12,5,6,10,2,8,5,13,15,9,4,7,1,12,14,11,3,9,4,2,1,6,12,15,13,14,11,10,7,5,8,3) # 共変量
envy <- c(2,4,3,2,1,7,4,6,5,8,4,3,2,5,2,2,2,1,2,2,3,4,2,1,2,1,3,3,2,1,3,1,1,0,1,4,7,5,6,4,3,2,1,2,1) # ねたみ感情
dat <- data.frame(dmn, cv, envy)
## http://www.psychology.emory.edu/clinical/mcdowell/PSYCH560/factorw.htm
dat <- data.frame(
ps=paste("p", 1:27, sep=""),
trt=gl(3, 9, labels=c("a1", "a2", "a3")), # "notreat", "spaced", "massed"
grp=rep(gl(3, 3, labels=c("b1", "b2", "b3")),3), #"washers", "checkers", "seekers"
value=c(5,4,5,4,5,3,3,5,4,5,6,3,4,6,3,12,10,13,10,12,16,11,10,12,13,12,10)
)
dat
# p318 相関行列
mat <- matrix(c(
1.000,0.033,0.315,0.456,0.266,0.607,0.228,0.419,
0.033,1.000,0.637,0.250,0.528,0.195,0.522,0.420,
0.315,0.637,1.000,0.333,0.880,0.237,0.750,0.328,
0.456,0.250,0.333,1.000,0.362,0.432,0.398,0.449,
0.266,0.528,0.880,0.362,1.000,0.252,0.738,0.269,
0.607,0.195,0.237,0.432,0.252,1.000,0.335,0.463,
0.228,0.522,0.750,0.398,0.738,0.335,1.000,0.238,
0.419,0.420,0.328,0.449,0.269,0.463,0.238,1.000),
nrow=8, dimnames=list(c("onw", "yok", "gai", "sin", "sha", "kyo", "sek", "sun"), c("onw", "yok", "gai", "sin", "sha", "kyo", "sek", "sun"))
)
# 表10-8 観測変数間の相関係数 p354
mat <- matrix(c(
1.000,0.160,0.302,0.461,0.299,0.152,0.134,0.182,0.251,0.372,0.157,0.203,
0.160,1.000,0.341,0.400,0.404,0.320,0.403,0.374,0.285,0.100,0.291,-0.014,
0.302,0.341,1.000,0.372,0.552,0.476,0.467,0.572,0.316,0.408,0.393,0.369,
0.461,0.400,0.372,1.000,0.302,0.225,0.256,0.255,0.164,0.236,0.229,0.224,
0.299,0.404,0.552,0.302,1.000,0.708,0.623,0.776,0.361,0.294,0.472,0.342,
0.152,0.320,0.476,0.225,0.708,1.000,0.324,0.769,0.295,0.206,0.351,0.202,
0.134,0.403,0.467,0.256,0.623,0.324,1.000,0.724,0.260,0.071,0.204,0.152,
0.182,0.374,0.572,0.255,0.776,0.769,0.724,1.000,0.284,0.142,0.320,0.189,
0.251,0.285,0.316,0.164,0.361,0.295,0.260,0.284,1.000,0.295,0.290,0.418,
0.372,0.100,0.408,0.236,0.294,0.206,0.071,0.142,0.295,1.000,0.468,0.351,
0.157,0.291,0.393,0.229,0.472,0.351,0.204,0.320,0.290,0.468,1.000,0.385,
0.203,-0.014,0.369,0.224,0.342,0.202,0.152,0.189,0.418,0.351,0.385,1.000),
nr=12,
dimnames = list(paste("y", 1:12, sep=""), paste("y", 1:12, sep=""))
)
mat
## 媒介分析。http://davidakenny.net/dtt/mediate.htm
library(foreign)
dat <- data.frame(read.spss("http://davidakenny.net/dtt/morse_et_al.sav"))
dat
## 信頼区間グラフ
## Masson, M. E. J., & Loftus, G. R. (2003). Using confidence intervals for graphically based data interpretation. Canadian Journal of Experimental Psychology, 57, 203-220.
# http://web.uvic.ca/psyc/masson/ML.pdf
dat <- data.frame(
incong=c(784,853,622,954,634,751,918,894),
cong=c(632,702,598,873,600,729,877,801),
neutral=c(651,689,606,855,595,740,893,822))
dat
PR
Comment
Trackback
Trackback URL
Comment form