survey: Survey Simulations

Description Usage Arguments Details Value Examples

Description

The survey functions take an output from pop and simulate survey responses based on the method specified.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
census(
  x,
  resp,
  bias,
  fol = FALSE,
  fol_sample = NULL,
  fol_scale = NULL,
  times = 1
)

mand(
  x,
  resp,
  fol = FALSE,
  bias = NULL,
  fol_sample = NULL,
  fol_scale = NULL,
  times = 1
)

simple(x, sample, resp, bias, fol = FALSE, fol_scale = NULL, times = 1)

Arguments

x

An output from pop. It is the population to simulate response for.

resp

Probability/probabilities of response.

  • In simple() and census() it defines response probabilities for unsuccessful hunters.

  • In mand() it defines response probabilities for initial reporting, and then response probabilities for unsuccessful hunters in follow up samples.

bias

Scales the value(s) supplied to resp to create response probabilities for successful hunters. Introduces response bias for any value not equal to 1.

fol

Logical. If TRUE, a single follow up survey will be simulated.

fol_sample

Probability that a non-respondent is sampled for a follow up survey.

fol_scale

Scales initial response probabilities, creating new probabilities of response for follow up surveys.

times

The number of times to repeat the simulation.

sample

Probability a hunter is sampled for a survey

Details

More than one value can be supplied to resp and bias. These functions automatically create a full factorial design on these two arguments.

If any scaling arguments scale probabilities to be > 1, the probabilities will silently be limited to 1.

Value

A list of class survsim_census, survsim_mand, or survsim_simple where the length is equal to the integer supplied to times. The ultimate elements are data frames that will contain some, but not all, of these variables:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# First, create a population:
my_pop <- pop(N = 1000, split = 0.7, success1 = 0.25, success2 = 0.6)

# Simulate a simple random sample from that population:
simple(
  my_pop,
  sample = 0.4,
  resp = 0.3,
  bias = 1,
  times = 10
)

# Multiple values can be passed to 'resp' and 'bias' arguments to create
# simulations for each unique pairing of the two:
census(
  my_pop,
  resp = seq(0.3, 0.8, 0.1),
  bias = c(1, 1.1, 1.2),
  fol = TRUE,
  fol_sample = 0.4,
  fol_scale = 0.7,
  times = 10
)

peterdonati/hhss documentation built on Dec. 22, 2021, 7:45 a.m.