rsasglmnlmecontrast

estimate 'average' intercept 3 Sequence 1 1 1/devisor=3; How to get the estimate of average in R


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.

SAS code piece

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.


Solution

  • 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)))