## FDA group model in R [Two-Stage / GS Designs]

Dear mittyri,
Dear zizou,

» The ANOVA type I is the same as in PHX, but PE and CIs are not. I'm in stuck....

Thank you very much for your help!

I have checked proposed model formula in R's lm() versus SAS output of some old study report with unbalanced dataset.
I found perfect much here for group*treatment!

1. Analysis started as FDA Group Model 1:
> anovadata <- lm(log(data2$Cmax)~group+seq+seq*group+subj%in%(seq)+prd%in%group+drug+drug*group, data=data2, na.action=na.exclude) > anova(anovadata) Analysis of Variance Table Response: log(data2$Cmax)            Df Sum Sq Mean Sq F value Pr(>F)    group       1   0.12   0.120    1.23  0.272    seq         1   0.05   0.046    0.47  0.497    drug        1   0.18   0.182    1.87  0.177    group:seq   1   0.46   0.460    4.71  0.034 *  seq:subj   59  25.25   0.428    4.38  3e-08 *** group:prd   2   0.33   0.164    1.68  0.195    group:drug  1   0.01   0.007    0.07  0.797    Residuals  59   5.76   0.098 > drop1(anovadata, test="F") Single term deletions Model: log(data2$Cmax) ~ group + seq + seq * group + subj %in% (seq) + prd %in% group + drug + drug * group Df Sum of Sq RSS AIC F value Pr(>F) <none> 5.76 -255 group:seq 0 0.00 5.76 -255 seq:subj 59 25.25 31.01 -161 4.38 3e-08 *** group:prd 2 0.32 6.09 -252 1.64 0.2 group:drug 1 0.01 5.77 -256 0.07 0.8  F and P values for group:drug are exactly the same as obtained by SAS:  Param Source DF F Value P-value Model to be used: lCmax Group*Treat 1 0.07 0.7966 N.S. Remove interaction  2. I've got same F and P values (at least for some of the effects) while proceeding to FDA Group Model 2 (or EMA's only model with all effects fixed), not mentioning exactly the same outputs for MSE/ Intra-subject CV and PE / 90%CIs : > anovadata2 <- lm(log(data2$Cmax)~group+seq+seq*group+subj%in%(seq)+prd%in%group+drug, data=data2, na.action=na.exclude) > drop1(anovadata2, test="F") Single term deletions Model: log(data2\$Cmax) ~ group + seq + seq * group + subj %in% (seq) +     prd %in% group + drug           Df Sum of Sq   RSS  AIC F value  Pr(>F)    <none>                  5.77 -256                    drug       1      0.21  5.98 -254    2.15    0.15    group:seq  0      0.00  5.77 -256                    seq:subj  59     25.25 31.02 -163    4.45 1.8e-08 *** group:prd  2      0.33  6.10 -254    1.71    0.19 

SAS output:
 Param   Effect          DF   F Value   P-value lCmax   Group           1    0.21      0.6475 lCmax   Seq             1    0.31      0.5822 lCmax   Group*Seq       1    1.08      0.3040 lCmax   Treat           1    2.15      0.1476 lCmax   Per(Group)      2    1.71      0.1896 lCmax   Subj(Group*Seq) 59   4.45      <.0001

Maybe lm() sometimes doing exactly the same as PROC GLM?
Regards, VStus