Description Usage Arguments Value Examples
predict_hatchday
1 | predict_hatchday(fm, dat = Breeding(), ci = 0.95, days_below_lwr = 1.5)
|
fm |
fitted model (eg. by predict_hatchday_model () ) |
dat |
newdat for prediction |
ci |
lower CI |
days_below_lwr |
lower CI of the prediction - days_below_lwr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
d = Breeding()
fm = predict_hatchday_model(d)
d[, predHatch := predict_hatchday(fm, d,0.95, 1.5) ]
# check prediction
d[, missed := difftime(hatchDate, predHatch, units= 'days') %>% as.numeric]
d[, .N/nrow(d), by = missed < -1]
# check incubation duration
d[, incub := difftime(hatchDate, as.Date(firstEgg) + clutch, units= 'days')]
d[, range(incub)]
d[, quantile(incub)]
# check predicted incubation duration
d[, pincub := difftime(predHatch, as.Date(firstEgg) + clutch, units= 'days')]
d[, range(pincub)]
d[, quantile(pincub)]
plot(incub ~ pincub, d)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.