Missing individual co-variate values & hcov

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

Missing individual co-variate values & hcov

Postby Pranav » Sat Nov 15, 2014 8:19 pm

Hi Murray,

I have a quick query regarding missing individual covariate values and secr analysis.

On page 3 of the "Data input for secr" document, a line at the end of the second paragraph reads "Missing (individual covariate) values on a particular occasion may be indicated with 'NA', but each covariate must be scored at least once for each animal".

The documentation for the "housemouse" example - page 69 of the main manual states " The sex of two animals is not available (NA); it is necessary to drop these records for analyses using 'sex"'.

Finally, the documentation for the hcov function (page 61) notes " Missing values 'NA' are used for individuals of unknown class...It is assumed that the probability of recording a missing value for the class co variate is independent of the true class membership (eg. sex equally likely to be recorded for males and females".

I am attempting to analyze some capture-recapture data using the hcoc characterization for sex. I lack data for this covariates for some individuals. It is my understanding that the mixture model (hcov) will permit analysis without omitting these individuals from the capture history. Am I correct about this?

When I attempt to red in the input file:
capture_data = read.capthist (captfile = 'data.txt', trapfile = 'trapflag.txt', detector = 'proximity', covnames ='sex), R returns the following error "Error in read.capthist(captfile = "data.txt", : missing values not allowed"

I used the term 'NA' (without quotes) for individuals that have not been assigned to either gender in the capture file.

Is there a fundamental gap in my understanding of how missing individual covariates are treated in the hcov parametrization, or am I missing something obvious while reading in the these input data? Thank you for your time in advance.

Pranav
Pranav
 
Posts: 4
Joined: Sat Oct 25, 2014 7:41 pm

Re: Missing individual co-variate values & hcov

Postby murray.efford » Sat Nov 15, 2014 8:48 pm

Hi Pranav
An elegantly posed question!

Yes, there is a documentation lapse in the input pdf and the housemouse writeup, both of which pre-date the 'hcov' approach (designed specifically for this case). Thanks for pointing that out. I'll fix it now!

I have no trouble reading covariate NA values. Here's a demo where I save text files from the housemouse dataset and re-read them
Code: Select all
write.capthist(housemouse, tonumeric = F)
tmp <- read.capthist('housemousecapt.txt', 'housemousetrap.txt', covnames = c('sex','age'))
## No errors found :-)
covariates(tmp)[is.na(covariates(tmp)$sex),]
##     sex age
## 113 <NA>   j
## 200 <NA>   j

Two animals are of unknown sex.

I can't put my finger on where your message is coming from. It doesn't specifically mention covariates - is it possible some other error has crept into the data file?

Murray
murray.efford
 
Posts: 712
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand

Re: Missing individual co-variate values & hcov

Postby Pranav » Sat Nov 15, 2014 11:37 pm

Thanks for your quick reply Murray, and for clarifying how individual covariates are treated in secr.
There was a not so minor flaw in my input file - I had a missing 'session' column!!! :?
Pranav
 
Posts: 4
Joined: Sat Oct 25, 2014 7:41 pm


Return to analysis help

Who is online

Users browsing this forum: No registered users and 1 guest

cron