2

I have two conditions, A and B (see the figure below).

I want to test if these conditions are different each other, if condition A is different from 0 and if condition B is different from 0.

I'd like to accomplish this task using a linear mixed model, because I want to consider random effects.

This is my model:

lm<-lmer(x~conditionr +(1|block) + (1|subj) , data=data, REML = FALSE)

This is the output:

            Estimate Std. Error         df t value Pr(>|t|)    
(Intercept)   -0.08554    0.01745    4.00000  -4.903  0.00781 ** 
   B          0.18395    0.03456 1002.70000   5.323 1.26e-07 ***

So, I found a difference between A and B. A (Intercept) is different from 0.

However, I don't know: 1) how to test if B is different from zero. 2) is it possible that the df of intercept is 4? it sounds a bit strange for me..

Thanks in advance BR

enter image description here

piravi
  • 111
  • 2
  • 5
  • In this case you can suppress the intercept: `x ~ 0 + conditionr +(1|block) + (1|subj)` . But the `multcomp` package allows for more complex tests: `library(multcomp) ; summary(glht(m, matrix(c(1, 1), 1)))` – user2957945 Apr 18 '17 at 14:36
  • 1
    Very thanks! Could a contrast matrix like this work? K – piravi Apr 18 '17 at 15:58
  • Yes, but I think the final row of K should be c(1,1) if you want to test if B=0 for the model with the intercept included (as in your question). Otherwise, c(1,-1) can be used for the difference for the model with intercept suppressed – user2957945 Apr 18 '17 at 17:28
  • of interest https://stats.stackexchange.com/questions/204741/which-multiple-comparison-method-to-use-for-a-lmer-model-lsmeans-or-glht – user2957945 Apr 18 '17 at 19:44

0 Answers0