Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/rdraws_rpvals.R

Approximates a p-value for a hypothesis test of the Bailey estimator by means of many simulated draws from the null distribution, conditioned on sample sizes.

1 2 |

`estN` |
The estimated abundance. Either this or the number of recaptures
( |

`nullN` |
The abundance given by the null hypothesis |

`n1` |
Number of individuals captured and marked in the first sample |

`n2` |
Number of individuals captured in the second sample |

`m2` |
Number of recaptures. Either this or the estimated abundance
( |

`nsim` |
Number of simulated values to draw. Defaults to 100000. |

`alternative` |
Direction of the alternative hypothesis. Allowed values
are |

An approximate p-value for the specified hypothesis test. If
`m2`

is specified rather than `estN`

, output will be returned as
a list with two elements: the estimated abundance and p-value.

Any Petersen-type estimator (such as this) depends on a set of assumptions:

The population is closed; that is, that there are no births, deaths, immigration, or emigration between sampling events

All individuals have the same probability of capture in one of the two events, or complete mixing occurs between events

Marking in the first event does not affect probability of recapture in the second event

Individuals do not lose marks between events

All marks will be reported in the second event

Matt Tyers

NBailey, vBailey, seBailey, rBailey, powBailey, ciBailey

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ```
output <- pBailey(nullN=500, n1=100, n2=100, m2=28)
output
plotdiscdensity(rBailey(length=100000, N=500, n1=100, n2=100))
abline(v=output$estN, lwd=2, col=2)
abline(v=500, lwd=2, lty=2)
output <- pBailey(nullN=500, n1=100, n2=100, m2=28, alternative="2-sided")
output
plotdiscdensity(rBailey(length=100000, N=500, n1=100, n2=100))
twosided <- 500 + c(-1,1)*abs(500-output$estN)
abline(v=twosided, lwd=2, col=2)
abline(v=500, lwd=2, lty=2)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.