sim_zib_data: Simulate zero-inflated binomial data

Description Usage Arguments Value Examples

Description

Simulate zero-inflated binomial data

Usage

1
sim_zib_data(n_sites, n_samples, p_oc, p_dt, seed = 42)

Arguments

n_sites

Number of sites to simulate

n_samples

Number of observations at each site

p_oc

Probability of occupancy at site

p_dt

Probability of detection at site conditional on site being occupied

seed

Set the seed for reproduciability

Value

A data.frame of simulated data with n_sites rows and three columns. An occupied_sites column with 0 if site is not occupied and 1 if occupied; an n_tests column, which indicates the number of times each site was sampled (all values in this column will be equal to n_samples, and will be used in calculating the likelihood); and an obs_counts column, which has the number of times a detection occurred (values will be 0 to a maximum of n_smaples)

Examples

1
maldetectr::sim_zib_data( n_sites = 10, n_samples = 5, p_oc = 0.2, p_dt = 0.8 )

andersgs/maldetectr documentation built on May 12, 2019, 2:41 a.m.