Skip to content
Prev 10504 / 20628 Next

Help with mixed models function

(I apologize if I'm not replying to the listserv correctly).

That worked for me (in a way). The lines below worked in my function
	linfcts2 <- eval(parse(text=paste("mcp(",paste(iv,' ="Tukey"
',collapse=','),')')));
	pairwise2 <- summary(glht(owobanova , linfct = linfcts2));

So I have the between subjects pairwise comparisons.  However, when I want
to compare the interaction between "iv" and "contrasts" I'm getting an
error. Below is my input and my error:
	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 'character'

-----Original Message-----
From: Hugo.Mildenberger at web.de [mailto:Hugo.Mildenberger at web.de] 
Sent: Tuesday, August 13, 2013 6:56 PM
To: Cody Likavec
Cc: r-sig-mixed-models at r-project.org
Subject: Re: [R-sig-ME] Help with mixed models function

Cody,

the mcp function from the multcomp package expects a named argument list,
not an array of strings: 

 iv        <- c('a','b','c')
 linfcts   <- eval(parse(text=paste("mcp(",paste(iv,'= "Tukey"
',collapse=','),')')));
 pairwise2 <- summary(glht(owobanova , linfct = linfcts));
 
Hugo 


On Tue, 13 Aug 2013 16:01:43 -0400
"Cody Likavec" <codylikavec at gmail.com> wrote:

            
--