Last updated: 2022-01-17

Checks: 6 1

Knit directory: veg_alcontar/

This reproducible R Markdown analysis was created with workflowr (version 1.7.0). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.


The R Markdown is untracked by Git. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.

The command set.seed(20211007) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.

Great job! Using relative paths to the files within your workflowr project makes it easier to run your code on other machines.

Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.

The results in this page were generated with repository version 5263e23. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.

Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:


Ignored files:
    Ignored:    .Rhistory
    Ignored:    .Rproj.user/

Untracked files:
    Untracked:  analysis/ndvi_pastoreo.Rmd
    Untracked:  analysis/tasa_consumo.Rmd
    Untracked:  analysis/temporal_all_EPs.Rmd
    Untracked:  analysis/temporal_analysis_rangos.Rmd
    Untracked:  data/Datos_para correlaciones_Antonio.xlsx
    Untracked:  data/Datos_veg_congr_for_2022.xlsx
    Untracked:  data/Resultados_todos los partners.xlsx
    Untracked:  data/Tablas_horas_pastoreo_EP_V3.xlsx
    Untracked:  data/s2ndvi.csv
    Untracked:  data/tablas_horas_pastoreo.xlsx
    Untracked:  output/congreso_forestal/

Unstaged changes:
    Modified:   analysis/temporal_analysis.Rmd

Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.


There are no past versions. Publish this analysis with wflow_publish() to start tracking its development.


Introdución y Objetivos

  • Analizar la evolución de los parámetros de vegetación a lo largo del tiempo, entre dos tratamientos: Herbivorísmo pírico (HP) y Quemas Prescritas (QP), considerando los diferentes rangos

  • Usamos solamente datos de la quema de Otoño

  • Diseño:

    • tratamiento: HP y QP
    • rangos
    • 6 fechas de muestreo
    • 32 plots por tratamiento
     rango
treat espartal denso mat. claro mat. denso mat. medio
   HP             48         48         48         48
   QP             48         48         48         48

Análisis estadístico

  • Se utilizaron Modelos Mixtos Aditivos Generalizados (GAMM) para evaluar los efectos del tratamiento (Quemas Prescritos vs. Herbivorismo Pírico) sobre la evolución de la cobertura vegetal, el fitovolumen y los índices de diversidad (Shannon, Riqueza).

Riqueza

Modelo

f <- as.formula(
  riq ~ 
    s(meses, by = interaction(treat, rango), k = 5, bs = "cs") +
    s(meses, by = treat, k = 5, bs = "cs") + 
    s(meses, by = rango, k = 5, bs = "cs") + 
    treat * rango
)

fi <- as.formula(
  riq ~ 
    s(meses, by = interaction(treat, rango), k = 5, bs = "cs") +
    treat * rango
)

fni <- as.formula(
  riq ~ 
    s(meses, by = treat, k = 5, bs = "cs") + 
    s(meses, by = rango, k = 5, bs = "cs") + 
    treat * rango
)


mfull <- gamm(f,
          random = list(quadrat = ~1), 
          data = veg, 
          family = poisson,
          method = "ML")

 Maximum number of PQL iterations:  20 
mi <- gamm(fi,
          random = list(quadrat = ~1), 
          data = veg, 
          family = poisson,
          method = "ML")

 Maximum number of PQL iterations:  20 
mni <- gamm(fni,
          random = list(quadrat = ~1), 
          data = veg, 
          family = poisson,
          method = "ML")

 Maximum number of PQL iterations:  20 
  • Seleccionamos los suavizados, y elegimos el modelo con menor AIC
df AIC
mni\(lme </td> <td style="text-align:right;"> 15 </td> <td style="text-align:right;"> 319.8728 </td> </tr> <tr> <td style="text-align:left;"> mfull\)lme 23 334.4627
mi$lme 17 336.0228
# Distribution of Model Family

Predicted Distribution of Residuals

 Distribution Probability
       normal         66%
      tweedie         34%

Predicted Distribution of Response

               Distribution Probability
              beta-binomial         59%
          negative binomial         12%
 neg. binomial (zero-infl.)          9%

Model validation

