LaraVolski / Foxlights

0 stars 0 forks source link

Rearraning phases in the RAI dataframe #9

Closed LaraVolski closed 4 years ago

LaraVolski commented 4 years ago

https://github.com/LaraVolski/Foxlights/blob/babfa8f5b18a64a4d787d544b0e00d722a2a098d/foxlights_data_analysis.Rmd#L77

Rearranging phases so that Phase 1 encompasses both FoxY1 and FoxN1 for each camera trap. I feel like I may have learned how to do this in the class I took at Cal but it's all fuzzy now... I'd like to help if there is any way I can!

kaitlyngaynor commented 4 years ago

Is it fair to say that: Phase 1 and 2 --> Phase 1 Phase 3 and 4 --> Phase 2 Phase 5 and 6 --> Phase 3 Phase 7 and 8 --> Phase 4 Phase 9 --> Phase 5 ?

If so, I would just make a new data frame like this: phase_key <- tibble(Phase = c("Phase1", "Phase2", "Phase3", "Phase4", "Phase5", "Phase6", "Phase7", "Phase8", "Phase9"), Phase_New = c(1, 1, 2, 2, 3, 3, 4, 4, 5))

Then use left_join to join this with the RAI data frame used for modeling, and use this column (Phase_New) as your covariate in modeling. Does that make sense?

Forgive me if we already discussed this—is there a reason you used "Phase1" as a factor rather than treating it as a continuous variable (1, 2, 3, etc)? Seems like the latter is more intuitive to me but maybe not... @amcinturff this feels like modeling 101 but for some reason the answer is non-obvious to me...

LaraVolski commented 4 years ago

Yes, that's accurate for the phases! I input the code, and the AIC for Phase_New is 424.8... which means it's only 0.4 greater the best model. Foxlight * Phase_New has an AIC of 427.7.

I don't remember there being a particular reason why phases were set as factors... I see how a continuous variable makes sense from a habitation POV.

kaitlyngaynor commented 4 years ago

Great, glad that it worked out, and interesting that now Foxlight * phase is one of the top models. Does the effect of fox lights increase or decrease with phase? And in what direction? (Have a look at the interaction coefficient)

On Mon, Aug 10, 2020 at 11:38 PM LaraVolski notifications@github.com wrote:

Yes, that's accurate for the phases! I input the code, and the AIC for Phase_New is 424.8... which means it's only 0.1 below the best model. Foxlight * Phase_New has an AIC of 427.7.

I don't remember there being a particular reason why phases were set as factors... I see how a continuous variable makes sense from a habitation POV.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-671758669, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WT54YHGIP6DXFKITMFTSADRMRANCNFSM4P2S4JHA .

-- Sent from my phone

amcinturff commented 4 years ago

I might be wrong about this but I think the continuous/categorical designation for the phases might not be obvious - I think it depends on our hypothesis regarding them? If the only hypothesis is that they are allowing us to test for habituation over time, then I think a continuous variable makes sense. But, if instead we think that each phase might be capturing a unique set of environmental circumstances - perhaps seasonality, or different individual coyotes moving through the area, eg - then it might make sense to have them as categorical variables. Which do we think is more important? I'm initially inclined to say the latter, especially since we've kindof "cheated" and seen that there isn't much evidence that habituation of any kind is happening?

On Mon, Aug 10, 2020 at 9:41 PM Kaitlyn Gaynor notifications@github.com wrote:

Is it fair to say that: Phase 1 and 2 --> Phase 1 Phase 3 and 4 --> Phase 2 Phase 5 and 6 --> Phase 3 Phase 7 and 8 --> Phase 4 Phase 9 --> Phase 5 ?

If so, I would just make a new data frame like this: phase_key <- tibble(Phase = c("Phase1", "Phase2", "Phase3", "Phase4", "Phase5", "Phase6", "Phase7", "Phase8", "Phase9"), Phase_New = c(1, 1, 2, 2, 3, 3, 4, 4, 5))

Then use left_join to join this with the RAI data frame used for modeling, and use this column (Phase_New) as your covariate in modeling. Does that make sense?

Forgive me if we already discussed this—is there a reason you used "Phase1" as a factor rather than treating it as a continuous variable (1, 2, 3, etc)? Seems like the latter is more intuitive to me but maybe not... @amcinturff https://github.com/amcinturff this feels like modeling 101 but for some reason the answer is non-obvious to me...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-671720623, or unsubscribe https://github.com/notifications/unsubscribe-auth/APHK2IPLZS6GBLM7AQSJIADSADDWDANCNFSM4P2S4JHA .

amcinturff commented 4 years ago

Also I'm seeing these messages in my gmail, but should I be responding in github? Help granpaw

