[R-sig-ME] Help with mixed models function

Hugo.Mildenberger at web.de Hugo.Mildenberger at web.de
Fri Aug 16 11:06:59 CEST 2013


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:

> Does anyone else have any input on the interaction pairwise comparison?
> 
> (Below is the portion that errors out in my function)
> 
>  
> 
>                 linfcts3 <-
> eval(parse(text=paste("mcp(",paste(iv,'*',contrasts,'
> 
> ="Tukey" ',collapse=','),')')));
> 
>                 pairwise3 <- summary(glht(owobanova , linfct = linfcts3));
> 
>  
> 
> Error in paste(iv, "*", contrasts, " =\"Tukey\" ", collapse = ",") : 
> 
>   cannot coerce type 'closure' to vector of type 'Charakter'
> 
>  
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models


--



More information about the R-sig-mixed-models mailing list