[R] SpreadLevelPlot for more than one factor

Fox, John jfox at mcmaster.ca
Sun Jan 14 16:35:34 CET 2018


Dear Ashim,

I’ll address your questions briefly but they’re really not appropriate for
this list, which is for questions about using R, not general statistical
questions. 

(1) The relevant distribution is within cells of the wool x tension
cross-classification because it’s the deviations from the cell means that
are supposed to be normally distributed with equal variance. In the
warpbreaks data there are only 9 cases per cell. If you examine all of
these deviations simultaneously, that’s equivalent to examining the
residuals from the two-way ANOVA model fit to the data.

(2) Yes, (d) and (e) visualize simple effects, and (a) and (b) visualize
main effects, the latter only because the data are balanced.

Best,
 John

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




On 2018-01-09, 10:18 AM, "Ashim Kapoor" <ashimkapoor at gmail.com> wrote:

>Dear Sir,
>
>
>Many thanks for your reply.
>
>
>I have a query.
>
>
>
>I have a whole set of distributions which should be made normal /
>homoscedastic. Take for instance the warpbreaks data set.
>
>
>
>We have the following boxplots for the warpbreaks dataset:
>
>
>a. boxplot(breaks ~ wool)
>
>b. boxplot(breaks ~ tension)
>
>c. boxplot(breaks ~ interaction(wool,tension))
>d. boxplot(breaks ~ wool @ each level of tension)
>e. boxplot(breaks ~ tension @ each level of wool)
>
>
>Now should we not be making a-e normal and homoscedastic? Should we not
>make a giant collection of boxplots from a-e and use the SpreadLevelPlot
>on this entire collection?
>
>
>A second query : (d) and (e) are the distribution of the simple effects
>of factor wool and tension @ each level of the other. Is that correct?
>Are (a) and (b) the distribution of the main effect of wool and tension?
>Please confirm.
>
>
>
>Best Regards,
>Ashim
>
>
>
>
>
>
>
>
>
>On Sun, Jan 7, 2018 at 8:05 PM, Fox, John
><jfox at mcmaster.ca> wrote:
>
>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/ <http://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
><https://stat.ethz.ch/mailman/listinfo/r-help>
>> PLEASE do read the posting guide
>http://www.R-project.org/posting- <http://www.R-project.org/posting->
>> guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>
>
>
>



More information about the R-help mailing list