A. parametric coefficients Estimate Std. Error t-value p-value
(Intercept) 2.1133 0.0893 23.6583 < 0.0001
treatQP -0.3109 0.1287 -2.4157 0.0162
rangomat. claro 0.2813 0.1236 2.2766 0.0234
rangomat. denso 0.2007 0.1242 1.6162 0.1069
rangomat. medio 0.2099 0.1241 1.6909 0.0917
treatQP:rangomat. claro 0.0214 0.1781 0.1201 0.9045
treatQP:rangomat. denso 0.0671 0.1788 0.3751 0.7078
treatQP:rangomat. medio 0.0943 0.1785 0.5283 0.5976
B. smooth terms edf Ref.df F-value p-value
s(meses):treatHP 1.6005 4.0000 4.1012 0.0001
s(meses):treatQP 3.4564 4.0000 6.4054 < 0.0001
s(meses):rangoespartal denso 2.7565 4.0000 7.5048 < 0.0001
s(meses):rangomat. claro 0.0000 4.0000 0.0000 0.9918
s(meses):rangomat. denso 0.0000 4.0000 0.0000 0.5012
s(meses):rangomat. medio 0.0000 4.0000 0.0000 0.7363

Diversidad

Modelo

f <- as.formula(
  shan ~ 
    s(meses, by = interaction(treat, rango), k = 5, bs = "cs") +
    s(meses, by = treat, k = 5, bs = "cs") + 
    s(meses, by = rango, k = 5, bs = "cs") + 
    treat * rango
)

fi <- as.formula(
  shan ~ 
    s(meses, by = interaction(treat, rango), k = 5, bs = "cs") +
    treat * rango
)

fni <- as.formula(
  shan ~ 
    s(meses, by = treat, k = 5, bs = "cs") + 
    s(meses, by = rango, k = 5, bs = "cs") + 
    treat * rango
)


mfull <- gamm(f,
          random = list(quadrat = ~1), 
          data = veg, 
          family = tw,
          method = "ML")

 Maximum number of PQL iterations:  20 
mi <- gamm(fi,
          random = list(quadrat = ~1), 
          data = veg, 
          family = tw,
          method = "ML")

 Maximum number of PQL iterations:  20 
mni <- gamm(fni,
          random = list(quadrat = ~1), 
          data = veg, 
          family = tw,
          method = "ML")

 Maximum number of PQL iterations:  20 
  • Seleccionamos los suavizados, y elegimos el modelo con menor AIC
df AIC
mni\(lme </td> <td style="text-align:right;"> 16 </td> <td style="text-align:right;"> 312.3255 </td> </tr> <tr> <td style="text-align:left;"> mi\)lme 18 326.0420
mfull$lme 24 329.8890
# Distribution of Model Family

Predicted Distribution of Residuals

 Distribution Probability
       normal         62%
      tweedie         19%
         beta         12%

Predicted Distribution of Response

 Distribution Probability
      tweedie         47%
      weibull         25%
         beta         12%

Model validation

A. parametric coefficients Estimate Std. Error t-value p-value
(Intercept) -0.1894 0.1138 -1.6634 0.0971
treatQP -0.3762 0.1620 -2.3218 0.0208
rangomat. claro 0.7181 0.1590 4.5167 < 0.0001
rangomat. denso 0.4363 0.1597 2.7329 0.0066
rangomat. medio 0.4576 0.1596 2.8665 0.0044
treatQP:rangomat. claro 0.2180 0.2258 0.9652 0.3351
treatQP:rangomat. denso 0.3415 0.2266 1.5075 0.1325
treatQP:rangomat. medio 0.4197 0.2264 1.8538 0.0646
B. smooth terms edf Ref.df F-value p-value
s(meses):treatHP 2.3165 4.0000 2.1678 0.0131
s(meses):treatQP 2.2922 4.0000 3.6264 0.0006
s(meses):rangoespartal denso 3.0818 4.0000 20.0725 < 0.0001
s(meses):rangomat. claro 0.0000 4.0000 0.0000 0.5747
s(meses):rangomat. denso 1.8420 4.0000 2.6999 0.0022
s(meses):rangomat. medio 0.0000 4.0000 0.0000 0.5277

Cobertura

