下面的数据显示了元音持续时间 (vdur) 如何随最终辅音 (finalC) 变化。共有 15 名参与者两次制作了一个项目。使用ddply
函数,我得到了每个项目的元音持续时间的按主题方式。
vdur = read.delim("Ldurations.txt")
Lvdur = vdur[vdur$environment == "A",]
bySubjmean <- ddply(Lvdur, c("task", "environment", "subject", "item", "finalC", "neutralizedC"), summarize, "bySubj" = mean(vdur), "SD"=sd(vdur))
> bySubjmean
task environment subject item finalC neutralizedC bySubj SD
1 A A T01 ip p p 90.00 5.37401154
2 A A T01 iph ph p 66.05 9.26309883
3 A A T01 kap p p 73.80 0.98994949
4 A A T01 kaph ph p 48.10 15.98061325
5 A A T01 keot t t 79.85 1.20208153
6 A A T01 keoth th t 50.65 6.43467171
7 A A T01 mit t t 87.45 5.44472222
8 A A T01 mith th t 69.55 0.91923882
9 A A T01 muk k k 60.25 0.21213203
10 A A T01 mukk kk k 42.65 6.01040764
11 A A T01 nak k k 122.10 4.80832611
12 A A T01 nakk kk k 66.00 0.98994949
我想计算finalC“p”和“ph”(以及“t”和“th”以及“k”和“kk”之间)的平均vdur差异的标准误差。
尽管我可以使用 ddply() 轻松计算 p 和 ph (68.42250 - 50.04083 =18.42...) 及其 SE 之间的平均差,但我无法弄清楚如何使用 R 代码计算该平均差的 SE。
> grandmean <- ddply(bySubjmean, c("task", "environment", "finalC", "neutralizedC"),
summarize, "grandMean" = mean(bySubj),"SE"=sd(bySubj)/sqrt(length(bySubj)))
> grandmean
task environment finalC neutralizedC grandMean SE
1 A A k k 84.34133 2.844009
2 A A kk k 56.51800 1.979809
3 A A p p 68.42250 2.751806
4 A A ph p 50.04083 2.208335
5 A A t t 72.06778 1.975539
6 A A th t 53.19889 1.819296