multiple instances of predictor variable per model

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

multiple instances of predictor variable per model

SUser
I’m running a model on animal behavior in response to shipping. In most
cases, there is only one ship in the study area at one time. Ship length,
distance from the animals, speed, angle from animals, and ship direction
(as east/west bound) are among shipping-related covariates (with multiple
interactions).

The tricky part is that sometimes there are 2 ships in the area. I could
add all the same covariates, but doubled-up for the second ship. However,
this really hurts convergence. And - conceptually - why would ship length
affect the animals differently between ship 1 and ship 2? I would think
that animals would react similarly to both ships (and the effect would just
add up), so I don’t want the model to estimate two covariates that I think
are the same. And if I had 5 ships instead of 2, those dfs would really
rack up.

Note that I can’t just double the vessel values, since their speeds,
directions, lengths, etc all differ.

Here's a little mock data set for 3 surveys - 2 have a single ship, and 1
has two ships. Note that each survey is only done once, so if there are 2
ships (or more), the number of animals (and all other survey-related info)
is just copied over on another line

df <- data.frame(Survey = c(1, 1, 2, 3), NAnimals = c(10, 10, 1, 0),
Vessel = c("A", "B", "C", "D"), VesselLength = c(20, 50, 40, 70),
VesselSpeed = c(10, 5, 4, 5), Direction = c("West", "East", "West", "West"))

Disclaimer: this is a crosspost from here (
https://stats.stackexchange.com/questions/318667/multiple-instances-of-predictor-variables
).

Many thanks.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.