[R] Syntax of Levene's test

2006-08-02 Thread Paul Smith
Dear All

I am trying to use Levene's test (of package car), but I do not
understand quite well how to use it. '?levene.test' does not
unfortunately provide any example. My data are in a data frame and
correspond to 4 factors plus response. Could someone please give me an
example about how to use the command

levene.test(y, group)

?

Thanks in advance,

Paul

__
R-help@stat.math.ethz.ch mailing list
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.


Re: [R] Syntax of Levene's test

2006-08-02 Thread John Fox
Dear Paul,

The argument y is the response variable and group is a factor defining
groups (as ?levene.test says). If you have more than one factor, then you
can use interaction() to create from them a factor with levels given by the
product set of the levels of the individual factors. Here's an example

 library(car)
 data(Moore)
 attach(Moore)
 levene.test(conformity, interaction(fcategory, partner.status))
Levene's Test for Homogeneity of Variance
  Df F value Pr(F)
group  5  1.4694 0.2219
  39   
 levels(interaction(fcategory, partner.status))
[1] high.high   low.highmedium.high high.lowlow.low
[6] medium.low 
 levels(fcategory)
[1] high   lowmedium
 levels(partner.status)
[1] high low 

I'll add a couple of examples to the help page.

I hope this helps,
 John 


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith
 Sent: Wednesday, August 02, 2006 5:33 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] Syntax of Levene's test
 
 Dear All
 
 I am trying to use Levene's test (of package car), but I do 
 not understand quite well how to use it. '?levene.test' does 
 not unfortunately provide any example. My data are in a data 
 frame and correspond to 4 factors plus response. Could 
 someone please give me an example about how to use the command
 
 levene.test(y, group)
 
 ?
 
 Thanks in advance,
 
 Paul
 
 __
 R-help@stat.math.ethz.ch mailing list
 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.

__
R-help@stat.math.ethz.ch mailing list
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.


Re: [R] Syntax of Levene's test

2006-08-02 Thread Paul Smith
On 8/2/06, John Fox [EMAIL PROTECTED] wrote:
 The argument y is the response variable and group is a factor defining
 groups (as ?levene.test says). If you have more than one factor, then you
 can use interaction() to create from them a factor with levels given by the
 product set of the levels of the individual factors. Here's an example

  library(car)
  data(Moore)
  attach(Moore)
  levene.test(conformity, interaction(fcategory, partner.status))
 Levene's Test for Homogeneity of Variance
   Df F value Pr(F)
 group  5  1.4694 0.2219
   39
  levels(interaction(fcategory, partner.status))
 [1] high.high   low.highmedium.high high.lowlow.low
 [6] medium.low
  levels(fcategory)
 [1] high   lowmedium
  levels(partner.status)
 [1] high low

 I'll add a couple of examples to the help page.

Thanks, John. Now, I understand how to use levene.test. There is only
a question remaining: is the null hypothesis corresponding to
homogeneity of variances, i.e., should one conclude that

Levene's Test for Homogeneity of Variance
   Df F valuePr(F)
group  95  3.5919  2.2e-16 ***
  864

tell us that the hypothesis that the variances are equal is (highly)
significant?

Paul

__
R-help@stat.math.ethz.ch mailing list
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.


Re: [R] Syntax of Levene's test

2006-08-02 Thread John Fox
Dear Paul,

Levene's test tests the null hypothesis that the variance are equal, so a
small p-value suggests that they are not. Looking at your output, it seems
odd that you have as many as 96 groups.

John


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith
 Sent: Wednesday, August 02, 2006 5:02 PM
 To: r-help@stat.math.ethz.ch
 Subject: Re: [R] Syntax of Levene's test
 
 On 8/2/06, John Fox [EMAIL PROTECTED] wrote:
  The argument y is the response variable and group is a 
 factor defining 
  groups (as ?levene.test says). If you have more than one 
 factor, then 
  you can use interaction() to create from them a factor with levels 
  given by the product set of the levels of the individual factors. 
  Here's an example
 
   library(car)
   data(Moore)
   attach(Moore)
   levene.test(conformity, interaction(fcategory, partner.status))
  Levene's Test for Homogeneity of Variance
Df F value Pr(F)
  group  5  1.4694 0.2219
39
   levels(interaction(fcategory, partner.status))
  [1] high.high   low.highmedium.high high.low
 low.low
  [6] medium.low
   levels(fcategory)
  [1] high   lowmedium
   levels(partner.status)
  [1] high low
 
  I'll add a couple of examples to the help page.
 
 Thanks, John. Now, I understand how to use levene.test. There 
 is only a question remaining: is the null hypothesis 
 corresponding to homogeneity of variances, i.e., should one 
 conclude that
 
 Levene's Test for Homogeneity of Variance
Df F valuePr(F)
 group  95  3.5919  2.2e-16 ***
   864
 
 tell us that the hypothesis that the variances are equal is 
 (highly) significant?
 
 Paul
 
 __
 R-help@stat.math.ethz.ch mailing list
 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.

__
R-help@stat.math.ethz.ch mailing list
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.


Re: [R] Syntax of Levene's test

2006-08-02 Thread Paul Smith
On 8/3/06, John Fox [EMAIL PROTECTED] wrote:
 Levene's test tests the null hypothesis that the variance are equal, so a
 small p-value suggests that they are not. Looking at your output, it seems
 odd that you have as many as 96 groups.

Thanks again, John. I have 4 factors with 3, 4, 4 and 2 levels
(resulting in 96 groups), respectively. For each combination of the 4
factors, I have 10 observations.

Paul

__
R-help@stat.math.ethz.ch mailing list
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.