## Plotting correlation between covariate and psi/p

questions concerning analysis/theory using program PRESENCE

### Plotting correlation between covariate and psi/p

Hi,

Im not sure this is the right place to ask this question but I am struggling to find the answers elsewhere. I am wanted to visualise the relationship between the covariates and occupancy/detection through a regression graph. I am doing my masters thesis and have noticed that this is included a lot in previous works, but cannot suss out which data has been plotted or how it needs to be set up.

Apologies if my question is not clear, I will try to clarify better if needed.

Thank you,
Sarah
Sarah_Walker

Posts: 2
Joined: Sat Aug 20, 2022 11:50 am

### Re: Plotting correlation between covariate and psi/p

Hi Sarah
You need to create such graphs outside of PRESENCE, using R or Excel (for example).
Cheers
Darryl
darryl

Posts: 493
Joined: Thu Jun 12, 2003 3:04 pm
Location: Dunedin, New Zealand

### Re: Plotting correlation between covariate and psi/p

Here's an example using RPresence.

Code: Select all
`#rm(list=ls()); library(RPresence)# generate simulated value data for single-season model with covariatesdata=genpresSD(N=500, K=4,                cov=TRUE,     # set to true to generate covariates               psi=c(1, 2),  # beta values for psi : psi=exp(1+2*cov)/(1+exp(1+2*cov))               p=c(-.5, 1))  # beta values for p: p=exp(-.5+1*cov)/(1+exp(-.5+1*cov))#  note: unit covariate name will be "ucov" and values from std. normal distribution#        survey covarite name is "scov" with range similar to ucov                #  create pao filepao=createPao(data\$hst,          # detection-history data              unitcov=data\$ucov,   #  unit(site) covariate data              survcov=as.vector(unlist(data\$scov))) # survey covariate data)#  run standard single-season model with psi a function of unitcov#    and p a function of survey covariatem1=occMod(model=list(psi~ucov, p~survcov),data=pao)#  create sequence of site covariate values from -2 to 2newcov = data.frame(ucov=seq(-2,2,.1))#  get predicted psi values for those covariate valuespsi = predict(m1, newdata=newcov, param='psi')#  plot psi versus range of site covariate values #  with 95% confidence intervalsplot(x=newcov\$ucov, y=psi\$est, type='l', main='psi with 95% conf. intervals')lines(x=newcov\$ucov, y=psi\$lower_0.95, lty=2)lines(x=newcov\$ucov, y=psi\$upper_0.95, lty=2)`
jhines

Posts: 587
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA 