Setup: We have 10 connected but distinct wetlands within a study area. The wetlands are not totally independent, there is some exchange of water and organisms between them. Perhaps comparable to states or provinces - sharing borders and with some connections but largely self-governing.
We have collected 21 years of annual data. Each year 65 sites are chosen randomly from within the entire study area, resulting in 2-16 observations within each wetland (panel) per year.
Can I treat each of the 10 wetlands as a "panel" to identify the strongest potential drivers of change over time? I am using the PLM function in R which wont allow varying numbers of observations per time step...at least I can't figure out how to make that happen. ?? Is there a way of using the individual observations within each panel in PLM? Another option?
My main goal is to determine which of 3 predictors is driving a very strong overall decrease in CLARITY over time. This decrease and changes in the predictors differ between panels (see attached figure for an example).
The basic code is:
pSummer <- pdata.frame(Summer, index = c("complex", "Year"))
fixed <- plm (CLARITY ~ VEG + FISH + Inputs, data = pSummer, model = "within")
When I average values within each panel (so each panel contains only 1 "average" individual) I get results that make perfect sense, but I am losing or ignoring a lot of potentially important variation. I know it's not correct, but here are the (partial) results:
Unbalanced Panel: n = 10, T = 17-21, N = 206
Estimate Std. Error t-value Pr(>|t|)
FISH 0.0016 0.0002 6.57 4.398e-10 ***
Inputs 0.6401 0.2793 2.29 0.0230 *
VEG -2.6780 1.3997 -1.91 0.0572 .
If I try to include all observations I get the following error message, which is clear enough.
In pdata.frame(Summer, index = c("Subname", "Year")) : duplicate couples (id-time) in resulting pdata.frame
Thanks for any ideas.