Modelo

f <- as.formula(
  cob ~ 
    s(meses, by = interaction(treat, rango), k = 5, bs = "cs") +
    s(meses, by = treat, k = 5, bs = "cs") + 
    s(meses, by = rango, k = 5, bs = "cs") + 
    treat * rango
)

fi <- as.formula(
  cob ~ 
    s(meses, by = interaction(treat, rango), k = 5, bs = "cs") +
    treat * rango
)

fni <- as.formula(
  cob ~ 
    s(meses, by = treat, k = 5, bs = "cs") + 
    s(meses, by = rango, k = 5, bs = "cs") + 
    treat * rango
)


mfull <- gamm(f,
          random = list(quadrat = ~1), 
          data = veg, 
          family = nb,
          method = "ML")

 Maximum number of PQL iterations:  20 
mi <- gamm(fi,
          random = list(quadrat = ~1), 
          data = veg, 
          family = nb,
          method = "ML")

 Maximum number of PQL iterations:  20 
mni <- gamm(fni,
          random = list(quadrat = ~1), 
          data = veg, 
          family = nb,
          method = "ML")

 Maximum number of PQL iterations:  20 
  • Seleccionamos los suavizados, y elegimos el modelo con menor AIC
df AIC
mni\(lme </td> <td style="text-align:right;"> 16 </td> <td style="text-align:right;"> 553.3551 </td> </tr> <tr> <td style="text-align:left;"> mfull\)lme 24 569.3552
mi$lme 18 604.5710
# Distribution of Model Family

Predicted Distribution of Residuals

 Distribution Probability
       normal         69%
      tweedie         28%
         beta          3%

Predicted Distribution of Response

               Distribution Probability
 neg. binomial (zero-infl.)         91%
              beta-binomial          9%

Model validation

A. parametric coefficients Estimate Std. Error t-value p-value
(Intercept) 3.3643 0.1385 24.2926 < 0.0001
treatQP -0.0363 0.1959 -0.1855 0.8530
rangomat. claro -0.6656 0.1960 -3.3959 0.0008
rangomat. denso -0.1238 0.1959 -0.6320 0.5278
rangomat. medio -0.0805 0.1958 -0.4109 0.6814
treatQP:rangomat. claro 0.0529 0.2772 0.1909 0.8487
treatQP:rangomat. denso -0.0637 0.2771 -0.2299 0.8183
treatQP:rangomat. medio -0.0284 0.2770 -0.1025 0.9184
B. smooth terms edf Ref.df F-value p-value
s(meses):treatHP 3.2434 4.0000 5.4764 < 0.0001
s(meses):treatQP 3.7914 4.0000 21.8033 < 0.0001
s(meses):rangoespartal denso 3.8968 4.0000 33.2093 < 0.0001
s(meses):rangomat. claro 0.0000 4.0000 0.0000 0.1724
s(meses):rangomat. denso 3.8000 4.0000 25.9436 < 0.0001
s(meses):rangomat. medio 1.9142 4.0000 1.1067 0.0882

Fitovolumen

Modelo

f <- as.formula(
  fitovol ~ 
    s(meses, by = interaction(treat, rango), k = 5, bs = "cs") +
    s(meses, by = treat, k = 5, bs = "cs") + 
    s(meses, by = rango, k = 5, bs = "cs") + 
    treat * rango
)

fi <- as.formula(
  fitovol ~ 
    s(meses, by = interaction(treat, rango), k = 5, bs = "cs") +
    treat * rango
)

fni <- as.formula(
  fitovol ~ 
    s(meses, by = treat, k = 5, bs = "cs") + 
    s(meses, by = rango, k = 5, bs = "cs") + 
    treat * rango
)


mfull <- gamm(f,
          random = list(quadrat = ~1), 
          data = veg, 
          family = tw,
          method = "ML")

 Maximum number of PQL iterations:  20 
mi <- gamm(fi,
          random = list(quadrat = ~1), 
          data = veg, 
          family = tw,
          method = "ML")

 Maximum number of PQL iterations:  20 
