Small-scale covariates in mutli-method occupancy

questions concerning analysis/theory using program PRESENCE

Small-scale covariates in mutli-method occupancy

Postby bam59 » Mon Jun 11, 2018 2:30 pm

Hi all,
I'm working on a multi-method (a la Nichols et al. 2008) analysis in PRESENCE and am wondering how I can incorporate a covariate that is specific to the small-scale occupancy parameter (theta).

In my example, the study sites are wetlands where up to 10 amphibians per site are sampled for a pathogen (the number of sampled amphibians is equivalent to the number of 'surveys'). Each individual is sampled three times using tissue samples (equivalent to the number of methods/survey), and the pathogen is either detected (1) or not (0). In this case, the interpretation of theta is the pathogen prevalence (the proportion of infected individuals). I believe this set-up to be appropriate because conditional upon the pathogen occurring at the site (psi), individual amphibians may be infected or uninfected.

Say I have a continuous covariate like the weight of each animal sampled. How would I add this kind of covariate to the input data?

Here are my ideas:
1 - Paste/enter the covariate values directly into the design matrix
2 - Specify the survey covariate as a sampling covariate, but only fill in the first (nSurvey) columns

I think these will work, but I'm wondering if there might be something more efficient out there. Thanks for any thoughts you have.
Brittany :D
bam59
 
Posts: 14
Joined: Wed Jul 03, 2013 6:24 pm
Location: University of Vermont

Re: Small-scale covariates in mutli-method occupancy

Postby jhines » Mon Jun 11, 2018 7:44 pm

Hi Brittney,

To use a covariate on theta for the multi-method model, you'll need to use a 'survey' covariate, however that model treats each method-survey combination as a survey when estimating theta. So, you need to duplicate the covariate for each method. For example, if you have 3 methods and 10 surveys, the number of columns in the detection-history matrix is 30 and the number of columns in your survey covariate must be 30. You should replicate the covariate for the 1st survey 3 times, then replicate the covariate for the 2nd survey 3 times,...etc.

You won't be able to enter values directly into the design matrix because the design matrix isn't site-specific.

Presence will use the 3rd, 6th, 9th,...etc. columns in the survey covariate matrix to get the covariate value for theta for each survey. So you don't want to fill in only the 1st nSurvey columns.

Jim
jhines
 
Posts: 599
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Re: Small-scale covariates in mutli-method occupancy

Postby bam59 » Fri Jun 15, 2018 9:59 am

Hi Jim,
Thanks for that explanation. I was wondering if Presence might be clever enough to grab one entry from each survey/method string to use for modeling theta. When I inserted the individual covariate in the design matrix for theta, the names that were imported were "cov" rather than cov3, cov6, cov9 which is why I assumed it was collecting the first nSurvey entries. What you have coded into Presence makes sense and is much easier than the user having to do bookkeeping!

Thanks again,
Brittany
bam59
 
Posts: 14
Joined: Wed Jul 03, 2013 6:24 pm
Location: University of Vermont

Re: Small-scale covariates in mutli-method occupancy

Postby mdyson » Wed Apr 08, 2020 7:30 am

Hi Jim,

My question is similar to above, but for RPresence, so I thought I would post it here.

I am trying to fit a multi-scale model for a design that has 2-4 cameras per site with 59 sites (~20 sites/year stacked). I have 18 5-day occasions. Therefore, my survcov data frame is 72 columns for each covariate (4 columns per occasion). I then flatten each covariate so it is a vector of length 4248 (4x18x59). I also have a unitcov data frame that is 59 rows long and 1 row for each covariate. I want to test covariates measured at different spatial scales for psi and theta.

I am able to produce models with covariates on psi and p; however, when I try and add a covariate to theta, I get the following error message: Error in dimnames(x) <- dn :
length of 'dimnames' [1] not equal to array extent

I am wondering if I am missing something with the way I should be structuring my survcov data for theta in RPresence. Based on your description above, I am guessing that the error might be associated with the long format of the data I am using for RPresence. Do you have any additional insights or thoughts?

Thanks,

Matt
mdyson
 
Posts: 6
Joined: Wed Apr 01, 2020 8:28 am

Re: Small-scale covariates in mutli-method occupancy

Postby jhines » Wed Apr 08, 2020 2:49 pm

The theta parameter will use covariates which vary by "survey". If you have 2 methods per survey and 4 surveys, the total number of visits is 8. Both p and theta will have values for all 8 visits, but the theta covariates will repeat each value twice. So, your survey covariate for theta will have a 2 columns for survey 1 which are the same, then 2 columns for survey 2,..etc. For example, this code will replicate the covariate for each survey twice, one for each method:

Code: Select all
srvcov=NULL; for (i in 1:K) srvcov=cbind(srvcov,X[,i],X[,i])
srvcov=data.frame(X=as.numeric(srvcov))


The 2nd line converts it to a single column data frame.

If this doesn't help, I'd be happy to look at your code and suggest a solution.

Jim
jhines
 
Posts: 599
Joined: Fri May 16, 2003 9:24 am
Location: Laurel, MD, USA

Re: Small-scale covariates in mutli-method occupancy

Postby mdyson » Thu Apr 09, 2020 8:31 am

Thanks Jim,

I am reviewing my code and cleaning it up a bit. I think I have it in the form that you have suggested because I used the example code from the package to help produce it similar to what you have provided here.

Whats confusing me is that I can model the survey covariates on p without errors, which would indicate to me that I have the data formatted correctly.

I am wondering if the issue is with NAs in my data set. We only used more than 2 cameras at a small sample of sites, so for many "methods" there are NAs.

I will follow up by email later today if I cannot get anywhere with it.

Matt
mdyson
 
Posts: 6
Joined: Wed Apr 01, 2020 8:28 am


Return to analysis help

Who is online

Users browsing this forum: No registered users and 9 guests