Thanks Zoltan R R-sig list members

I still with some doubts.

Is there a way to calculate in R the results for the equation

X2= n*[|ad-bc|-(p/2)]^2 / [(a+b)*(c+d)*(a+c)*(b+d)]

(see Legendre & Legendre pg 295 eq. 7.6)

for the following data:


ST01 ST02 ST03 ST04 ST05 ST06 ST07 ST08 ST09  SP1 1 1 1 1 1 0 0 1 1  SP2 1 1
0 1 0 1 0 1 0

We have a=4, b=3, c=1, d=1, N=9 and the 2x2 table for this example is



SP2


Presence Absent
 SP1 Presence 4 3
 Absent 1 1





Following the Chi square formula I got 110.25 / 280 = 0.3937

I have tried many things, without success.

Thanks in advance for any suggestion.

Antonio Olinto


2013/4/25 Zoltan Botta-Dukat <botta-dukat.zoltan@okologia.mta.hu>

> Dear Antonio,
>
> Try this:
>
> chisq.test(table(sp1,sp2))
>
> Best wishes
>
> Zoltan
>


> >
> > On Wed, Apr 24, 2013 at 6:02 PM, Antonio Silva <aolinto.lst@gmail.com
> >wrote:
> >
> >> Hi,
> >>
> >> I'm trying to use Pearson's Chi-squared to verify the dependence among
> >> species distribuion.
> >>
> >> I have a dataframe with the presence/absence data of two species in a
> >> number of sample units
> >>
> >> The equation I'm using is:
> >>
> >> X2= p*(|ad-bc|-p/2)^2 / ((a+b)*(c+d)*(a+c)*(b+d))
> >>
> >> where a is the number of double presence (1-1), b is the number of 1-0,
> c
> >> is the number of 0-1 and d is the number of 0,0 (double absence)
> >> p is a+b+c+d
> >>
> >> Is there a function to caltulate it using R? I could not understand how
> to
> >> use chisq.test function for this.
> >>
> >> Thanks in advance.
> >>
> >> Antonio Olinto
>
>
> --
>
> Zoltán BOTTA-Dukát
> --------------------------------
> Institute of Ecology and Botany
> Hungarian Academy of Sciences
> Centre for Ecological Research
> --------------------------------
> H-2163 Vácrátót, Alkomány u. 2-4.
> HUNGARY
> Phone: +36 28 360122/157
> Fax..: +36 28 360110
> botta-dukat.zoltan@okologia.mta.hu
> www.okologia.mta.hu
>

	[[alternative HTML version deleted]]