On Tue, Aug 11, 2020 at 2:10 PM Alex McInturff amcinturff@gmail.com wrote:

I might be wrong about this but I think the continuous/categorical designation for the phases might not be obvious - I think it depends on our hypothesis regarding them? If the only hypothesis is that they are allowing us to test for habituation over time, then I think a continuous variable makes sense. But, if instead we think that each phase might be capturing a unique set of environmental circumstances - perhaps seasonality, or different individual coyotes moving through the area, eg - then it might make sense to have them as categorical variables. Which do we think is more important? I'm initially inclined to say the latter, especially since we've kindof "cheated" and seen that there isn't much evidence that habituation of any kind is happening?

On Mon, Aug 10, 2020 at 9:41 PM Kaitlyn Gaynor notifications@github.com wrote:

Is it fair to say that: Phase 1 and 2 --> Phase 1 Phase 3 and 4 --> Phase 2 Phase 5 and 6 --> Phase 3 Phase 7 and 8 --> Phase 4 Phase 9 --> Phase 5 ?

If so, I would just make a new data frame like this: phase_key <- tibble(Phase = c("Phase1", "Phase2", "Phase3", "Phase4", "Phase5", "Phase6", "Phase7", "Phase8", "Phase9"), Phase_New = c(1, 1, 2, 2, 3, 3, 4, 4, 5))

Then use left_join to join this with the RAI data frame used for modeling, and use this column (Phase_New) as your covariate in modeling. Does that make sense?

Forgive me if we already discussed this—is there a reason you used "Phase1" as a factor rather than treating it as a continuous variable (1, 2, 3, etc)? Seems like the latter is more intuitive to me but maybe not... @amcinturff https://github.com/amcinturff this feels like modeling 101 but for some reason the answer is non-obvious to me...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-671720623, or unsubscribe https://github.com/notifications/unsubscribe-auth/APHK2IPLZS6GBLM7AQSJIADSADDWDANCNFSM4P2S4JHA .

kaitlyngaynor commented 4 years ago

When you reply in this thread, they get added to the GitHub record here with a little envelope icon that says it came via email - have a look ;) https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-671720623

Hmm this is an interesting point. I was thinking of this as the former (phase = variable for assessing habituation). If we are interested in capturing the temporal dynamics of a particular time period, then we should instead go back to Lara's old method and NOT group the FoxY/N into a single phase, I'd think?

Lara, I'm curious about the sign/direction of the interaction effect... that may also provide some insights into whether this is an ecologically-meaningful pattern or just some noise...

On Tue, Aug 11, 2020 at 2:12 PM amcinturff notifications@github.com wrote:

Also I'm seeing these messages in my gmail, but should I be responding in github? Help granpaw

On Tue, Aug 11, 2020 at 2:10 PM Alex McInturff amcinturff@gmail.com wrote:

I might be wrong about this but I think the continuous/categorical designation for the phases might not be obvious - I think it depends on our hypothesis regarding them? If the only hypothesis is that they are allowing us to test for habituation over time, then I think a continuous variable makes sense. But, if instead we think that each phase might be capturing a unique set of environmental circumstances - perhaps seasonality, or different individual coyotes moving through the area, eg - then it might make sense to have them as categorical variables. Which do we think is more important? I'm initially inclined to say the latter, especially since we've kindof "cheated" and seen that there isn't much evidence that habituation of any kind is happening?

On Mon, Aug 10, 2020 at 9:41 PM Kaitlyn Gaynor <notifications@github.com

wrote:

Is it fair to say that: Phase 1 and 2 --> Phase 1 Phase 3 and 4 --> Phase 2 Phase 5 and 6 --> Phase 3 Phase 7 and 8 --> Phase 4 Phase 9 --> Phase 5 ?

If so, I would just make a new data frame like this: phase_key <- tibble(Phase = c("Phase1", "Phase2", "Phase3", "Phase4", "Phase5", "Phase6", "Phase7", "Phase8", "Phase9"), Phase_New = c(1, 1, 2, 2, 3, 3, 4, 4, 5))

Then use left_join to join this with the RAI data frame used for modeling, and use this column (Phase_New) as your covariate in modeling. Does that make sense?

Forgive me if we already discussed this—is there a reason you used "Phase1" as a factor rather than treating it as a continuous variable (1, 2, 3, etc)? Seems like the latter is more intuitive to me but maybe not... @amcinturff https://github.com/amcinturff this feels like modeling 101 but for some reason the answer is non-obvious to me...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-671720623>, or unsubscribe < https://github.com/notifications/unsubscribe-auth/APHK2IPLZS6GBLM7AQSJIADSADDWDANCNFSM4P2S4JHA

