Add Figure 4 yield-management analyses to manuscript vignette - #32
Add Figure 4 yield-management analyses to manuscript vignette#32ANAMASGARD wants to merge 3 commits into
Conversation
Signed-off-by: Gaurav Chaudhary <chaudharygaurav2004@gmail.com>
dlebauer
left a comment
There was a problem hiding this comment.
This is a very nice improvement, thank you for taking the time to implement these analyses!
The requested panels and tables render successfully, but the OLS statistical model treats repeated observations within treatments and sites as independent, although they are not. The original analysis used site/year random effects.
Specifically, please apply the original, hierarchical statistical models used in https://github.com/ebimodeling/betydb_manuscript/blob/master/gcbb_manuscript.Rmd, e.g. see pavi_re and misp_re models starting on line 867. There were some OLS regressions in that document, but those were just to compare model fits and were not presented as results. Please use these species-level random effects models to calculate the statistics and show the lines in the plots. You should be able to copy-paste the relevant code used for fitting, plotting, and statistical summaries. You may use different R packages, provided it implements the same model structure and produces equivalent statistical summaries and fitted lines.
Description
Adds the minimum requested Figure 4 analyses to the manuscript vignette:
The implementation links yield observations to management records through the
managements_treatmentsbridge table and reduces management data to one analysis-ready row per treatment before joining.Data handling
traitsviewyield records forMiscanthusandPanicumg m-2 y-1tokg ha-1 y-1selecting, summing, or averaging them
coord_cartesian()for manuscript-like display limits while retainingvalid observations in the regression models
The vignette also explains that these are descriptive regressions using the
current public
betydatasnapshot and are not claimed to exactly reproduce thehistorical mixed-model results from the manuscript.
Related Issue(s)
Closes #25
Type of Change
Checklist
Validation
quarto::quarto_render("vignettes/manuscript.qmd")devtools::test()R CMD check --no-vignettes --no-manualgit diff --checkpassedvignettes/manuscript.qmdwas modifiedA Quarto panel-layout warning remains during direct rendering:
Panel layout for fig-yield-management has no contentThe HTML is still generated and the two plots render, but this warning should be reviewed as part of the PR.
Data Changes
Not applicable. This PR does not modify packaged datasets or files under
data-raw/.Screenshots
Local validation
Rendered Figure 4
Additional Notes
The Figure 4 scope is limited to the explicitly requested panels (a) and (d). Precipitation and growing-degree-day panels are outside this PR.