hse_finite: hse_finite

Description Usage Arguments Details Value Examples

View source: R/herd_se.R

Description

Herd Sensitivity calculated with the assumption of a finite population

Usage

1
hse_finite(id, n_tested, N, test_Se, dp)

Arguments

id

The herdid.

n_tested

The number tested in each URG

N

The number of units in each of the URG

test_Se

The sensitivity of the test. This may have length == 1 if all URG and all herds have the same test_Se. It may also have length(test_Se) == length(n_tested).

dp

The design prevalence (dp) could be length(dp) == 1 if all URG and herds have the same dp. It could alternatively be length(dp) == length(n_tested) if different design prevalences are to be applied to each URG.

Details

Calculate the Herd sensitivity when multiple samples from individual units within the herd. The function uses the total population size to adjust the estimates consistent with a finite population. This method for calculation of HSe is typically used when greater than 10

Value

A data.frame. A dataframe is returned with 2 columns: "id" and HSe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
df <- data.frame(id = seq(1:20),
                 n_tested = rpois(20, 5),
                 N = 100,
                 test_Se = 0.3,
                 dp = 0.05)
## Calculate the herd level sensitivity for each of these herds
hse_finite(df$id,
           df$n_tested,
           df$N,
           df$test_Se,
           df$dp)

freedom documentation built on Sept. 8, 2020, 5:06 p.m.