.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-672282236, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WT3KI5MS4U6IOMPAK4LSAGX5TANCNFSM4P2S4JHA .

-- Kaitlyn Gaynor Postdoctoral researcher National Center for Ecological Analysis and Synthesis University of California - Santa Barbara

amcinturff commented 4 years ago

Great points, Kaitlyn. And thanks for the github tip!

On Tue, Aug 11, 2020 at 2:17 PM Kaitlyn Gaynor notifications@github.com wrote:

When you reply in this thread, they get added to the GitHub record here with a little envelope icon that says it came via email - have a look ;) https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-671720623

Hmm this is an interesting point. I was thinking of this as the former (phase = variable for assessing habituation). If we are interested in capturing the temporal dynamics of a particular time period, then we should instead go back to Lara's old method and NOT group the FoxY/N into a single phase, I'd think?

Lara, I'm curious about the sign/direction of the interaction effect... that may also provide some insights into whether this is an ecologically-meaningful pattern or just some noise...

On Tue, Aug 11, 2020 at 2:12 PM amcinturff notifications@github.com wrote:

Also I'm seeing these messages in my gmail, but should I be responding in github? Help granpaw

On Tue, Aug 11, 2020 at 2:10 PM Alex McInturff amcinturff@gmail.com wrote:

I might be wrong about this but I think the continuous/categorical designation for the phases might not be obvious - I think it depends on our hypothesis regarding them? If the only hypothesis is that they are allowing us to test for habituation over time, then I think a continuous variable makes sense. But, if instead we think that each phase might be capturing a unique set of environmental circumstances - perhaps seasonality, or different individual coyotes moving through the area, eg - then it might make sense to have them as categorical variables. Which do we think is more important? I'm initially inclined to say the latter, especially since we've kindof "cheated" and seen that there isn't much evidence that habituation of any kind is happening?

On Mon, Aug 10, 2020 at 9:41 PM Kaitlyn Gaynor < notifications@github.com

wrote:

Is it fair to say that: Phase 1 and 2 --> Phase 1 Phase 3 and 4 --> Phase 2 Phase 5 and 6 --> Phase 3 Phase 7 and 8 --> Phase 4 Phase 9 --> Phase 5 ?

If so, I would just make a new data frame like this: phase_key <- tibble(Phase = c("Phase1", "Phase2", "Phase3", "Phase4", "Phase5", "Phase6", "Phase7", "Phase8", "Phase9"), Phase_New = c(1, 1, 2, 2, 3, 3, 4, 4, 5))

Then use left_join to join this with the RAI data frame used for modeling, and use this column (Phase_New) as your covariate in modeling. Does that make sense?

Forgive me if we already discussed this—is there a reason you used "Phase1" as a factor rather than treating it as a continuous variable (1, 2, 3, etc)? Seems like the latter is more intuitive to me but maybe not... @amcinturff https://github.com/amcinturff this feels like modeling 101 but for some reason the answer is non-obvious to me...

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub < https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-671720623 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/APHK2IPLZS6GBLM7AQSJIADSADDWDANCNFSM4P2S4JHA

.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub <https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-672282236 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AHA7WT3KI5MS4U6IOMPAK4LSAGX5TANCNFSM4P2S4JHA

.

-- Kaitlyn Gaynor Postdoctoral researcher National Center for Ecological Analysis and Synthesis University of California - Santa Barbara

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-672284118, or unsubscribe https://github.com/notifications/unsubscribe-auth/APHK2INDWAFPNVQWTD77WUTSAGYNNANCNFSM4P2S4JHA .

LaraVolski commented 4 years ago

Null Model AIC = 424.4

Fit 3 - Phase_New Only AIC = 424.8 Delta AIC = 0.4 Estimate = -0.107 Explanation: Coyote RAI decreases as phase "increases."

*Fit 7 - Phase_New Foxlight** AIC = 427.7 Delta AIC = 3.2 Estimate for FoxlightFoxY:Phase_New = -0.083 Explanation: Coyote RAI tends to decrease with each time a Foxlight is active at a site again.
VIF = 5.96 (this is bad right? This is for Foxlight:Phase_New)

kaitlyngaynor commented 4 years ago

High VIF is not an issue for interaction terms—this is expected. So no worries here.

This is kind of interesting, and also in line with what we would expect—I would interpret it as very limited evidence that we DO have habituation. Which is interesting! I would vote for this modeling approach. What do you two think?

On Tue, Aug 11, 2020 at 3:12 PM LaraVolski notifications@github.com wrote:

Null Model AIC = 424.4

Fit 3 - Phase_New Only AIC = 424.8 Delta AIC = 0.4 Estimate = -0.107 Explanation: Coyote RAI decreases as phase "increases."

