crosstabanalysis: Presence-absence Analysis by Cross Tabulation

Description Usage Arguments Value Author(s) References Examples

Description

This function makes a cross-tabulation of two variables after transforming the first variable to presence-absence and then returns results of chisq.test.

Usage

1

Arguments

x

Data set that contains the variables "variable" and "factor".

variable

Variable to be transformed in presence-absence in the resulting cross-tabulation.

factor

Variable to be used for the cross-tabulation together with the transformed variable.

Value

The function returns the results of chisq.test on a crosstabulation of two variables, after transforming the first variable to presence-absence first.

Author(s)

Roeland Kindt

References

Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies.

https://www.worldagroforestry.org/output/tree-diversity-analysis

Examples

1
2
3
library(vegan)
data(dune.env)
crosstabanalysis(dune.env,"Manure","Management")

Example output

Loading required package: tcltk
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-4
BiodiversityR 2.11-1: Use command BiodiversityRGUI() to launch the Graphical User Interface; 
to see changes use BiodiversityRGUI(changeLog=TRUE, backward.compatibility.messages=TRUE)

Warning message:
no DISPLAY variable so Tk is not available 

	Pearson's Chi-squared test

data:  cross
X-squared = 20, df = 3, p-value = 0.0001697

Warning message:
In chisq.test(cross) : Chi-squared approximation may be incorrect

BiodiversityR documentation built on April 20, 2021, 5:07 p.m.