Covariate in CJS survival model

240 views
Skip to first unread message

Leslie Skora

unread,
Jan 21, 2020, 1:09:13 PM1/21/20
to hmecology: Hierarchical Modeling in Ecology

Hello,


I am working on a Cormack-Jolly-Seber survival model using a variance-covariance matrix to describe temporal variance and covariance among age-sex groups. I am using the code from page 206 of the Kery and Schaub (2012) book, section 7.6.2. I am interested in adding an environmental covariate on group survival using this model, but I am struggling with how to implement it in the variance-covariance matrix form. Can anyone help?


Thank you. 

Schaub Michael

unread,
Jan 21, 2020, 1:23:51 PM1/21/20
to Leslie Skora, hmecology: Hierarchical Modeling in Ecology
Hi Leslie,

The variance-covariance matrix is used for the residual variance, i.e. the variance that is not explained by covariates. Hence if you want to add a covariable, you write it in the linear predictor (e.g. logit(survival) = mu + alpha * covariate + residual) and only for the residual the covriance-covariance matrix is used.
Note that the priors that we suggested in the book for the variance-covariance matrix might not be the best - there are alternative options (see e.g. a recent paper by Thomas Riecke in MEE).

Kind regards

Michael

Von: hmec...@googlegroups.com [hmec...@googlegroups.com]" im Auftrag von "Leslie Skora [leslie...@gmail.com]
Gesendet: Dienstag, 21. Januar 2020 19:09
An: hmecology: Hierarchical Modeling in Ecology
Betreff: Covariate in CJS survival model

Hello,


I am working on a Cormack-Jolly-Seber survival model using a variance-covariance matrix to describe temporal variance and covariance among age-sex groups. I am using the code from page 206 of the Kery and Schaub (2012) book, section 7.6.2. I am interested in adding an environmental covariate on group survival using this model, but I am struggling with how to implement it in the variance-covariance matrix form. Can anyone help?


Thank you. 

--
*** Three hierarchical modeling email lists ***
(1) unmarked: for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology (this list): for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2020)
---
You received this message because you are subscribed to the Google Groups "hmecology: Hierarchical Modeling in Ecology" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hmecology+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hmecology/ac3d8a61-fd4a-403e-af08-d61f29abeba7%40googlegroups.com.

Dan Gibson

unread,
Jan 21, 2020, 1:27:59 PM1/21/20
to Schaub Michael, Leslie Skora, hmecology: Hierarchical Modeling in Ecology
Hi Leslie, I am working with these kinds of models at the moment, so I was able to put this together pretty quickly. I think Michael is pointing you to a suggestion like this. As Michael said, the inverse wishart may not be the best approach. It may make more sense to use the dmnorm.vcov function in JAGS, which uses a specified variance-covariance matrix, not the inverse of it. (See end of code)


# Priors and constraints
for(k in 1:n.cov){
  beta[k] ~ dnorm(0, 0.001)
}

for (i in 1:nind){
  for (t in f[i]:(n.occasions-1)){
    logit(phi[i,t]) <- mu.phi[group[i]] + inprod(X[i,], beta) +  eta.phi[t,group[i]]    # mu.phi is group specific means, X is covariates + eta is the outcome of the group covariance
             p[i,t] <- p.g[group[i]]
  } #t
} #i
# for survival parameters
for (t in 1:(n.occasions-1)){
  eta.phi[t,1:n.groups] ~  dmnorm.vcov(mu[], Sigma[,])
} #t

for (u in 1:g){      
  mean.phi[u] ~ dunif(0, 1)    # Priors on mean group-spec. survival
  mu.phi[u] <- log(mean.phi[u] / (1-mean.phi[u]))
} #g


##########################################
# Prior for correlation matrix
#########################################
for(m in 1:n.groups){
  sig[m] ~ dunif(0, 10)       
  rho[m,m] <- 1                # set diag. to 1
  mu[m] <- 0                    # set mean of the multinormal v-cov matrix to zero
}

for(mm in 2:n.groups){
  for(ii in 1:(mm-1)){
    rho[mm,ii] ~ dunif(-1,1)  # covariance term
    rho[ii,mm] <- rho[mm,ii]  # allow below and above diag to be symmetrical.
  }
}

for(m in 1:n.groups){
  for(i in 1:n.groups){
    Sigma[m,i] <- rho[m,i] * sig[m] * sig[i]  # variance - covariance
  }
}

Leslie Skora

unread,
Jan 21, 2020, 4:26:11 PM1/21/20
to hmecology: Hierarchical Modeling in Ecology
Thank you both for your help. Dan, your code really helped me visualize the point Michael made. 

Thanks again!
Reply all
Reply to author
Forward
0 new messages