BiologicalRecordsCentre / sparta

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

Add Phi and Alpha as variables #13

Closed AugustT closed 11 years ago

AugustT commented 11 years ago

Phi and Alpha should be able to be set by the user. Phi is the target value of the frequency weighted mean frequency and alpha is the proportion of the expected number of species in a cell to be treated as benchmarks.

Agnieszka-Doroszuk commented 11 years ago

What would happen if I set up target Phi too different from the "true" target Phi? How to determine target Phi if the sampling is low and data is thin?

AugustT commented 11 years ago

Both phi and alpha values can now be passed to sparta() and frescalo() and this will go up in version 0.0.12. There are limits the the values you can pass otherwise Mark's fortran stops with a warning. I have therefore limited the value you can supply and give an informative warning message if you fail to comply.

At the moment if the user provides valid phi and alpha values, frescalo is run with those values no questions asked. However, if the value of phi you give is lower than the 98.5 percentile of input phi (which is what Mark used in his paper), you will get a warning message in R and in the log file.If you don't specify a value of phi, and the default value (0.74) is smaller than the 98.5 percentile of input phi, the value of phi is automatically increased to just above the 98.5 percentile of input phi and frescalo is re-run. In this case a warning message is returned to R telling you what has been done.