Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predict.moult

Predict method for moult models


Description

Predict either the proportion of birds in a certain moult stage (as defined in intervals) on a specified day, the average moult score on a specified day, or start and/or duration of moult for given covariate patterns

Usage

## S3 method for class 'moult'
predict(object, newdata, predict.type = "prob",
  intervals = 0.1, ...)

Arguments

object

moult model objects

newdata

optional dataframe with explanatory variables for which to make predictions. Note the first column must contain the days (as used when fitting) for which to make predictions.

predict.type

specifies form of predictions, see details.

intervals

length of moult categories for which probabilities/proportions should be calculated. The default (= 0.1) will calculate the probability that a bird will fall in this moult category on the specified day for each of the following categories: 0, (0, 0.1), [0.1, 0.2), [0.2, 0.3), ..., [0.9, 1.0), 1.

...

other arguments passed to the predict method

Details

predict.type has the following options:

"response"

the average moult index (proportion of feather mass grown) for each of the days specified.

"prob"

default, the proportion of birds in each of the moult categories as defined by intervals is predicted.

"duration"

predicts the duration of moult for the covariate combinations defined in newdata, with standard errors.

"start"

predicts the mean start date of moult for the covariate combinations defined in newdata, with standard errors.

"both"

predicts both mean start date of moult and duration of moult for the covariate combinations defined in newdata, with standard errors. Also, covariance of duration and start date estimates is given.

Value

M

If predict.type = "response", or newdata is missing, the expected moult scores at the specified days are returned.

If predict.type = "prob" a matrix of predicted probabilities for being in each of the moult categories defined by intervals.

If predict.type equals "start" or "duration" or "both", the corresponding estimates (with standard errors) for each of the covariate patterns are returned.

Author(s)

Birgit Erni <birgit.erni@uct.ac.za>

References

Erni, B., Bonnevie, B. T., Oschadleus, H.-D., Altwegg, R. and Underhill, L. G. (2013) moult: An R package to analyze moult in birds. Journal of Statistical Software, 52(8), 1–23. http://www.jstatsoft.org/v52/i08/

Underhill, L. G. and Zucchini, W. (1988) A model for avian primary moult. Ibis 130, 358–372.

Underhill, L. G. and Zucchini, W. and Summers, R. W. (1990) A model for avian primary moult-data types based on migration strategies and an example using the Redshank Tringa totanus. Ibis 132, 118–123.

See Also

Examples

data(sanderlings)

m2 <- moult(MIndex ~ Day, data = sanderlings)                     
m3 <- moult(MIndex ~ Day, data = sanderlings, type = 3)           

## number of birds observed on each of the days
(nn <- as.numeric(table(sanderlings$Day)))

## unique observation days 
(day <- unique(sanderlings$Day))

## Table 6 in Underhill and Zucchini 1988
## expected number of birds in each moult stage on each day
p1 <- predict(m2, newdata = data.frame(day))        
p1$M * nn						

## Table 7 in Underhill and Zucchini 1988
## expected number of birds in each moult stage for days 70 to 310
days2 <- seq(70, 310, by = 10)
p2 <- predict(m2, newdata = data.frame(days2))
p2$M * 100        
                    
(p3 <- predict(m3, newdata = data.frame(day)))

moult

Models for Analysing Moult in Birds

v2.1.0
GPL-2
Authors
Birgit Erni <birgit.erni@uct.ac.za>. Based on models developed by Underhill and Zucchini (1988, 1990).
Initial release
2017-12-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.