mni <- gamm(fni,
          random = list(quadrat = ~1), 
          data = veg, 
          family = tw,
          method = "ML")

 Maximum number of PQL iterations:  20 
  • Seleccionamos los suavizados, y elegimos el modelo con menor AIC
df AIC
mni\(lme </td> <td style="text-align:right;"> 16 </td> <td style="text-align:right;"> 903.7188 </td> </tr> <tr> <td style="text-align:left;"> mfull\)lme 24 919.8059
mi$lme 18 958.6921
# Distribution of Model Family

Predicted Distribution of Residuals

 Distribution Probability
       normal         53%
      tweedie         47%

Predicted Distribution of Response

 Distribution Probability
    lognormal         31%
      tweedie         22%
            F         16%

Model validation

A. parametric coefficients Estimate Std. Error t-value p-value
(Intercept) 6.9438 0.1776 39.1092 < 0.0001
treatQP -0.2177 0.2505 -0.8691 0.3854
rangomat. claro -1.8986 0.2648 -7.1699 < 0.0001
rangomat. denso -0.6566 0.2539 -2.5857 0.0101
rangomat. medio -0.7835 0.2550 -3.0727 0.0023
treatQP:rangomat. claro 0.2753 0.3724 0.7391 0.4603
treatQP:rangomat. denso 0.0413 0.3558 0.1162 0.9076
treatQP:rangomat. medio 0.0687 0.3597 0.1911 0.8485
B. smooth terms edf Ref.df F-value p-value
s(meses):treatHP 3.5747 4.0000 29.5108 < 0.0001
s(meses):treatQP 3.7773 4.0000 42.6866 < 0.0001
s(meses):rangoespartal denso 3.7961 4.0000 19.4941 < 0.0001
s(meses):rangomat. claro 0.0000 4.0000 0.0000 0.7831
s(meses):rangomat. denso 3.7580 4.0000 22.1492 < 0.0001
s(meses):rangomat. medio 0.0000 4.0000 0.0000 0.7361

Overall

  • Smooth terms
    Variable term edf ref.df F p
    Richness s(meses):treatHP 1.601 4 4.10 < 0.001
    Richness s(meses):treatQP 3.456 4 6.40 < 0.001
    Richness s(meses):rangoespartal denso 2.756 4 7.50 < 0.001
    Richness s(meses):rangomat. claro 0.000 4 0.00 0.992
    Richness s(meses):rangomat. denso 0.000 4 0.00 0.501
    Richness s(meses):rangomat. medio 0.000 4 0.00 0.736
    Shannon s(meses):treatHP 2.317 4 2.17 0.013
    Shannon s(meses):treatQP 2.292 4 3.63 0.001
    Shannon s(meses):rangoespartal denso 3.082 4 20.07 < 0.001
    Shannon s(meses):rangomat. claro 0.000 4 0.00 0.575
    Shannon s(meses):rangomat. denso 1.842 4 2.70 0.002
    Shannon s(meses):rangomat. medio 0.000 4 0.00 0.528
    Cobertura total s(meses):treatHP 3.243 4 5.48 < 0.001
    Cobertura total s(meses):treatQP 3.791 4 21.80 < 0.001
    Cobertura total s(meses):rangoespartal denso 3.897 4 33.21 < 0.001
    Cobertura total s(meses):rangomat. claro 0.000 4 0.00 0.172
    Cobertura total s(meses):rangomat. denso 3.800 4 25.94 < 0.001
    Cobertura total s(meses):rangomat. medio 1.914 4 1.11 0.088
    Fitovolumen s(meses):treatHP 3.575 4 29.51 < 0.001
    Fitovolumen s(meses):treatQP 3.777 4 42.69 < 0.001
    Fitovolumen s(meses):rangoespartal denso 3.796 4 19.49 < 0.001
    Fitovolumen s(meses):rangomat. claro 0.000 4 0.00 0.783
    Fitovolumen s(meses):rangomat. denso 3.758 4 22.15 < 0.001
    Fitovolumen s(meses):rangomat. medio 0.000 4 0.00 0.736
  • Parametrics terms
