Dear Antonio,

Try this:

chisq.test(table(sp1,sp2))

Best wishes

Zoltan

2013.04.25. 2:05 keltezéssel, José Hidasi írta:
> Hello Antonio,
>
> I imagined something like this:
>
>                               sp 1           sp 2
> area 1                   1                  1
> area 2                   1                  1
> area 3                   0                  0
> area 4                   1                  1
> area 5                   0                  0
>
> Maybe you could calculate a spearman correlation coefficient. In this
> example, it would be equal to 1. Therefore, there is a sp2 in every area
> there is a sp1.
>
> Also, I think it is possible to consider Cohen's Kappa or Kendall's W
> coefficients/tests. Moreover, I think Kendall's W results are generally
> similar to Spearman coefficients.
>
> I don't work with associations, but that is just an idea. Maybe someone
> else can figure out how to do that with the 'chisq.test' function.
>
>
> All the best,
> José
>
>
>
> 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
>>
>>          [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-ecology mailing list
>> R-sig-ecology@r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
>>
>
>
>
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


-- 
Botta-Dukát Zoltán
--------------------------------
Ökológiai és Botanikai Intézet
Magyar Tudományos Akadémia
Ökológiai Kutatóközpont
--------------------------------
2163. Vácrátót, Alkotmány u. 2-4.
tel: +36 28 360122/157
fax: +36 28 360110
botta-dukat.zoltan@okologia.mta.hu
www.okologia.mta.hu


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]]

