Different results with same dataset in communityModel

6 views
Skip to first unread message

Jarrad Barnes

unread,
Apr 26, 2024, 6:43:07 AMApr 26
to camtrapR
Hi Juergen, 

I've been trying to reorder some of my covariates so the model reads them in the order I want - I found the easiest way was to recode them as dummy variables e.g., A, B, C, etc. which would then be automatically specified in alphabetical order. Having done this, I reran my model and the occupancy values for ALL covariates changed. The below two images show occupancy estimates for species in a community based on a covariate "ruggedness (scaled)". I'm using this as an example because this is a continuous variable, so nothing about it was changed, yet it's clear the values are different. The first figure is the values for this covariate with the original dataset, the second is with the dummy dataset. I should stress that I've checked and double checked and run this multiple times and I get the same result. Continuous variables are similarly affected, and categorical variables indicate different different relative probabilities to one another (i.e., if variable A showed the highest occupancy probability in the original dataset, it doesn't necessarily show the highest probability in the dummy dataset). Does changing the alphabetical order of categorical variables, and therefore the order in which their respective levels are included, really change the model THIS much, even (especially) for variables that aren't recoded?

Thanks for any insight,
Jarrad

Rplot.png
Rplot01.png

Jürgen Niedballa

unread,
May 15, 2024, 12:51:17 AMMay 15
to Jarrad Barnes, camtrapR
Hi Jarrad,
would you mind sharing your workflow please to help me better understand what you did that led to these differences? That would also help me reproduce it. Ideally, if you could make a small reproducible example and share as an R workspace (.RData) it would be much appreciated (e.g. based on the AHMbook::simComm() function as in vignette 5). Otherwise just the code would help a lot too.
I also don't quite understand what you mean by:
I've been trying to reorder some of my covariates so the model reads them in the order I want
Please elaborate what  exactly the original problem was and how you addressed it. 

Generally I would not expect such dramatic differences depending on how covariates are specified. So it might potentially be an internal problem.
Thank you,
Jürgen

--
You received this message because you are subscribed to the Google Groups "camtrapR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camtrapr+u...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/camtrapr/c13ebdad-8f53-4ae3-b3e1-6425d99b8fdfn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages