[R] levene.test

Peter Ehlers ehlers at ucalgary.ca
Wed Jul 14 14:24:45 CEST 2010


On 2010-07-14 6:07, martanair wrote:
>
> 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 1 factor plus response. Could
> someone please give me an example about how to use the command
>
> levene.test(y, group)
>
> Thanks in advance,
>
> marta
>
> filedati=read.table("filedati.txt",header=TRUE)
> filedati
> modello=aov(filedati$y ~ filedati$fertilizzante)
> anova(modello)
> str(filedati$fertilizzante)
> filedati$fertilizzante=factor(filedati$fertilizzante)
> filedati$fertilizzante
> library(car)
> levene.test(filedati$y , filedati$fertilizzante)
>
>
>
>
> filedati
>   fertilizzante	x	y
> 1	55	502
> 1	60	532
> 1	48	525
> 1	44	444
> 1	63	527
> 1	60	531
> 1	50	478
> 1	56	530
> 1	54	547	
> 2	100	619
> 2	75	425
> 2	52	400
> 2	62	418
> 2	68	449
> 2	86	525
> 2	57	470
> 2	82	506
> 2	72	507
> 2	88	495
> 2	55	393
> 2	67	515
> 2	45	382
> 2	103	570
> 2	103	611
> 2	84	473
>

You could consider using the Fligner-Killeen test in base R.
See ?fligner.test.

   -Peter Ehlers



More information about the R-help mailing list