Fit 7 - Phase_New Foxlight* AIC = 427.7 Delta AIC = 3.2 Estimate for FoxlightFoxY:Phase_New = -0.083 Explanation: Coyote RAI tends to decrease with each time a Foxlight is active at a site again. VIF = 5.96 (this is bad right? This is for Foxlight:Phase_New)

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-672310913, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WT2Q3N2COI7HCMA2XT3SAG66DANCNFSM4P2S4JHA .

-- Kaitlyn Gaynor Postdoctoral researcher National Center for Ecological Analysis and Synthesis University of California - Santa Barbara

LaraVolski commented 4 years ago

Hmm I may be a little confused. I was thinking that evidence for habituation would mean that coyote RAI would increase each time the Foxlight is active at a site again, and the estimate would be positive?

kaitlyngaynor commented 4 years ago

oh haha YES I'm being silly. I think it's still worth using this approach. We can say that we found no evidence for habituation, and in fact, maybe even evidence for the opposite (sensitization)

What is the estimate for the phase coefficient (not the interaction term)? Curious if coyote activity generally increased or decreased as phases progressed (independent of foxlight)

On Tue, Aug 11, 2020 at 3:41 PM LaraVolski notifications@github.com wrote:

Hmm I may be a little confused. I was thinking that evidence for habituation would mean that coyote RAI would increase each time the Foxlight is active at a site again, and the estimate would be positive?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-672331827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WT6ONZX2HDHQISGHRR3SAHCJHANCNFSM4P2S4JHA .

-- Kaitlyn Gaynor Postdoctoral researcher National Center for Ecological Analysis and Synthesis University of California - Santa Barbara

LaraVolski commented 4 years ago

I agree! This approach is better for modelling phase & habituation. The estimate for the phase coefficient in Phase_New * Foxlight is -0.07226, so it looks like that is the case.

kaitlyngaynor commented 4 years ago

sounds good. maybe you can update the model results / selection tables and send around to Alex & me for a final look at the quantitative methods & results, and we can then talk about how to package for the follow-up interviews?

On Tue, Aug 11, 2020 at 3:52 PM LaraVolski notifications@github.com wrote:

I agree! This approach is better for modelling phase & habituation. The estimate for the phase coefficient in Phase_New * Foxlight is -0.07226, so it looks like that is the case.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-672336334, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHA7WT7WB6KZMMD4NQSJV3DSAHDTZANCNFSM4P2S4JHA .

-- Kaitlyn Gaynor Postdoctoral researcher National Center for Ecological Analysis and Synthesis University of California - Santa Barbara

amcinturff commented 4 years ago

Sounds good all, I'm on board with this approach! It also means we may want to do a little digging into the research on non-lethal tools as an attractant. I was just on a panel with some scientists, managers, and ranchers about puma predation of livestock in sonoma county, and there is a growing belief among ranchers that non-lethal tools quickly go from deterrents to attractants as animals adapt. This might be due to ranchers being frustrated with these tools and looking for reasons to disregard them, or it might be that their experience has given them insights that we camera trappers might be envious of (or both). I've never really dug into the lit on habituation/sensitization when it comes to non-lethal tools, but it's probably a dive worth taking when we circle back to intro and start in on discussion. Just flagging this for the future! Great job Lara on working through these models, Alex

On Tue, Aug 11, 2020 at 4:05 PM Kaitlyn Gaynor notifications@github.com wrote:

sounds good. maybe you can update the model results / selection tables and send around to Alex & me for a final look at the quantitative methods & results, and we can then talk about how to package for the follow-up interviews?

On Tue, Aug 11, 2020 at 3:52 PM LaraVolski notifications@github.com wrote:

I agree! This approach is better for modelling phase & habituation. The estimate for the phase coefficient in Phase_New * Foxlight is -0.07226, so it looks like that is the case.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub <https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-672336334 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AHA7WT7WB6KZMMD4NQSJV3DSAHDTZANCNFSM4P2S4JHA

.

-- Kaitlyn Gaynor Postdoctoral researcher National Center for Ecological Analysis and Synthesis University of California - Santa Barbara

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LaraVolski/Foxlights/issues/9#issuecomment-672342447, or unsubscribe https://github.com/notifications/unsubscribe-auth/APHK2IOINZFOGLBEBP2ZJGDSAHFDVANCNFSM4P2S4JHA .

LaraVolski commented 4 years ago

That's so interesting to learn that there's a growing belief around this. I've added it as something to research further in my discussion section bullet points. I wonder if it will come up in the second round of interviews?

I'm going to work on updating the results section & then I'll also send over a doc with my thoughts for the second round of interviews. :)