I am trying to fit the model from Sauer et al. 2011. JWM 75(3):509-512 to some Bald eagle nest data from southcentral Alaska. I have a dataset with 2 states: A = occupied nest and B = unoccupied nest (changed from O and U) and 4 yearly nest visits. I was able to enter the data and run simple models successfully. My problem occurs when I try to fix detection of unoccupied nests equal to zero, as suggested on page 511: "We estimate detection probability for an occupied nest in year t (p_t^A), but because unoccupied nests cannot be unambiguously identified from the air, we set p_t^B = 0".
The relevant RMark code is below. You will noticed that I borrowed heavily from the example listed in appendix C.
- Code: Select all
# Read data. Use colClasses to keep leading zeros
d1 <- read.table('Z:/5Tammy/BAEA/analyses/MSMR2012/2012_BAEA_KEFJ_MSMR_sum.txt',
colClasses =c("character","numeric"), sep = "\t", header = TRUE)
# Process Data
mstrata.processed <- process.data(data = d1, model = "Multistrata")
# Create design data
mstrata.ddl=make.design.data(mstrata.processed)
# Define range of models for S
S.=list(formula=~1)
# Define range of models for p
p.=list(formula=~1)
# returns index numbers
p.stratum.B<-as.numeric(row.names(d1.ddl$p[mstrata.ddl$p$stratum=="B",]))
# Fixes p for unoccupied nests. IS THIS RIGHT???
p.stratum=list(formula=~stratum, fixed=list(index = p.stratum.B, value = c(rep(0,length(p.stratum.B)))))
# Define range of models for Psi
Psi.s=list(formula=~-1+stratum:tostratum)
# Create model list and run assortment of models
model.list=create.model.list("Multistrata")
#Run the list
mstrata.results=mark.wrapper(model.list,data=mstrata.processed,mstratum=d1.ddl, threads=2)
The code above runs, and the first model (p.) looks good. However, the second model (with the fixed p) doesn't seem to converge, and had unreasonable estimates for the transition parameters. I went through several examples and read through the literature on the subject, but am a bit confused about how to code it. Any suggestions?
Thanks!
Tammy