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

imputeMissing

A function to impute missing entries in continuous obsCovs


Description

This function uses an ad-hoc averaging approach to impute missing entries in obsCovs. The missing entry is replaced by an average of the average for the site and the average for the visit number.

Usage

imputeMissing(umf, whichCovs = seq(length=ncol(obsCovs(umf))))

Arguments

umf

The data set who's obsCovs are being imputed.

whichCovs

An integer vector giving the indices of the covariates to be imputed. This defaults to all covariates in obsCovs.

Value

A version of umf that has the requested obsCovs imputed.

Author(s)

Ian Fiske

Examples

data(frogs)
pcru.obscovs <- data.frame(MinAfterSunset=as.vector(t(pcru.data[,,1])),
     Wind=as.vector(t(pcru.data[,,2])),
     Sky=as.vector(t(pcru.data[,,3])),
     Temperature=as.vector(t(pcru.data[,,4])))
pcruUMF <- unmarkedFrameOccu(y = pcru.bin, obsCovs = pcru.obscovs)
pcruUMF.i1 <- imputeMissing(pcruUMF)
pcruUMF.i2 <- imputeMissing(pcruUMF, whichCovs = 2)

unmarked

Models for Data from Unmarked Animals

v1.1.0
GPL (>= 3)
Authors
Richard Chandler [aut], Ken Kellner [aut], Ian Fiske [aut], David Miller [aut], Andy Royle [cre, aut], Jeff Hostetler [aut], Rebecca Hutchinson [aut], Adam Smith [aut], Marc Kery [ctb], Mike Meredith [ctb], Auriel Fournier [ctb], Ariel Muldoon [ctb], Chris Baker [ctb]
Initial release
2021-05-05

We don't support your browser anymore

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