g.test: Replicated G-tests of goodness-of-fit

Description Usage Arguments Details Value References Examples

Description

Perform replicated G-tests of goodness-of-fit to assess symmetry of parasitic infections.

Usage

1
g.test(x)

Arguments

x

a matrix or data frame with two numeric columns; first column is for left-side and 2nd column for right-side. Identifiers for hosts can be provided as row names.

Details

This function implements Sokal & Rohlf's (1995) G-test for the specific case of an expected 1:1 ratio The function takes as its argument a matrix or data frame with two numeric columns; first column is for left-side and 2nd column for right-side. Identifiers for hosts can be provided as row names. Uninfected hosts (zero count for both left and right sides) are ignored. Cannot be applied to data containing zero counts; use eb.test instead.

Value

A list containing two data.frames:

summary

results of total, heterogeneity and pooled G-tests. Data frame has four columns: test, degrees of freedom, G-statistic and p-value.

hosts

results of individual G-tests on distribution of parasites in each host. Data frame has seven columns: Host (ID), Left (count of parasites on left side), Right (count of parasites on right side), G (G-statistic), p (p-value), BH (p-value adjusted using Benjamini and Hochberg's procedure for controlling the false discovery rate) and Holm (p-value adjusted using Holm's method).

References

R.R. Sokal & F.J. Rohlf (1995) Biometry. 3rd Edition. New York: W.H. Freeman and Company. 887 pp.

Examples

1

Example output

$summary
           Test df          G            p
1        Pooled  1   8.189282 4.213860e-03
2 Heterogeneity 49 437.827514 7.448961e-64
3         Total 50 446.016796 5.819378e-65

$hosts
   Host Left Right            G            p           BH         Holm
1     1   86    99 9.142668e-01 3.389848e-01 4.524025e-01 1.000000e+00
2     2  131   199 1.411301e+01 1.721493e-04 1.434578e-03 7.746721e-03
3     3  195   133 1.179032e+01 5.953952e-04 3.307751e-03 2.500660e-02
4     4  128   167 5.171057e+00 2.296624e-02 5.500255e-02 7.119533e-01
5     5  192   211 8.961138e-01 3.438259e-01 4.524025e-01 1.000000e+00
6     6  212   278 8.916873e+00 2.825478e-03 8.310230e-03 9.606626e-02
7     7  451   474 5.719508e-01 4.494847e-01 5.481521e-01 1.000000e+00
8     8  323   312 1.905607e-01 6.624504e-01 6.900524e-01 1.000000e+00
9     9  394   305 1.136272e+01 7.493296e-04 3.746648e-03 3.072252e-02
10   10  222   270 4.690384e+00 3.033187e-02 6.893606e-02 8.796241e-01
11   11  603   356 6.434003e+01 1.046968e-15 2.617421e-14 5.130144e-14
12   12  209   278 9.809155e+00 1.736453e-03 6.678666e-03 6.598522e-02
27   27  252   202 5.517794e+00 1.882398e-02 4.953680e-02 6.023674e-01
28   28  295   341 3.329951e+00 6.802891e-02 1.308248e-01 1.000000e+00
46   46  474   539 4.173647e+00 4.105734e-02 8.553613e-02 1.000000e+00
47   47  236   230 7.725535e-02 7.810519e-01 7.969917e-01 1.000000e+00
13   13  402   162 1.054575e+02 9.695447e-25 4.847724e-23 4.847724e-23
14   14  252   324 9.023585e+00 2.665181e-03 8.310230e-03 9.328134e-02
15   15  321   266 5.160889e+00 2.310107e-02 5.500255e-02 7.119533e-01
16   16  264   239 1.243057e+00 2.648827e-01 3.678927e-01 1.000000e+00
17   17  225   192 2.614243e+00 1.059080e-01 1.961260e-01 1.000000e+00
18   18  181   210 2.152872e+00 1.423035e-01 2.362594e-01 1.000000e+00
19   19  475   434 1.849912e+00 1.737936e-01 2.715525e-01 1.000000e+00
20   20  259   194 9.358982e+00 2.218954e-03 7.396514e-03 7.988235e-02
21   21  184   209 1.591405e+00 2.071255e-01 3.045963e-01 1.000000e+00
22   22  303   358 4.581695e+00 3.231524e-02 7.025052e-02 9.048267e-01
23   23  159   253 2.163665e+01 3.294945e-06 3.294945e-05 1.515675e-04
24   24  152   143 2.746189e-01 6.002501e-01 6.524457e-01 1.000000e+00
25   25  162   152 3.185252e-01 5.724953e-01 6.361059e-01 1.000000e+00
26   26  451   363 9.532132e+00 2.019054e-03 7.210908e-03 7.470501e-02
29   29  361   281 9.994808e+00 1.569822e-03 6.540925e-03 6.122306e-02
35   35  334   284 4.049732e+00 4.417835e-02 8.835670e-02 1.000000e+00
36   36  398   502 1.204467e+01 5.194075e-04 3.246297e-03 2.233452e-02
37   37  223   250 1.542064e+00 2.143108e-01 3.061583e-01 1.000000e+00
38   38  273   253 7.606396e-01 3.831284e-01 4.789105e-01 1.000000e+00
39   39  351   283 7.307424e+00 6.867031e-03 1.907509e-02 2.266120e-01
40   40  473   327 2.679491e+01 2.262320e-07 2.827900e-06 1.063290e-05
41   41  311   294 4.777488e-01 4.894438e-01 5.691207e-01 1.000000e+00
42   42  372   353 4.979880e-01 4.803855e-01 5.691207e-01 1.000000e+00
43   43  224   256 2.134916e+00 1.439783e-01 2.362594e-01 1.000000e+00
50   50  315   293 7.962264e-01 3.722240e-01 4.772103e-01 1.000000e+00
30   30  345   257 1.291000e+01 3.268319e-04 2.334513e-03 1.438060e-02
31   31  278   417 2.798836e+01 1.220471e-07 2.034119e-06 5.858263e-06
32   32  477   462 2.396268e-01 6.244758e-01 6.643359e-01 1.000000e+00
33   33  259   227 2.108521e+00 1.464808e-01 2.362594e-01 1.000000e+00
34   34  373   389 3.359827e-01 5.621573e-01 6.361059e-01 1.000000e+00
44   44  589   586 7.659583e-03 9.302589e-01 9.302589e-01 1.000000e+00
45   45  452   413 1.758978e+00 1.847521e-01 2.799274e-01 1.000000e+00
48   48   73   119 1.112876e+01 8.499920e-04 3.863600e-03 3.399968e-02
49   49  352   395 2.476603e+00 1.155516e-01 2.063421e-01 1.000000e+00

aspi documentation built on May 2, 2019, 5:08 a.m.