Input data
library(readxl)
## Warning: package 'readxl' was built under R version 4.0.3
Data= read_excel("C:/Users/Admin/Desktop/R/Data.xlsx",
sheet = "Repeated measures 1 way ANOVA",
col_types = c("text", "numeric", "numeric"))
attach(Data)
require(lsmeans)
## Loading required package: lsmeans
## Warning: package 'lsmeans' was built under R version 4.0.3
## Loading required package: emmeans
## Warning: package 'emmeans' was built under R version 4.0.3
## The 'lsmeans' package is now basically a front end for 'emmeans'.
## Users are encouraged to switch the rest of the way.
## See help('transition') for more information, including how to
## convert old 'lsmeans' objects and scripts to work with 'emmeans'.
require(multcomp)
## Loading required package: multcomp
## Warning: package 'multcomp' was built under R version 4.0.3
## Loading required package: mvtnorm
## Warning: package 'mvtnorm' was built under R version 4.0.3
## Loading required package: survival
## Loading required package: TH.data
## Warning: package 'TH.data' was built under R version 4.0.3
## Loading required package: MASS
## Warning: package 'MASS' was built under R version 4.0.3
##
## Attaching package: 'TH.data'
## The following object is masked from 'package:MASS':
##
## geyser
Define factor
Treatment=factor(Treatment)
Time=factor(Measured_time)
Run repeated anova
anova= aov(Weight_Gain~Time+Error(Treatment/Time))
summary(anova)
##
## Error: Treatment
## Df Sum Sq Mean Sq F value Pr(>F)
## Residuals 5 6.895 1.379
##
## Error: Treatment:Time
## Df Sum Sq Mean Sq F value Pr(>F)
## Time 3 28.561 9.520 27.4 2.47e-06 ***
## Residuals 15 5.212 0.347
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Plot
plot=tapply(Weight_Gain,Time,mean)
plot(plot,type="o",xlab="Time",ylab="Weight_gain")

Conclusion: the p value in cage of running repeated more powerful than one way anova when the dependent variable (Weight gain) repeated by time. There are significant different between treatment.
Pairwise.t.test
pairwise.t.test(Weight_Gain,Time,p.adjust.method = "bonferroni")
##
## Pairwise comparisons using t tests with pooled SD
##
## data: Weight_Gain and Time
##
## 1 2 3
## 2 0.1501 - -
## 3 0.0074 1.0000 -
## 4 9.1e-06 0.0021 0.0456
##
## P value adjustment method: bonferroni