I am looking for a way to calculate mean, sd and se values for Weight for each treatment across two replications.
Treatment Rep Weight
Line 1 1 NA
Line 1 1 NA
Line 1 1 NA
Line 1 1 NA
Line 2 1 26
Line 2 1 26
Line 2 1 26
Line 2 1 27
Line 1 2 26
Line 1 2 28
Line 1 2 26
Line 1 2 25
Line 2 2 24
Line 2 2 26
Line 2 2 25
Line 2 2 NA
I tried dplyr package but it gives the mean of the treatment for each replication, not both replications combined.
Data1 %>% group_by(Treatment, Rep) %>% summarise_at(vars(-group_cols()), list(mean = ~mean(Weight, na.rm = TRUE),
sd = ~sd(Weight, na.rm = TRUE), se= ~sd(Weight, na.rm = TRUE)/sqrt(n())))
Thank you for the help!