I am running an unmarked occupancy model and one of my covariates is protected status. This covariate has 3 levels 0, 1 and 2. I need to take a model-averaged estimate of the effect of the covariate and occupancy. Currently, R is reading the covariate as a continuous rather than a categorical variable and so I need to adjust my code. Unfortunately, all the methods I can find on R for making data categorical rather than continuous are for 'S3 models' and this is an 'S4 model'. I have also tried telling R that the data is a factor like shown in the code below.
Site.Covs.Wolves2 <- read.csv("wolftotcovars40.csv", header = T, colClasses = c("factor", "factor", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", "numeric"))
But when I tried to take a model-averaged estimate I got the error message
Some models include more than one instance of the parameter of interest.
This may be due to the presence of interaction/polynomial terms, or variables
with similar names:
see "?modavg" for details on variable specification and "exclude" argument
In addition: Warning message:
In modavg.AICunmarkedFitOccu(M.listTOT3, "Prot_Stat", parm.type = "psi") :
Model names have been supplied automatically in the table
The data is 111 sites labelled 'TN1' 'TN2' 'TN3' etc. though this is removed before forming the occupancy frame so it's not related to that. I guess the issue is that there are multiple sites with the same protected status and so have the same 'factor value' but I'm not sure how to resolve this.