##### Developmental Step 1 ##### ###### Group one Gate conditioning run 2 ###### ####### R script ####### ###### R version 4.0.3 ###### ##### Analysis ##### ##### Group one Gate conditioning run 1 ##### #### Plot #### setwd("XXX") PC2=read.delim2("Data Group one Gate conditioning run 2.txt") names(PC2) str(PC2) PC2$day<-as.factor(PC2$day) PC2$animal<-as.factor(PC2$animal) PC2$Tone<-as.factor(PC2$Tone) PC2$NP<-as.numeric(PC2$NP) boxplot(NP~Tone, data=PC2) library("ggplot2") library("ggsci") library("ggpubr") C2 <- ggplot(PC2, aes(x = day, y = Percent, fill=Tone )) + geom_boxplot()+ scale_x_discrete(name = "Day") + scale_fill_manual(values=c("#FF3333","#3399FF"))+ scale_y_continuous(name="Number of nosepokes [%]") C2 ggpar(C2, font.main = c(18, "bold"), font.x = c(18, "bold"), font.y = c(18, "bold"), font.caption = c(18, "bold"), font.legend = c(18, "bold"), font.tickslab = c(18, "bold")) #### Analysis #### contrasts (Conditionin2 [, 'Tone']) <- contr.sum (2) contrasts (Conditionin2 [, 'day']) <- contr.sum (7) summary (Conditionin2) library (nlme) Co2 <- lme (Percent ~ day * Tone, random= ~ 1 | animal/day, data= PC2, method= 'ML') summary (Co2) anova (Co2, type= 'marginal') qqnorm(residuals(Co2)) plot(fitted(Co2),residuals(Co2))