Variable param. terms df F p.value
Richness treat 1 5.836 0.016
Richness rango 3 1.880 0.132
Richness treat:rango 3 0.116 0.951
Shannon treat 1 5.391 0.021
Shannon rango 3 6.971 < 0.001
Shannon treat:rango 3 1.302 0.273
Cobertura total treat 1 0.034 0.853
Cobertura total rango 3 4.781 0.003
Cobertura total treat:rango 3 0.063 0.979
Fitovolumen treat 1 0.755 0.385
Fitovolumen rango 3 17.379 < 0.001
Fitovolumen treat:rango 3 0.207 0.892
Variable R2 AIC Model distribution
Richness 0.262 319.87 Poisson
Shannon 0.384 312.33 Tweedie
Cobertura total 0.698 553.36 Negative Binomial
Fitovol 0.839 903.72 Tweedie

R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.3

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] emmeans_1.5.4     plotrix_3.8-1     gtsummary_1.4.2   patchwork_1.1.1  
 [5] performance_0.8.0 broom_0.7.9       tidymv_3.2.1      kableExtra_1.3.1 
 [9] itsadug_2.4       plotfunctions_1.4 gratia_0.6.0      mgcv_1.8-33      
[13] nlme_3.1-152      janitor_2.1.0     here_1.0.1        forcats_0.5.1    
[17] stringr_1.4.0     dplyr_1.0.6       purrr_0.3.4       readr_1.4.0      
[21] tidyr_1.1.3       tibble_3.1.2      ggplot2_3.3.5     tidyverse_1.3.1  
[25] workflowr_1.7.0  

loaded via a namespace (and not attached):
 [1] TH.data_1.0-10      colorspace_2.0-2    ellipsis_0.3.2     
 [4] rprojroot_2.0.2     estimability_1.3    snakecase_0.11.0   
 [7] fs_1.5.0            rstudioapi_0.13     farver_2.1.0       
[10] fansi_0.4.2         mvtnorm_1.1-1       lubridate_1.7.10   
[13] xml2_1.3.2          codetools_0.2-18    splines_4.0.2      
[16] knitr_1.31          jsonlite_1.7.2      gt_0.3.0           
[19] dbplyr_2.1.1        compiler_4.0.2      httr_1.4.2         
[22] backports_1.2.1     assertthat_0.2.1    Matrix_1.3-2       
[25] fastmap_1.1.0       cli_2.5.0           later_1.1.0.1      
[28] htmltools_0.5.2     tools_4.0.2         coda_0.19-4        
[31] gtable_0.3.0        glue_1.4.2          Rcpp_1.0.7         
[34] cellranger_1.1.0    jquerylib_0.1.3     vctrs_0.3.8        
[37] broom.helpers_1.4.0 insight_0.14.4      xfun_0.23          
[40] ps_1.5.0            rvest_1.0.0         lifecycle_1.0.1    
[43] getPass_0.2-2       MASS_7.3-53         zoo_1.8-8          
[46] scales_1.1.1.9000   ragg_1.1.1          hms_1.0.0          
[49] promises_1.2.0.1    sandwich_3.0-0      yaml_2.2.1         
[52] mvnfast_0.2.7       sass_0.3.1          stringi_1.7.4      
[55] highr_0.8           bayestestR_0.9.0    randomForest_4.6-14
[58] systemfonts_1.0.0   rlang_0.4.12        pkgconfig_2.0.3    
[61] evaluate_0.14       lattice_0.20-41     labeling_0.4.2     
[64] processx_3.5.1      tidyselect_1.1.1    magrittr_2.0.1     
[67] R6_2.5.1            generics_0.1.0      multcomp_1.4-16    
[70] DBI_1.1.1           pillar_1.6.1        haven_2.3.1        
[73] whisker_0.4         withr_2.4.1         survival_3.2-7     
[76] modelr_0.1.8        crayon_1.4.1        utf8_1.1.4         
[79] rmarkdown_2.8       grid_4.0.2          readxl_1.3.1       
[82] callr_3.7.0         git2r_0.28.0        reprex_2.0.0       
[85] digest_0.6.27       webshot_0.5.2       xtable_1.8-4       
[88] httpuv_1.5.5        textshaping_0.3.2   munsell_0.5.0      
[91] tweedie_2.3.3       viridisLite_0.4.0   bslib_0.2.4