# post-hoc interaction following lme with both categorical and continuous factors.

#### maryska

##### New Member
Hello,

I'm relatively new to R and have run into some problems. Hoping someone can help!

I'm using lme on a model with several, both within/between, categorical/continuous and fixed/random effects. I have 1 x fixed 2-level categorical between-subjects variable "group" (dose vs. placebo), 1 x fixed 3-level categorical within-subjects variable "condition" (c1, c2, c3), 2 x fixed continuous between-subjects variables, from personality questionnaires, "SQ" and "EQ" (Systemising Quotient and Empathising Quotient), and 1 x random effect variable "id" (subject id). My outcome variable is "speed". Here's my model.

model = lme(speed~group*condition*SQ*EQ*, random = ~1|id, data = data, na.action = "na.omit")
anova(model).

So far so good, I get the predicted interaction between group and condition, but no effect of the continuous personality factors. My problem is when trying to investigate the interaction (condition*group) with post-hoc tests. I've tried using several different functions, lsmeans (from lsmeans package), summary(glht), testInteractions (from phia package) etc. But I'm always getting an error, or R outputs NAs.
Interestingly, I have no problem getting the post-hoc results if I exclude the two continuous variables (SQ and EQ) from the model. Can someone tell me what I'm doing wrong, and how to get the post-hoc test results for my full model?

Here are some of the error messages:
lsmeans(model, pairwise~group*condition): outputs NAs.

testInteractions(model, fixed = "condition", across = "group", adjustment = "bonferroni"):
Error in [.data.frame(model\$data, names(attr(mt, "dataClasses"))) :
undefined columns selected

Any help would be much appreciated! Thanks