Hi Dawn, list,
In some situations it causes no bias to drop the observations with
missing distances. An example is where you are only interested in a
global density estimate and you can be sure that none of the
observations with missing distances were actually at 0 distance. In
this case, dropping the observations with missing distances will cause
the estimated detection function to decline more quickly with increasing
distance, resulting in a lower estimated p. So you have a lower n
because you discarded some observations, a lower p because you discarded
some observations, and the two balance out.
However, you are likely not in that situation, because it sounds like
you are interested in trends over time as well as over space, and there
was more missing data in the past than in the present. All the same, if
you know the missing observations were not at zero distance, and you
have a time covariate in your detection function, it will still likely
be fine just to drop those observations.
In general though, I appreciate it's not ideal to drop observations,
even if it's only a small number. So ideally you'd like to fit a
detection function to the observations that have distances and then
apply the dsm to all observations, under the assumption that the
observations without distances are missing at random with respect to
detectability (given the non-distance covariates).
I'm afraid there's nothing that I know of built into dsm to allow for
this. (Please someone else correct me if you know otherwise!) However,
I do think we can trick dsm into doing what you want, as follows:
- Use ds (or ddf) to fit the detection function you want
- Manually add the detections with missing distances into the fitted
dsmodel object. This part is quite painful as it involves messing
around deep inside the fitted object
- Pass the altered dsmodel object into dsm, together with an
observation.data data frame that contains the detections with missing
distances (with the distances set to some arbitrary value, less than the
truncation width but not NA)
I have written some demonstration code that works, but without
covariates. I'm happy to send it to you if you contact me, and also to
work on a more realistic version with covariates for your dataset.
Medium term it would be helpful to make this code public so others can
use it - although a better long-term plan would be to incorporate this
functionality into the dsm package. I can raise a feature enhancement
request but given current programmer resources it may be some time
before we get to it. Anyway, let's correspond off the list, and post
back once we've agreed a solution.
With best wishes, Len Thomas
--
I am a member of the University and College Union and am currently
participating in industrial action to improve UK higher education
staff pension, pay, equality and working conditions. For more
information, please see
https://www.ucu.org.uk/article/12469/FAQs#USS_pensions_dispute
and
https://www.ucu.org.uk/article/12469/FAQs#Pay_and_working_conditions_dispute
--
Len Thomas (he/him)
len.t...@st-andrews.ac.uk lenthomas.org @len_thom
Centre for Research into Ecological and Environmental Modelling
and School of Mathematics and Statistics
The Observatory, University of St Andrews, Scotland KY16 9LZ
Office: UK+1334-461801 Admin: UK+1334-461842
While I may be sending this email outside of my normal office hours,
I have no expectation to receive a reply outside of yours.
The University of St Andrews is a charity
registered in Scotland, No SC013532.