nsegs _ emu.query("assim02", "*", "Segment=n") p _ emu.track(nsegs, "epg") cogp _ dsmooth(cog(p)) wlabs _ emu.requery(nsegs, "Segment", "Word", justlabels=T) jsegs _ emu.query("lisa02", "*", "Segment=n") jlabs _ emu.requery(jsegs, "Segment", "Word", justlabels=T) jp _ emu.track(jsegs, "epg") cogj _ dsmooth(cog(jp)) labs _ c(wlabs, jlabs) cogdat _ bind(cogp, cogj) pfun <- function(...){ w _ NULL for(j in list(...)){ w _ c(w, j) } which _muclass(labs, w) dat _ cogdat[which] l _ labs[which] dplotn(dat, l, ylab="Palate COG") } # calculate the average COG across # the section of speech l.av.p _ emu.requery(nsegs, "Segment", "Type", justlabels=T) l.av.j _ emu.requery(jsegs, "Segment", "Type", justlabels=T) normalplot <- function(time=.5) { par(mfrow=c(1,2)) av.p _ dcut(cogp, time, prop=T) av.j _ dcut(cogj, time, prop=T) nplot(av.p, l.av.p, xlab="COG", main="English") nplot(av.j, l.av.j, xlab="COG", main="Japanese") } # paired sample t-test javlab.n _ c( "kingai" , "kingawa", "kingi" , "kingita", "menki" , "minki", "rengita" ,"rengi" ) javlab.N _ c("kiNgai", "kiNgawa", "kiNgi" , "kiNgita" ,"meNki" , "minki", "reNgita", "reNgi" ) auslab.a _ c( "dunton" , "fendon" , "granton" , "grendon" , "handon" , "landon" , "prendon", "punton" , "renton" , "sandon" , "swinton" ) auslab.p _ c( "duncourt" , "fencart" , "grangate" , "grencombe" , "hangate" , "lancart" , "prencan" , "pungreen" , "rengate" , "sancart" , "swincombe") ttest <- function(type="E", time=.5) { av.p _ dcut(cogp, time, prop=T) av.j _ dcut(cogj, time, prop=T) if(type=="E") { which _ muclass(wlabs, auslab.a) A.E _ av.p[which] which _ muclass(wlabs, auslab.p) PLB.E _ av.p[which] t.test(A.E, PLB.E, paired=T) } else if(type=="J") { which _ muclass(jlabs, javlab.n) PLB.J _ av.j[which] which _ muclass(jlabs, javlab.N) LB.J _ av.j[which] t.test(PLB.J, LB.J, paired=T) } }