Hello,
I have a fitted detection function model for a bird from line transect data with two covariates: Year (a factor with 20 levels) and Behavior (a factor with two levels: Rest or Fly). For simplicity, I'd like to plot the model to show the overall detection function, as well as the mean/median of each Behavior for all Years. I see some information alluding to this in the description of add_df_covar_line(), but I'm not sure how to execute it. I'm able to plot the two Behaviors for any specific Year:
my.ddf <- ds(my.data, key="hr", formula = ~as.factor(Year)+as.factor(Behavior)....)
plot_year<-2021 #example year
plot(my.ddf, showpoints=FALSE)
add_df_covar_line(my.ddf, data.frame(Year=plot_year, Behavior="Rest"), lty=1,col="blue")
add_df_covar_line(my.ddf, data.frame(Year=plot_year, Behavior="Fly"), lty=1,col="red")
But how might I plot the median/mean value for each Behavior for all Years? Similarly, I'd be interested in generating an average probability of detection for each Behavior for all Years, for reporting.
Thanks for any help!
-Jon