Simulate known fate or apparent survival data via a HMM, with or without interval censoring or right censoring. The default parameter values simulate survival data without interval or right censoring.
Arguments
- S.int
the interval survival probability
- nind
the number of individuals
- ntime
the length of the encounter histories
- p.obs
detection probability for imperfect detection
- last.obs
TRUE or FALSE. Is the terminal time interval observed. Typically TRUE in nest survival studies.
- obs.start
TRUE or FALSE, if true, all individuals are observed at time =1, otherwise. all individuals may not be observed until later in their encounter history, or not at all before failing. They are not removed from the data object and must be excluded before use in analysis.
- censor.parms
a vector of length 2, giving the probability an individual is censored and the probability defining the time an individual is censored. The time of censoring is generated by a binomial where the maximum length of the encounter history is the number of trials and the second parameter is the probability. The default values prevent any individual from being censored. Here, censoring is a known event (i.e. a known transmitter failure, drop, etc.)
- visit.parms
a vector of length 2, giving a "maximum probability" of a visit and the number of days over which to consider. The probability of a visit is calculated according to the formula below.
- type
LOGEXP, KF, CJS, SURV or RAW, the default. Controls the type of output provided (described below)
Value
type==CJS- A wide matrix of 1,0; apparent survival.
type==KF- a wide matrix of 1(live), and 2(dead); A multi-state HMM
type==LOGEXP- along data frame formatted for logistic exposure; known fate
type==SURV- a long data frame of entry time, last observation, and if the observation was censored or an event was observed-suitable for survival analysis using the survival program.
type==RAW- Raw observation matrix, visit matrix, detection matrix, and vectors describing the first and last time intervals for which and individual should be included, that last interval they were observed alive, as well as a vector indicating which individuals are censored and when.
Details
Known-fate data requires individuals are observable in a dead state. When individuals cannot be observed in a dead state and detection is imperfect, apparent survival is the result.
Interval censoring is accomplished by including a visit probability. This will inherently lead to right-censoring, but here, the observation at the last time interval can be fixed to 1 and right censoring is simulated alternatively by providing censoring parameters. Thus, when there is no explicit right censoring, all dead individuals are observed dead at least one time, unless "CJS" is selected as the output format.
The visit probability is not an independent random probability. It's constructed such that given a "maximum" visit probability Q and a time window W the probability of a visit at time t (\(p_t\)) is: $$\sum\limits_{t-W}^{t-1}{\substack{1\ if\ a\ visit\ occurred\\ 0\ if\ no\ visit}} = K\\ p_t=Q^{3K}$$ This way, if there hasn't been a visit in W days, one will occur with a probability = Q. If there has been > 1, then the probability drops off dramatically.
Right censoring is created by providing two probabilities. The first defines the probability any individual will be censored. The second is used in a binomial probability where n_trials is the length of the observation period. While true right censoring can occur at any time, this better simulates more common causes of right censoring, like transmitters failing at the end of battery life. Encounter matrices are generated for the full time series, but right censored observations are indicated by a negative value. To avoid issues in analysis, vectors indicating the time when an individual is first observed and when and individual "leaves" the study (if known) are provided.