BiologicalRecordsCentre / sparta

Species Presence/Absence R Trends Analyses
http://biologicalrecordscentre.github.io/sparta/index.html
MIT License
21 stars 24 forks source link

Reporting Rate model does not log-transform list length #212

Closed drnickisaac closed 4 months ago

drnickisaac commented 3 years ago

In the 2014 paper and the original Szabo paper, the response is modelled as a logarithmic function of list length. It turns out that sparta's implementation of this does not perform a log transformation. Philippe Goffart raised this with me via email.

The fix looks easy: on line 14 of formulaBuilder.R: I replace if(list_length) model_formula <- paste(model_formula, '+listLength') with if(list_length) model_formula <- paste(model_formula, '+ log(listLength)')

I have implemented this on my local version and will test before making a pull request.

robboyd commented 3 years ago

Did you ever make the pull request @drnickisaac?

DylanCarbone commented 5 months ago

Hi,

Just starting to close some of the older and simpler issues.

I just checked the formulaBuilder function and can confirm, that this change has been made and pushed to the main branch. @drnickisaac, if you are happy to do so, could you please close this issue?

Thanks