Random intercept per year and site, block nested in site. and Treatment nested in site (could also be modelled as a random slope to allow for correlations)
wir sind abe nicht an einem Treatment effekt interesseiert. drum verwerfen wir Treatment als Random UND Fixed effekt.
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
k 10361.3 10361.3 1 243.49 7.0248 0.008566 **
log(PS) 9132.5 9132.5 1 243.72 6.1918 0.013504 *
k:log(PS) 12026.0 12026.0 1 243.87 8.1535 0.004668 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
anova(fit.kin.Ynorm)
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
k 0.182097 0.182097 1 229.90 0.6950 0.4053
log(PS) 0.029224 0.029224 1 229.48 0.1115 0.7387
k:log(PS) 0.232300 0.232300 1 229.46 0.8866 0.3474
Code
anova(fit.kin.Pexport)
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
k 35.305 35.305 1 247.74 0.5252 0.4693
log(PS) 39.586 39.586 1 248.15 0.5889 0.4436
k:log(PS) 53.624 53.624 1 248.29 0.7978 0.3726
Code
anova(fit.soil.CO2)
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
soil_0_20_clay 0.01031 0.01031 1 39.033 0.3482 0.55854
soil_0_20_pH_H2O 0.03990 0.03990 1 36.270 1.3477 0.25326
soil_0_20_Corg 0.03609 0.03609 1 30.050 1.2192 0.27829
soil_0_20_silt 0.01225 0.01225 1 36.371 0.4139 0.52405
Fed 2.24907 2.24907 1 1.237 75.9765 0.04625 *
Ald 0.37933 0.37933 1 1.859 12.8143 0.07780 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
anova(fit.soil.AAE10)
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
soil_0_20_clay 0.02689 0.02689 1 33.372 1.1447 0.29233
soil_0_20_pH_H2O 0.00022 0.00022 1 36.721 0.0095 0.92271
soil_0_20_Corg 0.55693 0.55693 1 38.895 23.7089 1.902e-05 ***
soil_0_20_silt 0.09825 0.09825 1 34.019 4.1824 0.04864 *
Fed 0.42176 0.42176 1 1.848 17.9545 0.05892 .
Ald 0.70761 0.70761 1 2.551 30.1233 0.01795 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
anova(fit.kin.Pbalance)
Type III Analysis of Variance Table with Satterthwaite's method
Sum Sq Mean Sq NumDF DenDF F value Pr(>F)
k 411.53 411.53 1 228.31 2.6679 0.1038
log(PS) 2451.67 2451.67 1 236.98 15.8941 8.925e-05 ***
k:log(PS) 335.79 335.79 1 232.66 2.1769 0.1414
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Code
summary(fit.kin.Pbalance)
Linear mixed model fit by REML. t-tests use Satterthwaite's method [
lmerModLmerTest]
Formula: annual_P_balance ~ k * log(PS) + (1 | year) + (1 | Site) + (1 |
Site:block)
Data: D
REML criterion at convergence: 2172.1
Scaled residuals:
Min 1Q Median 3Q Max
-4.2416 -0.5978 0.0314 0.5493 2.8712
Random effects:
Groups Name Variance Std.Dev.
Site:block (Intercept) 20.33 4.508
year (Intercept) 59.32 7.702
Site (Intercept) 23.97 4.896
Residual 154.25 12.420
Number of obs: 274, groups: Site:block, 16; year, 6; Site, 4
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 43.833 10.402 146.531 4.214 4.37e-05 ***
k 84.993 52.035 228.313 1.633 0.104
log(PS) 16.947 4.251 236.979 3.987 8.92e-05 ***
k:log(PS) 33.029 22.386 232.660 1.475 0.141
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Correlation of Fixed Effects:
(Intr) k lg(PS)
k -0.887
log(PS) 0.858 -0.901
k:log(PS) -0.843 0.944 -0.971
Code
fit.kin.Pbalance |>r.squaredGLMM()
R2m R2c
[1,] 0.5718185 0.7438699
Code
fit.kin.Pexport |>r.squaredGLMM()
R2m R2c
[1,] 0.06433359 0.6476313
Code
fit.kin.Yrel |>r.squaredGLMM()
R2m R2c
[1,] 0.02182182 0.4385486
Code
fit.kin.Ynorm |>r.squaredGLMM()
R2m R2c
[1,] 0.01391747 0.3596733
Code
# Verhalten der Modelparameter und Ertragsdaten auf P-CO2 und P-AAE10
Since we now model two measurement methods, we do not expect correlations by Site/year/etc
Coefficient Table for Ynorm and Yrel. Significant codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05
Covariate
Yn-STP-CO2
Yn-STP-AAE10
Yn-STP-GRUD
Yn-Kinetic
Yr-STP-CO2
Yr-STP-AAE10
Yr-STP-GRUD
Yr-Kinetic
(Intercept)
***1.059
***0.532
***1.096
0.980
***104.862
***75.343
***108.494
56.375
k
2.262
** 377.498
k:log(PS)
0.931
** 171.507
log(PS)
-0.063
* -27.486
log(soil_0_20_P_AAE10)
***0.120
-0.006
** 7.111
-0.933
log(soil_0_20_P_CO2)
***0.162
0.137
** 8.853
* 9.692
log(soil_0_20_P_CO2):log(soil_0_20_P_AAE10)
0.016
R2m
0.218
0.198
0.220
0.014
0.074
0.063
0.073
0.022
R2c
0.358
0.474
0.365
0.360
0.569
0.537
0.577
0.439
Code
# Step 1: Prepare the data for correlation analysis# Create a new dataframe containing only the necessary columns and remove rows with NAscorrelation_data <- D %>%select(uid, PS, k,E_mod_10080, E_exp_10080,E_exp_1440, n_1440) %>%na.omit()# --- Capacity Comparison (PS vs. E-value) ---# Step 2: Visualize the relationshipggplot(correlation_data, aes(x = E_mod_10080, y = PS)) +geom_point(size =3, alpha =0.7) +geom_smooth(method ="lm", se =FALSE, color ="blue") +labs(title =TeX("Relationship between Desorbable P and Exchangeable P"),x =TeX("Isotopically Exchangeable P, $E_{10080}$ (mg kg$^{-1}$)"),y =TeX("Desorbable P, $P_{desorb}$ (mg L$^{-1}$)") ) +theme_bw()
`geom_smooth()` using formula = 'y ~ x'
Code
# Step 3: Perform the formal correlation test# Using Spearman's rank correlation is a robust choicespearman_capacity <-cor.test(correlation_data$PS, correlation_data$E_exp_10080, method ="spearman")print("Spearman correlation between PS and E_exp_10080:")
[1] "Spearman correlation between PS and E_exp_10080:"
Code
print(spearman_capacity)
Spearman's rank correlation rho
data: correlation_data$PS and correlation_data$E_exp_10080
S = 63135, p-value = 0.0001128
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.404355
Code
# --- Kinetic Comparison (k vs. n-value) ---# Step 2: Visualize the relationshipggplot(correlation_data, aes(x = n_1440, y = k)) +geom_point(size =3, alpha =0.7) +geom_smooth(method ="lm", se =FALSE, color ="blue") +labs(title =TeX("Relationship between Desorption Rate and Exchange Rate"),x =TeX("IEK Kinetic Parameter, $n_{60}$"),y =TeX("Desorption Rate Constant, $k$ (min$^{-1}$)") ) +theme_bw()
`geom_smooth()` using formula = 'y ~ x'
Code
# Step 3: Perform the formal correlation testspearman_kinetic <-cor.test(correlation_data$k, correlation_data$n_1440, method ="spearman")print("Spearman correlation between k and n_60:")
[1] "Spearman correlation between k and n_60:"
Code
print(spearman_kinetic)
Spearman's rank correlation rho
data: correlation_data$k and correlation_data$n_1440
S = 67681, p-value = 0.0006275
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.3614673