[R] SpreadLevelPlot for more than one factor

Fox, John
Sun, 07 Jan 2018 14:35:15 -0000

Dear Ashim,

Try spreadLevelPlot(breaks ~ interaction(tension, wool), data=warpbreaks) .

I hope this helps,
 John

-----------------------------
John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
Web: socialsciences.mcmaster.ca/jfox/



> -----Original Message-----
> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Ashim
> Kapoor
> Sent: Sunday, January 7, 2018 12:08 AM
> To: r-help at r-project.org
> Subject: [R] SpreadLevelPlot for more than one factor
>
> Dear All,
>
> I want a transformation which will make the spread of the response at  all
> combinations of  2 factors the same.
>
> See for example :
>
> boxplot(breaks ~ tension * wool, warpbreaks)
>
> The closest I  can do is :
>
> spreadLevelPlot(breaks ~tension , warpbreaks) spreadLevelPlot(breaks ~ wool
,
> warpbreaks)
>
> I want to do :
>
> spreadLevelPlot(breaks ~tension * wool, warpbreaks)
>
> But I get :
>
> > spreadLevelPlot(breaks ~tension * wool , warpbreaks)
> Error in spreadLevelPlot.formula(breaks ~ tension * wool, warpbreaks) :
>   right-hand side of model has more than one variable
>
> What is the corresponding appropriate function for 2 factors ?
>
> Many thanks,
> Ashim
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-
> guide.html
> and provide commented, minimal, self-contained, reproducible code.