Skip to content
Prev 10511 / 20628 Next

Help with mixed models function

Cody,

I'm still missing a self-contained, reproducible example. In the meantime, your problem is now that
"contrasts" isn't defined within the scope of your function, but (probably) within your data frame 
"myexpr.df". Thus paste() can not see the definition, and hence the error: "cannot coerce type 
'closure' to vector of type 'character'"

Besides that, variable names addressing model variables within the linfct parameter of multcomp::glht() 
must match the names returned by coef(model). Thus it would suprise me if mcp(`a*C`='Tukey') actually
worked, even if you actually had quoted the parameter name (this is likely your next problem 
once you fixed the problem concerning "contrasts"). 

The examples reachable via vignette(package='multcomp','multcomp-examples') are worth considering. mcp 
is only a convenience function. You can always generate a tailored set of comparisons, e.g. 
 
 linfct = c('`b:c1` - `a:c1` > 0',
            '`c:c2` - `a:c2` < 0',
            '`d:c1` - `a:c1` = 0')

  
Hugo Mildenberger
  


On Thu, 15 Aug 2013 16:28:27 -0400
"Cody Likavec" <codylikavec at gmail.com> wrote:

            
--