1

I am performing a resource selection function using use and availability locations for a set of animals. For this type of analysis, an infinitely weighted logistic regression is suggested (Fithian and Hastie 2013) and is done by setting weights of used locations to 1 and available locations to some large number (e.g. 10,000). I know that implementing this approach using the glm function in R would be relatively simple

model1 <- glm(used ~ covariates , family=binomial, weights=weights)

I am attempting to implement this as part of a larger hierarchical bayesian model, and thus need to figure out how to incorporate weights in JAGS. In my searching online, I have not been able to find a clear example of how to use weights in specifically a logistic regression. For a poisson model, I have seen suggestions to just multiply the weights by lambda such as described here. I was uncertain if this logic would hold for weights in a logistic regression. Below is an excerpt of JAGS code for the logistic regression in my model.

  alpha_NSel ~ dbeta(1,1)
  intercept_NSel <- logit(alpha_NSel)
  beta_SC_NSel ~ dnorm(0, tau_NSel)
  tau_NSel <- 1/(pow(sigma_NSel,2))
  sigma_NSel ~ dunif(0,50)     

  for(n in 1:N_NSel){
    logit(piN[n]) <- intercept_NSel + beta_SC_NSel*cov_NSel[n]
    yN[n] ~ dbern(piN[n])
  }

To implement weights, would I simply change the bernoulli trial to the below? In this case, I assume I would need to adjust weights so that they are between 0 and 1. So weights for used are 1/10,000 and available are 1?

yN[n] ~ dbern(piN[n]*weights[n])
  • Isn't this the same question as the following? Or am I mistunderstanding? https://stackoverflow.com/questions/29977578/logistic-regression-when-response-is-a-proportion-using-jags?rq=1 – Gino_JrDataScientist Nov 20 '21 at 12:21

0 Answers0