library(lme4) library(plyr) library(ggplot2) library(MASS) data <- read.csv("SmolekKapatsinski_LabPhon_Data.csv") str(data) data$LabialTraining[data$LabialTraining==0] <- "no" data$LabialTraining[data$LabialTraining==1] <- "yes" data$LabialTraining <- factor(data$LabialTraining) data$TrainedPlace <- factor(data$TrainedPlace, levels=c("labial","alveolar","velar")) data$PluralVowel <- relevel(data$PluralVowel,"i") data$ToBePalatalizedPlace <- relevel(data$ToBePalatalizedPlace,"yes") data$Test <- relevel(data$Test,"production") data$LabialTraining <- relevel(data$LabialTraining,"no") data$TestVoice <- relevel(data$TestVoice,"voiced") data$RatingBinNum <- as.integer(data$RatingBin) xtabs(~RatingBin+RatingBinNum,data) data$RatingBinNum[data$RatingBinNum==1] <- NA data$RatingBinNum[data$RatingBinNum==2] <- 0 data$RatingBinNum[data$RatingBinNum==3] <- 1 data$RatingFact <- factor(data$Rating) data$SingularConsonant <- factor(data$SingularConsonant, levels=c("b","p","d","t","g","k")) str(data) #Rating distribution by TestPlace #### rat.testplace <- xtabs(~TestPlace+Rating,data=data[data$Test=="rating",]) rat.testplace rat3 <- subset(data, Test=="rating" & Rating==3) test.fit <- aov(Rating ~ TestPlace, data=rat3) summary(test.fit) #Rating distribution by TrainedPlace #### rat.trainplace <- xtabs(~TrainedPlace+Rating,data=data[data$Test=="rating",]) rat.trainplace train.fit <- aov(Rating ~ TrainedPlace, data=rat3) summary(train.fit) #Figure 2: Ratings Across TrainedPlace and TestPlace #### #Left panel: TrainedPlace library(beanplot) library(RColorBrewer) #Ratings by TrainedPlace beanplot data$TrainedPlaceLabel <- factor(data$TrainedPlace, levels=c("labial","alveolar","velar"), labels=c("Labial","Alveolar","Velar")) tiff("Fig 2-Left Ratings distribution by training condition.tiff", width=6, height=6, units="in", res=300) par(xpd=F, mai=c(1.25,1.25,1.05,1), cex=1.5) beanplot(Rating ~ TrainedPlaceLabel, data=data[data$Rating %in% c(1:5) & data$Test=="rating",], xlab="Training Condition", ylab="Rating", ll=0, col=list("grey96","grey78","grey40")) box(which="plot") par(xpd=T) legend(0.25,6.1,fill=c("grey96","grey78","grey40"), legend=c("Labial","Alveolar","Velar"), bty="n",horiz=T,xjust=0) dev.off() #Ratings by TestPlace beanplot data$TestPlaceLabel <- factor(data$TestPlace, levels=c("labial","alveolar","velar"), labels=c("Labial","Alveolar","Velar")) #tiff tiff("Fig 2-Right Ratings distribution by test place.tiff", width=6, height=6, units="in", res=300) par(xpd=F, mai=c(1.25,1.25,1.05,1), cex=1.5) beanplot(Rating ~ TestPlaceLabel, data=data[data$Rating %in% c(1:5) & data$Test=="rating",], xlab="Stem-Final Consonant Place", ylab="Rating", ll=0, col=list("grey96","grey78","grey40")) box(which="plot") par(xpd=T) legend(0.25,6.1,fill=c("grey96","grey78","grey40"), legend=c("Labial","Alveolar","Velar"), bty="n",horiz=T,xjust=0) dev.off() ##### Hypothesis 1 ##### # Table 2: Judgments of faithful plurals #### #Helmert mat <- rbind(c(1, -0.5, -0.5), #a vs (b+c)/2 c(0, 1, -1)) #b vs c cMat <- ginv(mat) #labial vs others plus alveolar vs velar rate.LO_full<-glmer(RatingBin ~ TrainedPlace+TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+PluralVowel|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="yes" & data$ToBePalatalizedPlace=="yes" & data$RatingBin %in% c("yes","no"),], family="binomial", contrasts=list(TrainedPlace=cMat), glmerControl(optimizer = "bobyqa")) summary(rate.LO_full) rate.LO_WithoutTrainedPlace<-glmer(RatingBin ~ TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+PluralVowel|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="yes" & data$ToBePalatalizedPlace=="yes" & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) anova(rate.LO_full,rate.LO_WithoutTrainedPlace) #by Rating, rather than RatingBin #labial vs others plus alveolar vs velar rate.LO_full.rat<-lmer(Rating ~ TrainedPlace+TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace+PluralVowel|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="yes" & data$ToBePalatalizedPlace=="yes",], contrasts=list(TrainedPlace=cMat)) summary(rate.LO_full.rat) rate.LO_WithoutTrainedPlace.rat<-lmer(Rating ~ TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace+PluralVowel|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="yes" & data$ToBePalatalizedPlace=="yes",]) anova(rate.LO_full.rat,rate.LO_WithoutTrainedPlace.rat) # Table 3: Ratings of faithful not-to-be-palatalized consonants #### #labial vs others plus alveolar vs velar rate.LO_full2<-glmer(RatingBin ~ TrainedPlace+TestVoice+ (1+TestVoice|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="yes" & data$ToBePalatalizedPlace=="no" & data$RatingBin %in% c("yes","no"),], family="binomial", contrasts=list(TrainedPlace=cMat), glmerControl(optimizer = "bobyqa")) summary(rate.LO_full2) rate.LO_WithoutTrainedPlace2<-glmer(RatingBin ~ TestVoice+ (1+TestVoice|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="yes" & data$ToBePalatalizedPlace=="no" & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) anova(rate.LO_full2,rate.LO_WithoutTrainedPlace2) #by Rating, not RatingBin #labial vs others plus alveolar vs velar rate.LO_full2.rat<-lmer(Rating ~ TrainedPlace+TestVoice+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="yes" & data$ToBePalatalizedPlace=="no",], contrasts=list(TrainedPlace=cMat)) summary(rate.LO_full2.rat) rate.LO_WithoutTrainedPlace2.rat<-lmer(Rating ~ TestVoice+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="yes" & data$ToBePalatalizedPlace=="no",]) anova(rate.LO_full2.rat,rate.LO_WithoutTrainedPlace2.rat) #Figure 3: Ratings of faithful plurals #### #Left panel: To-be-palatalized plurals #### #By RatingBin data$SingularConsonant <- factor(data$SingularConsonant, levels=c("b","p","d","t","g","k")) data$TrainedPlace <- factor(data$TrainedPlace, levels=c("labial","alveolar","velar")) ratnochpalsummednov <- ddply(subset(data, Test=="rating" & ToBePalatalizedPlace=="yes" & KeepPlace=="yes" & RatingBin %in% c("yes","no")), .(SingularConsonant, TrainedPlace, TestPlace), summarise, prop=sum(RatingBinNum)/length(RatingBinNum), low=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[1], upper=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[2]) ratnochpalsummednov #for ratings of no-change forms that should be palatalized alvvellab <- ggplot(ratnochpalsummednov, aes(SingularConsonant, y=prop, ymin=low, ymax=upper, fill=TrainedPlace))+ geom_bar(stat="identity", color="black")+ geom_errorbar(width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(palette="Greys", breaks=c("labial","alveolar","velar"), labels=c("Labial","Alveolar","Velar"))+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Training Condition") alvvellab ggsave("Fig 3-Left Acceptance of incorrect faithful plurals.tiff", alvvellab, height=8, width=7) #Right panel: Not-to-be-palatalized plurals, before -i #### #By RatingBin ratnochnopalsummedv <- ddply(subset(data, Test=="rating" & ToBePalatalizedPlace=="no" & KeepPlace=="yes" & RatingBin %in% c("yes","no")), .(TrainedPlace, PluralVowel), summarise, prop=sum(RatingBinNum)/length(RatingBinNum), low=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[1], upper=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[2]) ratnochnopalsummedv #for ratings of correctly faithful forms ratnochnopalsummedv$TrainedPlace <- factor(ratnochnopalsummedv$TrainedPlace, levels=c("labial", "alveolar", "velar")) alvvellabnoi <- ggplot(subset(ratnochnopalsummedv, PluralVowel=="i"), aes(TrainedPlace, y=prop, ymin=low, ymax=upper, fill=TrainedPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Training Condition")+ scale_x_discrete(breaks=c("labial","alveolar","velar"), labels=c("Labial","Alveolar","Velar"))+ theme_bw()+ scale_fill_brewer(breaks=c("labial", "alveolar", "velar"), labels=c("Labial", "Alveolar", "Velar"), palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Training Condition") alvvellabnoi ggsave("Fig 3-Right Acceptance of correct faithful plurals before -i.tiff", alvvellabnoi, height=8, width=7) #Figure 3-A. Ratings scale, Bean plot #### #Left panel tiff("Fig 3A-Left Ratings of incorrect faithful plurals by singular consonant beanplot.tiff", height=6, width=6, units="in", res=300) par(xpd=F, mai=c(1.25,1.25,1.05,1), cex=1.5) beanplot(Rating ~ SingularConsonant, data=data[data$Rating %in% c(1:5) & data$Test=="rating" & data$KeepPlace=="yes" & data$ToBePalatalizedPlace=="yes",], xlab="Stem-Final Consonant", ylab="Rating", ll=0, col=list("grey96","grey96","grey78","grey78","grey40","grey40")) box(which="plot") par(xpd=T) legend(0.1,7,fill=c("grey96","grey78","grey38"), legend=c("Labial","Alveolar","Velar"), bty="n",horiz=T,xjust=0) dev.off() #Right panel tiff("Fig 3A-Right Ratings of correct faithful plurals before -i beanplot.tiff", width=6, height=6, units="in", res=300) par(xpd=F, mai=c(1.25,1.25,1.05,1), cex=1.5) beanplot(Rating ~ TrainedPlaceLabel, data=data[data$Rating %in% c(1:5) & data$Test=="rating" & data$KeepPlace=="yes" & data$ToBePalatalizedPlace=="no" & data$PluralVowel=="i",], xlab="Training Condition", ylab="Rating", ll=0, col=list("grey96","grey78","grey40")) box(which="plot") par(xpd=T) legend(0.25,6.5,fill=c("grey96","grey78","grey38"), legend=c("Labial","Alveolar","Velar"), bty="n",horiz=T,xjust=0) dev.off() ##### Hypothesis 2 ##### #Table 4: Palatalization of to-be vs not-to-be-palatalized plurals #### mat <- rbind(c(1, -0.5, -0.5), #a vs (b+c)/2 c(0, 1, -1)) #b vs c cMat <- ginv(mat) #comparing labial vs others and alveolar vs velar prod.LO_WithTrainedPlace<-glmer(KeepPlace ~ TrainedPlace+TestVoice+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$ToBePalatalizedPlace=="yes" & data$Test=="production" & data$PluralVowel=="i",], family="binomial", contrasts=list(TrainedPlace=cMat), glmerControl(optimizer = "bobyqa")) summary(prod.LO_WithTrainedPlace) prod.LO_WithoutTrainedPlace<-glmer(KeepPlace ~ TestVoice+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$ToBePalatalizedPlace=="yes" & data$Test=="production" & data$PluralVowel=="i",], family="binomial", glmerControl(optimizer = "bobyqa")) anova(prod.LO_WithTrainedPlace,prod.LO_WithoutTrainedPlace) #comparing velar vs alveolar prod.AV_TP<-glmer(KeepPlace ~ TrainedPlace+TestVoice+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$ToBePalatalizedPlace=="yes" & data$Test=="production" & data$PluralVowel=="i" & data$TrainedPlace %in% c("alveolar","velar"),], family="binomial", glmerControl(optimizer = "bobyqa")) summary(prod.AV_TP) prod.AV_TP2<-glmer(KeepPlace ~ TestVoice+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$ToBePalatalizedPlace=="yes" & data$Test=="production" & data$PluralVowel=="i" & data$TrainedPlace %in% c("alveolar","velar"),], family="binomial", glmerControl(optimizer = "bobyqa")) anova(prod.AV_TP,prod.AV_TP2) #Figure 4: palatalization rates by TBP vs NTPB #### tobeornotsummedv <- ddply(subset(data, Test=="production"), .(TrainPlace, PluralVowel, ToBePalatalizedPlace), summarise, prop=sum(KeepPlaceNum)/length(KeepPlaceNum), low=prop.test(sum(KeepPlaceNum),length(KeepPlaceNum))$conf.int[1], upper=prop.test(sum(KeepPlaceNum),length(KeepPlaceNum))$conf.int[2]) tobeornotsummedv tobeornotsummedv$TrainPlace <- factor(tobeornotsummedv$TrainPlace,levels=c("labial","alveolar","velar")) tobeornoti <- ggplot(subset(tobeornotsummedv, PluralVowel=="i"), aes(TrainPlace, y=1-prop, fill=ToBePalatalizedPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=1-upper, ymax=1-low), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Palatalized")+ xlab("Training Condition")+ scale_x_discrete(breaks=c("alveolar", "labial", "velar"), labels=c("Alveolar", "Labial", "Velar"))+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=20), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Palatalization Expected") tobeornoti ggsave("Fig 4 Correct vs incorrect palatalization rates before -i.tiff", tobeornoti, height=8, width=7) # Table 5 #### data$TrainedPlace <- factor(data$TrainedPlace, levels=c("labial","alveolar","velar")) data$TestPlace <- factor(data$TestPlace, levels=c("labial", "alveolar", "velar")) #alveolar vs labial mutual overgeneralization of palatalization prod.AL_WithTrainedPlace<-glmer(KeepPlace ~ TestVoice+TestPlace+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$TrainedPlace %in% c("alveolar","labial") & data$TestPlace %in% c("alveolar","labial") & data$ToBePalatalizedPlace=="no" & data$PluralVowel=="i" & data$Test=="production",], family="binomial", glmerControl(optimizer = "bobyqa") ) summary(prod.AL_WithTrainedPlace) prod.AL_WithoutTrainedPlace<-glmer(KeepPlace ~ TestVoice+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$TrainedPlace %in% c("alveolar","labial") & data$TestPlace %in% c("alveolar","labial") & data$ToBePalatalizedPlace=="no" & data$PluralVowel=="i" & data$Test=="production",], family="binomial" , glmerControl(optimizer = "bobyqa") ) anova(prod.AL_WithTrainedPlace, prod.AL_WithoutTrainedPlace) # Table 6: velar vs labial mutual overgeneralization of palatalization #### prod.VL_WithTrainedPlace<-glmer(KeepPlace ~ TestVoice+TestPlace+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$TrainedPlace %in% c("velar","labial") & data$TestPlace %in% c("velar","labial") & data$ToBePalatalizedPlace=="no" & data$Test=="production" & data$PluralVowel=="i",], family="binomial" , glmerControl(optimizer = "bobyqa") ) summary(prod.VL_WithTrainedPlace) prod.VL_WithoutTrainedPlace<-glmer(KeepPlace ~ TestVoice+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$TrainedPlace %in% c("velar","labial") & data$TestPlace %in% c("velar","labial") & data$ToBePalatalizedPlace=="no" & data$Test=="production" & data$PluralVowel=="i",], family="binomial" , glmerControl(optimizer = "bobyqa") ) anova(prod.VL_WithTrainedPlace, prod.VL_WithoutTrainedPlace) #Figure 5: Mutual overgeneralization of palatalization in production #### overgensummedv <- ddply(subset(data, Test=="production" & ToBePalatalizedPlace=="no"), .(SingularConsonant, TrainPlace, TestVoice, TestPlace, PluralVowel), summarise, prop=sum(KeepPlaceNum)/length(KeepPlaceNum), low=prop.test(sum(KeepPlaceNum),length(KeepPlaceNum))$conf.int[1], upper=prop.test(sum(KeepPlaceNum),length(KeepPlaceNum))$conf.int[2]) overgensummedv #for respective consonant palatalization rates overgensummedv$TrainPlace <- factor(overgensummedv$TrainPlace, levels=c("labial","alveolar","velar")) #Left panel: Alv vs Lab #### alvlabovergeni <- ggplot(subset(overgensummedv, TrainPlace %in% c("labial", "alveolar") & TestPlace %in% c("labial", "alveolar") & PluralVowel=="i"), aes(SingularConsonant, y=1-prop, ymin=low, ymax=upper, fill=TrainPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=1-upper, ymax=1-low), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Plurals Changing Place")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(breaks=c("labial", "alveolar"), labels=c("Labial", "Alveolar"), palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Training Condition") alvlabovergeni ggsave("Fig 5-Left Alveolar vs. Labial mutual overgeneralization before -i.tiff", alvlabovergeni, height=8, width=7) #Right panel: Vel vs Lab #### labvelovergeni <- ggplot(subset(overgensummedv, TrainPlace %in% c("labial", "velar") & TestPlace %in% c("labial", "velar") & PluralVowel=="i"), aes(SingularConsonant, y=1-prop, ymin=low, ymax=upper, fill=TrainPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=1-upper, ymax=1-low), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Plurals Changing Place")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(breaks=c("labial", "velar"), labels=c("Labial", "Velar"), palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Training Condition") labvelovergeni ggsave("Fig 5-Right Labial vs Velar mutual overgeneralization before -i.tiff", labvelovergeni, height=8, width=7) ##### Hypothesis 3: saltation ##### data$TrainedPlace <- relevel(data$TrainedPlace, "labial") #Production comparison #### #Alv vs Lab palatalization of velars prod.AL_to_V_WithTrainedPlace<-glmer(KeepPlace ~ TrainedPlace+TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace+PluralVowel|Singular) ,data=data[data$TrainedPlace %in% c("labial","alveolar") & data$TestPlace %in% c("velar") & data$ToBePalatalizedPlace=="no" & data$Test=="production",], family="binomial", glmerControl(optimizer = "bobyqa")) summary(prod.AL_to_V_WithTrainedPlace) prod.AL_to_V_WithoutTrainedPlace<-glmer(KeepPlace ~ TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace+PluralVowel|Singular) ,data=data[data$TrainedPlace %in% c("labial","alveolar") & data$TestPlace %in% c("velar") & data$ToBePalatalizedPlace=="no" & data$Test=="production",], family="binomial", glmerControl(optimizer = "bobyqa")) anova(prod.AL_to_V_WithTrainedPlace,prod.AL_to_V_WithoutTrainedPlace) #Vel vs Lab palatalization of alveolars prod.VL_to_A_WithTrainedPlace<-glmer(KeepPlace ~ TrainedPlace+TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace+PluralVowel|Singular) ,data=data[data$TrainedPlace %in% c("labial","velar") & data$TestPlace %in% c("alveolar") & data$ToBePalatalizedPlace=="no" & data$Test=="production",], family="binomial", glmerControl(optimizer = "bobyqa")) summary(prod.VL_to_A_WithTrainedPlace) prod.VL_to_A_WithoutTrainedPlace<-glmer(KeepPlace ~ TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace+PluralVowel|Singular) ,data=data[data$TrainedPlace %in% c("labial","velar") & data$TestPlace %in% c("alveolar") & data$ToBePalatalizedPlace=="no" & data$Test=="production",], family="binomial", glmerControl(optimizer = "bobyqa")) anova(prod.VL_to_A_WithTrainedPlace,prod.VL_to_A_WithoutTrainedPlace) #Figure 6: Overgeneralization of palatalization #### overgensummednocv <- ddply(subset(data, Test=="production" & ToBePalatalizedPlace=="no"), .(TrainPlace, TestPlace, PluralVowel), summarise, prop=sum(KeepPlaceNum)/length(KeepPlaceNum), low=prop.test(sum(KeepPlaceNum),length(KeepPlaceNum))$conf.int[1], upper=prop.test(sum(KeepPlaceNum),length(KeepPlaceNum))$conf.int[2]) overgensummednocv overgensummednocv$TrainPlace <- factor(overgensummednocv$TrainPlace, levels=c("labial","alveolar","velar")) #Left panel: Alv vs Lab to velars #### alvlabovergenveli <- ggplot(subset(overgensummednocv, TrainPlace %in% c("labial", "alveolar") & TestPlace %in% c("velar") & PluralVowel=="i"), aes(TestPlace, y=1-prop, ymin=low, ymax=upper, fill=TrainPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=1-upper, ymax=1-low), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Plurals Changing Place")+ xlab("Stem-Final Consonant Place")+ theme_bw()+ scale_fill_brewer(breaks=c("labial", "alveolar"), labels=c("Labial", "Alveolar"), palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Training Condition") alvlabovergenveli ggsave("Fig 6-Left Alveolar vs. Labial overgeneralization to velars before -i.tiff", alvlabovergenveli, height=8, width=7) #Right panel: Vel vs Lab to alveolars #### vellabovergenalvi <- ggplot(subset(overgensummednocv, TrainPlace %in% c("labial", "velar") & TestPlace %in% c("alveolar") & PluralVowel=="i"), aes(TestPlace, y=1-prop, ymin=low, ymax=upper, fill=TrainPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=1-upper, ymax=1-low), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Plurals Changing Place")+ xlab("Stem-Final Consonant Place")+ theme_bw()+ scale_fill_brewer(breaks=c("labial", "velar"), labels=c("Labial", "Velar"), palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Training Condition") vellabovergenalvi ggsave("Fig 6-Right Velar vs. Labial overgeneralization to alveolars before -i.tiff", vellabovergenalvi, height=8, width=7) #Ratings comparison #### #Alveolar vs Labial ratings of palatalized velars #### rate.AL_to_V_WithTrainedPlace<-glmer(RatingBin ~ TrainedPlace+TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="velar" & data$TrainedPlace %in% c("labial","alveolar") & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) summary(rate.AL_to_V_WithTrainedPlace) rate.AL_to_V_WithoutTrainedPlace<-glmer(RatingBin ~ TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="velar" & data$TrainedPlace %in% c("labial","alveolar") & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) anova(rate.AL_to_V_WithTrainedPlace,rate.AL_to_V_WithoutTrainedPlace) #by Rating rate.AL_to_V_WithTrainedPlace.rat<-lmer(Rating ~ TrainedPlace+TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="velar" & data$TrainedPlace %in% c("labial","alveolar") & data$Rating %in% c(1:5),]) summary(rate.AL_to_V_WithTrainedPlace.rat) rate.AL_to_V_WithoutTrainedPlace.rat<-lmer(Rating ~ TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="velar" & data$TrainedPlace %in% c("labial","alveolar") & data$Rating %in% c(1:5),]) anova(rate.AL_to_V_WithTrainedPlace.rat,rate.AL_to_V_WithoutTrainedPlace.rat) #before -i only (palatalizing context) rate.AL_to_V_WithTrainedPlace_i<-glmer(RatingBin ~ TrainedPlace+TestVoice+ (1|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="velar" & data$TrainedPlace %in% c("labial","alveolar") & data$PluralVowel=="i" & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) summary(rate.AL_to_V_WithTrainedPlace_i) rate.AL_to_V_WithoutTrainedPlace_i<-glmer(RatingBin ~ TestVoice+ (1|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="velar" & data$TrainedPlace %in% c("labial","alveolar") & data$PluralVowel=="i" & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) anova(rate.AL_to_V_WithTrainedPlace_i,rate.AL_to_V_WithoutTrainedPlace_i) #by Rating rate.AL_to_V_WithTrainedPlace_i.rat<-lmer(Rating ~ TrainedPlace+TestVoice+ (1|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="velar" & data$TrainedPlace %in% c("labial","alveolar") & data$PluralVowel=="i" & data$Rating %in% c(1:5),]) summary(rate.AL_to_V_WithTrainedPlace_i.rat) rate.AL_to_V_WithoutTrainedPlace_i.rat<-lmer(Rating ~ TestVoice+ (1|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="velar" & data$TrainedPlace %in% c("labial","alveolar") & data$PluralVowel=="i" & data$Rating %in% c(1:5),]) anova(rate.AL_to_V_WithTrainedPlace_i.rat,rate.AL_to_V_WithoutTrainedPlace_i.rat) #Figure 7: Alv vs Lab ratings of palatalized velars #### #Left panel: Across vowels #### ratsummednovnoc <- ddply(data[data$Test=="rating" & data$RatingBin %in% c("yes","no"),], .(TrainedPlace, TestPlace, KeepPlace), summarise, prop=sum(RatingBinNum)/length(RatingBinNum), low=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[1], upper=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[2]) str(ratsummednovnoc) alvlabrat_to_vel <- ggplot(subset(ratsummednovnoc, TrainedPlace %in% c("labial","alveolar") & TestPlace=="velar" & KeepPlace=="no"), aes(TestPlace, y=prop, ymin=low, ymax=upper, fill=TrainedPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=low, ymax=upper), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant Place")+ theme_bw()+ scale_fill_brewer(palette="Greys", breaks=c("labial","alveolar"), labels=c("Labial","Alveolar"))+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Training Condition") alvlabrat_to_vel ggsave("Fig 7-Left Labial vs Alveolar ratings of palatalized velars.tiff", alvlabrat_to_vel, height=8, width=7) #Right panel: Before -i #### ratsummedvnoc <- ddply(subset(data, Test=="rating" & RatingBin %in% c("yes","no")), .(TrainedPlace, TestPlace, PluralVowel, KeepPlace), summarise, prop=sum(RatingBinNum)/length(RatingBinNum), low=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[1], upper=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[2]) str(ratsummedvnoc) alvlabrat_to_vel_i <- ggplot(subset(ratsummedvnoc, TrainedPlace %in% c("labial","alveolar") & TestPlace=="velar" & KeepPlace=="no" & PluralVowel=="i"), aes(TestPlace, y=prop, ymin=low, ymax=upper, fill=TrainedPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=low, ymax=upper), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant Place")+ theme_bw()+ scale_fill_brewer(palette="Greys", breaks=c("labial","alveolar"), labels=c("Labial","Alveolar"))+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Training Condition") alvlabrat_to_vel_i ggsave("Fig 7-Right Labial vs Alveolar ratings of palatalized velars before -i.tiff", alvlabrat_to_vel_i, height=8, width=7) #Figure 7-A: By Rating, beanplot data.alvlabtovel <- data[data$Rating %in% c(1:5) & data$Test=="rating" & data$TrainedPlaceLabel %in% c("Alveolar","Labial") & data$TestPlace=="velar" & data$KeepPlace=="no",] data.alvlabtovel$TrainedPlaceLabel <- factor(data.alvlabtovel$TrainedPlaceLabel) tiff("Fig 7A-Left Labial vs Alveolar ratings of palatalized velars beanplot.tiff", width=6, height=6, units="in", res=300) par(xpd=F, mai=c(1.25,1.25,1.05,1), cex=1.5) beanplot(Rating ~ TrainedPlaceLabel, data=data.alvlabtovel, xlab="Training Condition", ylab="Rating", ll=0, col=list("grey96","grey78")) box(which="plot") par(xpd=T) legend(0.45,6.5,fill=c("grey96","grey78"), legend=c("Labial","Alveolar"), bty="n",horiz=T,xjust=0) dev.off() #Right panel data.alvlabtoveli <- data[data$Rating %in% c(1:5) & data$Test=="rating" & data$TrainedPlaceLabel %in% c("Alveolar","Labial") & data$TestPlace=="velar" & data$KeepPlace=="no" & data$PluralVowel=="i",] data.alvlabtoveli$TrainedPlaceLabel <- factor(data.alvlabtoveli$TrainedPlaceLabel) tiff("Fig 7A-Right Labial vs Alveolar ratings of palatalized velars before -i beanplot.tiff", height=6, width=6, unit="in", res=300) par(xpd=F, mai=c(1.25,1.25,1.05,1), cex=1.5) beanplot(Rating ~ TrainedPlaceLabel, data=data.alvlabtoveli, xlab="Training Condition", ylab="Rating", ll=0, col=list("grey96","grey78")) box(which="plot") par(xpd=T) legend(0.45,6.7,fill=c("grey96","grey78"), legend=c("Labial","Alveolar"), bty="n",horiz=T,xjust=0) dev.off() #Velar vs Labial absolute ratings of palatalization of alveolars #### rate.VL_to_A_WithTrainedPlace<-glmer(RatingBin ~ TrainedPlace+TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace+PluralVowel|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="alveolar" & data$TrainedPlace %in% c("labial","velar") & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) summary(rate.VL_to_A_WithTrainedPlace) rate.VL_to_A_WithoutTrainedPlace<-glmer(RatingBin ~ TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace+PluralVowel|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="alveolar" & data$TrainedPlace %in% c("labial","velar") & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) anova(rate.VL_to_A_WithoutTrainedPlace,rate.VL_to_A_WithTrainedPlace) #by Rating rate.VL_to_A_WithTrainedPlace.rat<-lmer(Rating ~ TrainedPlace+TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="alveolar" & data$TrainedPlace %in% c("labial","velar") & data$Rating %in% c(1:5),]) summary(rate.VL_to_A_WithTrainedPlace.rat) rate.VL_to_A_WithoutTrainedPlace.rat<-lmer(Rating ~ TestVoice+PluralVowel+ (1+TestVoice+PluralVowel|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="alveolar" & data$TrainedPlace %in% c("labial","velar") & data$Rating %in% c(1:5),]) anova(rate.VL_to_A_WithoutTrainedPlace.rat,rate.VL_to_A_WithTrainedPlace.rat) #before -i only rate.VL_to_A_WithTrainedPlace_i<-glmer(RatingBin ~ TrainedPlace+TestVoice+ (1+TestVoice|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="alveolar" & data$TrainedPlace %in% c("labial","velar") & data$PluralVowel=="i" & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) summary(rate.VL_to_A_WithTrainedPlace_i) rate.VL_to_A_WithoutTrainedPlace_i<-glmer(RatingBin ~ TestVoice+ (1+TestVoice|SubjectUnique)+ (1+TrainedPlace|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="alveolar" & data$TrainedPlace %in% c("labial","velar") & data$PluralVowel=="i" & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) anova(rate.VL_to_A_WithoutTrainedPlace_i,rate.VL_to_A_WithTrainedPlace_i) #by Rating rate.VL_to_A_WithTrainedPlace_i.rat<-lmer(Rating ~ TrainedPlace+TestVoice+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="alveolar" & data$TrainedPlace %in% c("labial","velar") & data$PluralVowel=="i" & data$Rating %in% c(1:5),]) summary(rate.VL_to_A_WithTrainedPlace_i.rat) rate.VL_to_A_WithoutTrainedPlace_i.rat<-lmer(Rating ~ TestVoice+ (1+TestVoice|SubjectUnique)+ (1|Singular) ,data=data[data$Test=="rating" & data$KeepPlace=="no" & data$TestPlace=="alveolar" & data$TrainedPlace %in% c("labial","velar") & data$PluralVowel=="i" & data$Rating %in% c(1:5),]) anova(rate.VL_to_A_WithoutTrainedPlace_i.rat,rate.VL_to_A_WithTrainedPlace_i.rat) #Figure 8: Vel vs Lab ratings of palatalized alveolars #### #Left panel: across vowels #### vellabrat_to_alv <- ggplot(subset(ratsummednovnoc, TrainedPlace %in% c("labial","velar") & TestPlace=="alveolar" & KeepPlace=="no"), aes(TestPlace, y=prop, ymin=low, ymax=upper, fill=TrainedPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=low, ymax=upper), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant Place")+ theme_bw()+ scale_fill_brewer(palette="Greys", breaks=c("labial","velar"), labels=c("Labial","Velar"))+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Training Condition") vellabrat_to_alv ggsave("Fig 8-Left Labial vs Velar ratings of palatalized alveolars.tiff", vellabrat_to_alv, height=8, width=7) #Right panel: Before -i #### vellabrat_to_alv_i <- ggplot(subset(ratsummedvnoc, TrainedPlace %in% c("labial","velar") & TestPlace=="alveolar" & KeepPlace=="no" & PluralVowel=="i"), aes(TestPlace, y=prop, ymin=low, ymax=upper, fill=TrainedPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=low, ymax=upper), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant Place")+ theme_bw()+ scale_fill_brewer(palette="Greys", breaks=c("labial","velar"), labels=c("Labial","Velar"))+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Training Condition") vellabrat_to_alv_i ggsave("Fig 8-Right Labial vs Velar ratings of palatalized alveolars before -i.tiff", vellabrat_to_alv_i, height=8, width=7) #Figure 8-A #### #Left panel data.labveltoalv <- data[data$Rating %in% c(1:5) & data$Test=="rating" & data$TrainedPlaceLabel %in% c("Velar","Labial") & data$TestPlace=="alveolar" & data$KeepPlace=="no",] data.labveltoalv$TrainedPlaceLabel <- factor(data.labveltoalv$TrainedPlaceLabel) tiff("Fig 8A-Left Labial vs Velar ratings of palatalized alveolars beanplot.tiff", width=6, height=6, units="in", res=300) par(xpd=F, mai=c(1.25,1.25,1.05,1), cex=1.5) beanplot(Rating ~ TrainedPlaceLabel, data=data.labveltoalv, xlab="Training Condition", ylab="Rating", ll=0, col=list("grey96","grey78")) box(which="plot") par(xpd=T) legend(0.45,6.8,fill=c("grey96","grey78"), legend=c("Labial","Velar"), bty="n",horiz=T,xjust=0) dev.off() #Left panel data.labveltoalvi <- data[data$Rating %in% c(1:5) & data$Test=="rating" & data$TrainedPlaceLabel %in% c("Velar","Labial") & data$TestPlace=="alveolar" & data$KeepPlace=="no" & data$PluralVowel=="i",] data.labveltoalvi$TrainedPlaceLabel <- factor(data.labveltoalvi$TrainedPlaceLabel) tiff("Fig 8A-Right Labial vs Velar ratings of palatalized alveolars before -i beanplot.tiff", width=6, height=6, units="in", res=300) par(xpd=F, mai=c(1.25,1.25,1.05,1), cex=1.5) beanplot(Rating ~ TrainedPlaceLabel, data=data.labveltoalvi, xlab="Training Condition", ylab="Rating", ll=0, col=list("grey96","grey78")) box(which="plot") par(xpd=T) legend(0.45,6.8,fill=c("grey96","grey78"), legend=c("Labial","Velar"), bty="n",horiz=T,xjust=0) dev.off() ##### Hypothesis 4 ##### #Figure 9: Palatalization in judgment vs production #### #Left panel: Acceptance in judgment #### paltobeminussummedv <- ddply(subset(data, Test=="rating" & KeepPlace=="no" & RatingBin %in% c("yes","no")), .(TrainedPlace, ToBePalatalizedPlace, PluralVowel), summarise, prop=sum(RatingBinNum)/length(RatingBinNum), low=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[1], upper=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[2]) paltobeminussummedv paltobeminussummedv$TrainedPlace <- factor(paltobeminussummedv$TrainedPlace, levels=c("labial","alveolar","velar")) tobeornottobepali <- ggplot(subset(paltobeminussummedv, PluralVowel=="i"), aes(TrainedPlace, y=prop, ymin=low, ymax=upper, fill=ToBePalatalizedPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=low, ymax=upper), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Training Condition")+ scale_x_discrete(breaks=c("labial","alveolar","velar"), labels=c("Labial","Alveolar","Velar"))+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=20), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Palatalization Expected") tobeornottobepali ggsave("Fig 9-Left Acceptance of correct vs incorrect palatalization before -i.tiff", tobeornottobepali, height=8, width=7) #Right panel: See Figure 2 #### #Table 7: Palatalization acceptance and production before -i by training condition #### #Dependent variable dataTest <- data str(dataTest) dataTest$dv <- 8 dataTest$dv[dataTest$Test=="production" & dataTest$KeepPlace=="no"] <- 0 #produce change dataTest$dv[dataTest$Test=="production" & dataTest$KeepPlace=="yes"] <- 1 #produce no-change dataTest$dv[dataTest$Test=="rating" & dataTest$KeepPlace=="no" & #accept change dataTest$RatingBin=="yes"] <- 0 dataTest$dv[dataTest$Test=="rating" & dataTest$KeepPlace=="no" & #reject change dataTest$RatingBin=="no"] <- 1 str(dataTest) dataTest2 <- dataTest[dataTest$dv<8,] str(dataTest2) dataTest <- dataTest2 str(dataTest) #absolute ratings palPref_WithLabialTraining <- glmer(dv ~ TestVoice+LabialTraining*Test+ (1+Test+TestVoice|SubjectUnique)+ (1|Singular) ,data=dataTest2[dataTest2$ToBePalatalizedPlace=="yes" & dataTest2$PluralVowel=="i",], family="binomial", glmerControl(optimizer = "bobyqa")) summary(palPref_WithLabialTraining) palPref_WithoutLabialTrainingInteraction <- glmer(dv ~ TestVoice+LabialTraining+Test+ (1+TestVoice+Test|SubjectUnique)+ (1|Singular) ,data=dataTest2[dataTest2$ToBePalatalizedPlace=="yes" & dataTest2$PluralVowel=="i",], family="binomial", glmerControl(optimizer = "bobyqa")) anova(palPref_WithLabialTraining,palPref_WithoutLabialTrainingInteraction) #faithful vs palatalized plural forms of labial To-Be-Palatalized consonants, labial training, -i #### rate.Lab.tbpi <- glmer(RatingBin ~ TestVoice+KeepPlace+ (1+KeepPlace+TestVoice|SubjectUnique)+ (1+KeepPlace|Singular) ,data=data[data$TrainedPlace %in% c("labial") & data$PluralVowel=="i" & data$ToBePalatalizedPlace=="yes" & data$Test=="rating" & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) summary(rate.Lab.tbpi) rate.Lab.tbpi2 <- glmer(RatingBin ~ TestVoice+ (1+KeepPlace+TestVoice|SubjectUnique)+ (1+KeepPlace|Singular) ,data=data[data$TrainedPlace %in% c("labial") & data$PluralVowel=="i" & data$ToBePalatalizedPlace=="yes" & data$Test=="rating" & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) anova(rate.Lab.tbpi,rate.Lab.tbpi2) #by Rating rate.Lab.tbpi3 <- lmer(Rating ~ TestVoice+KeepPlace+ (1+KeepPlace+TestVoice|SubjectUnique)+ (1+KeepPlace|Singular) ,data=data[data$TrainedPlace %in% c("labial") & data$PluralVowel=="i" & data$ToBePalatalizedPlace=="yes" & data$Test=="rating" & data$Rating %in% c(1:5),]) summary(rate.Lab.tbpi3) rate.Lab.tbpi4 <- lmer(Rating ~ TestVoice+ (1+KeepPlace+TestVoice|SubjectUnique)+ (1+KeepPlace|Singular) ,data=data[data$TrainedPlace %in% c("labial") & data$PluralVowel=="i" & data$ToBePalatalizedPlace=="yes" & data$Test=="rating" & data$Rating %in% c(1:5),]) anova(rate.Lab.tbpi4,rate.Lab.tbpi3) #faithful vs palatalized plural forms of labial To-Be-Palatalized consonants, labial training, across suffixes #### rate.Lab.tbp <- glmer(RatingBin ~ TestVoice+KeepPlace+PluralVowel+ (1+KeepPlace+TestVoice+PluralVowel|SubjectUnique)+ (1+KeepPlace|Singular) ,data=data[data$TrainedPlace %in% c("labial") & data$ToBePalatalizedPlace=="yes" & data$Test=="rating" & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) summary(rate.Lab.tbp) rate.Lab.tbp2 <- glmer(RatingBin ~ TestVoice+PluralVowel+ (1+KeepPlace+TestVoice+PluralVowel|SubjectUnique)+ (1+KeepPlace|Singular) ,data=data[data$TrainedPlace %in% c("labial") & data$ToBePalatalizedPlace=="yes" & data$Test=="rating" & data$RatingBin %in% c("yes","no"),], family="binomial", glmerControl(optimizer = "bobyqa")) anova(rate.Lab.tbp2,rate.Lab.tbp) #Figure 10: No-Change vs Palatalized Plurals of To-Be-Palatalized consonants #### #Left panel: Across vowels #### tobepalvsnochsummednov <- ddply(subset(data, Test=="rating" & ToBePalatalizedPlace=="yes" & RatingBin %in% c("yes","no")), .(TrainPlace, KeepPlace), summarise, prop=sum(RatingBinNum)/length(RatingBinNum), low=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[1], upper=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[2]) tobepalvsnochsummednov tobepalvsnochsummednov$TrainPlace <- factor(tobepalvsnochsummednov$TrainPlace, levels=c("labial","alveolar","velar")) tobepalvsnochsummednov$KeepPlace <- relevel(tobepalvsnochsummednov$KeepPlace,"yes") tobepalvsnoch <- ggplot(tobepalvsnochsummednov, aes(TrainPlace, y=prop, ymin=low, ymax=upper, fill=KeepPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=low, ymax=upper), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Training Condition")+ scale_x_discrete(breaks=c("labial","alveolar","velar"), labels=c("Labial","Alveolar","Velar"))+ theme_bw()+ scale_fill_brewer(palette="Greys", breaks=c("yes","no"), labels=c("no","yes"))+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Palatalized Plural") tobepalvsnoch ggsave("Fig 10-Left Judgments correct palatalized vs incorrect faithful plurals.tiff", tobepalvsnoch, height=8, width=7) #Right panel: Before -i #### tobepalvsnochsummedv <- ddply(subset(data, Test=="rating" & ToBePalatalizedPlace=="yes" & PluralVowel=="i" & RatingBin %in% c("yes","no")), .(TrainPlace, KeepPlace), summarise, prop=sum(RatingBinNum)/length(RatingBinNum), low=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[1], upper=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[2]) tobepalvsnochsummedv tobepalvsnochsummedv$TrainPlace <- factor(tobepalvsnochsummedv$TrainPlace, levels=c("labial","alveolar","velar")) tobepalvsnochsummedv$KeepPlace <- relevel(tobepalvsnochsummedv$KeepPlace,"yes") tobepalvsnochi <- ggplot(tobepalvsnochsummedv, aes(TrainPlace, y=prop, ymin=low, ymax=upper, fill=KeepPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=low, ymax=upper), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Training Condition")+ scale_x_discrete(breaks=c("labial","alveolar","velar"), labels=c("Labial","Alveolar","Velar"))+ theme_bw()+ scale_fill_brewer(palette="Greys", breaks=c("yes","no"), labels=c("no","yes"))+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Palatalized Plural") tobepalvsnochi ggsave("Fig 10-Right Judgments of correct palatalized vs incorrect faithful plurals before -i.tiff", tobepalvsnochi, height=8, width=7) # Table 8: Effects of test and training condition and vowel and TBP on acceptance/production of palatalization #### str(dataTest2) dataTest2$PluralVowel <- relevel(dataTest2$PluralVowel,"i") dataTest2$ToBePalatalizedPlace <- relevel(dataTest2$ToBePalatalizedPlace,"yes") palPrefTBP <- glmer(dv ~ TestVoice+LabialTraining*Test*ToBePalatalizedPlace +PluralVowel+ (1+Test*ToBePalatalizedPlace|SubjectUnique)+ (1+LabialTraining+ToBePalatalizedPlace|Singular) ,data=dataTest2, family="binomial", glmerControl(optimizer = "bobyqa")) summary(palPrefTBP) #Discussion #### #Figure 11: Palatalization rates in production before -i #### data$SingularConsonant <- factor(data$SingularConsonant, levels=c("b", "p", "d", "t", "g", "k")) data$TestPlace <- factor(data$TestPlace, levels=c("labial", "alveolar", "velar")) data$TrainPlace <- factor(data$TrainPlace, levels=c("labial", "alveolar", "velar")) data$TrainedPlace <- factor(data$TrainPlace, levels=c("labial","alveolar","velar")) data$ToBePalatalizedPlace <- factor(data$ToBePalatalizedPlace, levels=c("yes", "no")) summedv <- ddply(data[data$Test=="production",], .(TrainedPlace, SingularConsonant, PluralVowel, TestPlace, TestVoice), summarise, prop=sum(KeepPlaceNum)/length(KeepPlaceNum), low=prop.test(sum(KeepPlaceNum),length(KeepPlaceNum))$conf.int[1], upper=prop.test(sum(KeepPlaceNum),length(KeepPlaceNum))$conf.int[2]) str(summedv) summedv #Alveolar training #### alvprodi <- ggplot(subset(summedv, TrainedPlace=="alveolar" & PluralVowel=="i"), aes(SingularConsonant, y=1-prop, ymin=low, ymax=upper, fill=TestPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=1-upper, ymax=1-low), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Plurals Changing Place")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Stem-Final Consonant") alvprodi ggsave("Fig 11-Center Alveolar palatalization in production before -i.tiff", alvprodi, height=8, width=7) #Velar training #### velprodi <- ggplot(subset(summedv, TrainedPlace=="velar" & PluralVowel=="i"), aes(SingularConsonant, y=1-prop, ymin=low, ymax=upper, fill=TestPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=1-upper, ymax=1-low), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Plurals Changing Place")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Stem-Final Consonant") velprodi ggsave("Fig 11-Right Velar palatalization in production before -i.tiff", velprodi, height=8, width=7) #Labial training #### labprodi <- ggplot(subset(summedv, TrainedPlace=="labial" & PluralVowel=="i"), aes(SingularConsonant, y=1-prop, ymin=low, ymax=upper, fill=TestPlace))+ geom_bar(stat="identity", color="black", position="dodge")+ geom_errorbar(aes(ymin=1-upper, ymax=1-low), position=position_dodge(0.9), width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Plurals Changing Place")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Stem-Final Consonant") labprodi ggsave("Fig 11-Left Labial palatalization in production before -i.tiff", labprodi, height=8, width=7) #Figure 12: Ratings of no-change plural forms by training condition, before -i #### data2 <- subset(data, Test=="production" | RatingBin %in% c("yes", "no")) data2$RatingBinNum <- as.integer(data2$RatingBin) xtabs(~RatingBinNum+RatingBin, data=data2) data2$RatingBinNum[data2$RatingBinNum==2] <- 0 data2$RatingBinNum[data2$RatingBinNum==3] <- 1 str(data) data2$TestPlace<-relevel(data2$TestPlace,"velar") data2$PluralVowel<-relevel(data2$PluralVowel,"i") data2$TrainedPlace <- factor(data2$TrainPlace) data2$TestPlace <- factor(data2$TestPlace, levels=c("labial", "alveolar", "velar")) ratsummedv <- ddply(subset(data, Test=="rating" & RatingBin %in% c("yes","no")), .(TrainedPlace, TestPlace, SingularConsonant, PluralVowel, TestVoice, KeepPlace), summarise, prop=sum(RatingBinNum)/length(RatingBinNum), low=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[1], upper=prop.test(sum(RatingBinNum),length(RatingBinNum))$conf.int[2]) str(ratsummedv) ratsummedv ratsummedv$SingularConsonant <- factor(ratsummedv$SingularConsonant, levels=c("b", "p", "d", "t", "g", "k")) #Alveolar training #### alvrati <- ggplot(subset(ratsummedv, TrainedPlace=="alveolar" & KeepPlace=="yes" & PluralVowel=="i"), aes(SingularConsonant, y=prop, ymin=low, ymax=upper, fill=TestPlace))+ geom_bar(stat="identity", color="black")+ geom_errorbar(width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Stem-Final Consonant") alvrati ggsave("Fig 12-Center Alveolar ratings of faithful plurals before -i.tiff", alvrati, height=8, width=7) #Velar training #### velrati <- ggplot(subset(ratsummedv, TrainedPlace=="velar" & KeepPlace=="yes" & PluralVowel=="i"), aes(SingularConsonant, y=prop, ymin=low, ymax=upper, fill=TestPlace))+ geom_bar(stat="identity", color="black")+ geom_errorbar(width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Stem-Final Consonant") velrati ggsave("Fig 12-Right Velar ratings of faithful plurals before -i.tiff", velrati, height=8, width=7) #Labial training #### labrati <- ggplot(subset(ratsummedv, TrainedPlace=="labial" & KeepPlace=="yes" & PluralVowel=="i"), aes(SingularConsonant, y=prop, ymin=low, ymax=upper, fill=TestPlace))+ geom_bar(stat="identity", color="black")+ geom_errorbar(width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Stem-Final Consonant") labrati ggsave("Fig 12-Left Labial ratings of faithful plurals before -i.tiff", labrati, height=8, width=7) #Figure 13: Ratings of palatalized plural forms by training condition #### #Alveolar training #### alvrati <- ggplot(subset(ratsummedv, TrainedPlace=="alveolar" & KeepPlace=="no" & PluralVowel=="i"), aes(SingularConsonant, y=prop, ymin=low, ymax=upper, fill=TestPlace))+ geom_bar(stat="identity", color="black")+ geom_errorbar(width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Stem-Final Consonant") alvrati ggsave("Fig 13-Center Alveolar ratings of palatalized plurals before -i.tiff", alvrati, height=8, width=7) #Velar training velrati <- ggplot(subset(ratsummedv, TrainedPlace=="velar" & KeepPlace=="no" & PluralVowel=="i"), aes(SingularConsonant, y=prop, ymin=low, ymax=upper, fill=TestPlace))+ geom_bar(stat="identity", color="black")+ geom_errorbar(width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Stem-Final Consonant") velrati ggsave("Fig 13-Right Velar ratings of palatalized plurals before -i.tiff", velrati, height=8, width=7) #Labial training #### labrati <- ggplot(subset(ratsummedv, TrainedPlace=="labial" & KeepPlace=="no" & PluralVowel=="i"), aes(SingularConsonant, y=prop, ymin=low, ymax=upper, fill=TestPlace))+ geom_bar(stat="identity", color="black")+ geom_errorbar(width=0.25)+ coord_cartesian(y=c(0,1))+ ylab("Percent Acceptance")+ xlab("Stem-Final Consonant")+ theme_bw()+ scale_fill_brewer(palette="Greys")+ theme(legend.position = "top", legend.title = element_text(size=18), legend.text=element_text(size=20), strip.text.x = element_text(family="Helvetica", size = 22), axis.text.x = element_text(family="Helvetica", size=20), axis.text.y = element_text(family="Helvetica", size=20), axis.title.x = element_text(family="Helvetica", size=23), axis.title.y = element_text(family="Helvetica", size=23), plot.title = element_text(family="Helvetica", size=22, hjust=0.5))+ labs(fill="Stem-Final Consonant") labrati ggsave("Fig 13-Left Labial ratings of palatalized plurals before -i.tiff", labrati, height=8, width=7)