Good day Melissa and Eric,
When we include only the ds element of the fitted model, the added lines always reach p = 1 at distance 0 (because we're ignoring the MR model). Eric's example works well because in the book.tee.data, the pooled probability of detection is very close to 1, so the plot looks OK because the originally plotted line reaches p = 1.0. When I try it where p(0) from the MR model is closer to 0.85 the inconsistency between the original plot and the added lines is more apparent and so the plot is less useful.
plot(mrds.model, which = 3, showpoints = F, lwd = 1, breaks = seq(0, 2000, 200))
add.df.covar.line(mrds.model$ds, data = data.frame(SUNANGLE = 1), lty = 2)
add.df.covar.line(mrds.model$ds, data = data.frame(SUNANGLE = 2), lty = 3)
legend(1200, 1, c("Average", "No glare", "Glare"), lty = 1:3, bty = "n")
We can correct the plot to show the effect of the covariate on only the ds model by including only the ds element in the call to ds.plot, but this isn't ideal either when p(0) from the fitted MRDS model is < 1.0.
plot(mrds.model$ds, showpoints = F, lwd = 1, breaks = seq(0, 2000, 200))
add.df.covar.line(mrds.model$ds, data = data.frame(SUNANGLE = 1), lty = 2)
add.df.covar.line(mrds.model$ds, data = data.frame(SUNANGLE = 2), lty = 3)
legend(1200, 1, c("Average", "No glare", "Glare"), lty = 1:3, bty = "n")
I'd like to start with a plot of the MRDS model with p(0) < 1, then subtract 1 - Average combined p(0) from the y-values when calling add.df.covar.line(), but I wasn't able to do that because I wasn't able to save or assign the result of calling plot.ds()
> ds.plot = plot(mrds.model$ds)
> ds.plot
NULL
Any suggestions would be welcome. I may try to calculate y-values from the DS submodel manually (using formulae for half-normal and hazard rate functions and covariate coefficients), then subtract 1 - p(0) from the y-values for plotting.
All the best,
Eric H