I am trying to calculate the reference scaled average method for partial replicate design in R, but not able to estimate the average of "Sequence" effect.
Equivalent SAS code is posted below, and we can also get in FDA guideline for Progesterone.
I am trying to calculate the reference scaled average method for partial replicate design in R, but not able to estimate the average of "Sequence" effect.
I don't know of a way to do this in base R, but the emmeans
package provides functions to do exactly this. Reproducing the equivalent SAS code:
fit <- lm(ilat ~ factor(seq), data=scavbe)
emm <- emmeans::emmeans(fit, ~ seq)
emmeans::contrast(emm, list(average = rep(1/3, 3)))