I analyse a set of physicochemical data from the river and two rows of wells - one located closer and the other further from the river (in the N-S direction).
The study's main aim is to investigate the variability (or heterogeneity) in the content of the different parameters at the water intake concerning distance from the river.
My initial assumption is that, statistically, a more significant influence of the river on the first well row can be demonstrated (the water in row 1 is more similar to the water in the river in terms of analysed parameters content, e.g. chlorides).
Thus, I divided 3 sampling locations/regions:
the river,
the first row of wells
the second row of wells
I rearranged my data by the sampling location of the selected parameter (river, row 1 and row 2), as suggested in here. Still, after further research and the discussion on reddit, I found that (I might be wrong) maybe the Linear Mixed Effects Model is the better solution for my data than the OLS. So, to the prepared data frames, I added one more column, "ID", with the ID of the given measurement "region" (river or one of the wells).
So, for example, for chlorides, the analysed group (data frame) has 3 columns:
- chloride (numeric values in mg/L),
- location (categorical values: river, row A and row B)
- ID (categorical values: river, well_1, well_2 ... well_11)
For the data frame prepared this way, I performed LMM to see if the sampling location affects the value of that sample. Here is the line of code I used:
cl_spring_mix = smf.mixedlm(
'chloride ~ location',
data=cl_spring,
groups=cl_spring['ID']
).fit()
and there is my example output:
print(cl_spring_mix.summary())
Mixed Linear Model Regression Results
===========================================================
Model: MixedLM Dependent Variable: chloride
No. Observations: 140 Method: REML
No. Groups: 12 Scale: 11.3058
Min. group size: 11 Log-Likelihood: -369.9698
Max. group size: 19 Converged: Yes
Mean group size: 11.7
-----------------------------------------------------------
Coef. Std.Err. z P>|z| [0.025 0.975]
-----------------------------------------------------------
Intercept 14.632 1.419 10.308 0.000 11.849 17.414
location[T.rowA] -0.242 1.538 -0.157 0.875 -3.256 2.772
location[T.rowB] 7.096 1.621 4.378 0.000 3.919 10.272
Group Var 1.420 0.355
===========================================================
However, I am not entirely convinced about the interpretation of these results. My understanding is that, since the Intercept is assumed here as a river, in row A the chloride values are very similar to the river (actually 0.242 lower), while in row B they are more different (7.096 mg/L higher on average).
What I do not know is how to interpret the value of "z" and "P>|z|". I guess that P>|z| values equal to 0.000 for "Intercept" and "location[T.rowB]" mean that the result is statistically significant, but what does this mean in the case of my study? It means that in the dataset analysed, the location statistically significantly affects the chloride value in row B relative to the river? Whereas in row A, where the p-value is large, it does not? In other words, if the value of chlorides in row A was 0, the value in the river wouldn't change? Or did I mess something up.
I mean, that would be OK for my initial assessment but I am not sure if I look at these results properly.
And what does the p-value = 0.000 mean for the Intercept? The results are statistically significant in relation to what?