Skip to main content
edited tags
Link
kjetil b halvorsen
  • 82.8k
  • 32
  • 201
  • 663
Post Migrated Here from stackoverflow.com (revisions)
Source Link
user11916948
user11916948

Interpret a ANOVA table with treatment taking basliene value into account

I have the example data below. I wonder how I should interpret the BL value from the ANOVA table, 0.0194391. It means it is significantly different from zero, but putting that into the context, does it mean that it is significantly different from the treatments (trt)?. Does anyone have a good explanation? Thanks in advance! :)

id <- rep(c(300,450), each=6)
visit <- rep(1:6,2)
trt <- rep(c(0,"A",0,"B",0,"C"),2)
q1 <- c(20,100,40,89,30, 60,50,85,10,40,15, 20)
df <- data.frame(id,visit,trt,q1)
dfnoll <- df[df$trt==0,]
meanBL <- tapply(dfnoll$q1, dfnoll$id, mean, na.rm=TRUE)  # funkar bara när det är numreriskt
BL <- rep(meanBL, each=3)
dftrt <- df[!df$trt==0,]
dftrt$BL <- BL
dftrt
    id visit trt  q1 BL
2  300     2   A 100 30
4  300     4   B  89 30
6  300     6   C  60 30
8  450     2   A  85 25
10 450     4   B  40 25
12 450     6   C  20 25
str(dftrt)
'data.frame':	6 obs. of  5 variables:
 $ id   : num  300 300 300 450 450 450
 $ visit: int  2 4 6 2 4 6
 $ trt  : Factor w/ 4 levels "0","A","B","C": 2 3 4 2 3 4
 $ q1   : num  100 89 60 85 40 20
 $ BL   : num  30 30 30 25 25 25
dftrt$id <- as.factor(dftrt$id)
dftrt$visit <- as.factor(dftrt$visit)
dftrt$BL <- as.numeric(as.character(dftrt$BL))
library(lme4)
df.lm <- lmer(formula =q1 ~ trt + BL +(1|id), data=dftrt)
library(car)
Anova(df.lm)
Analysis of Deviance Table (Type II Wald chisquare tests)

Response: q1
      Chisq Df Pr(>Chisq)    
trt 17.7895  2  0.0001371 ***
BL   5.4616  1  0.0194391 *