Description Usage Arguments Value Author(s) References See Also Examples

The optiPair function can optimize a model's discrimination threshold based on a pair of model evaluation measures that balance each other, such as sensitivity-specificity, omission-commission, or underprediction-overprediction (Fielding & Bell 1997; Liu et al. 2011; Barbosa et al. 2013). The function plots both measures in the given pair against all thresholds with a given i nterval, and calculates the optimal sum, difference and mean of the two measures.

1 2 3 |

`model` |
a model object of class "glm". |

`obs` |
a vector of observed presences (1) and absences (0) or another
binary response variable. This argument is ignored if |

`pred` |
a vector with the corresponding predicted values of presence
probability, habitat suitability, environmental favourability or alike. This argument is ignored if |

`measures` |
a character vector of length 2 indicating the pair of measures whose curves to plot and whose thresholds to optimize. The default is c("Sensitivity", "Specificity"). |

`interval` |
the interval of thresholds at which to calculate the measures. The default is 0.01. |

`plot` |
logical indicating whether or not to plot the pair of measures. |

`plot.sum` |
logical, whether to plot the sum (+) of both measures in the pair. Defaults to |

`plot.diff` |
logical, whether to plot the difference (-) between both measures in the pair. Defaults to |

`ylim` |
a character vector of length 2 indicating the lower and upper limits for the y axis. The default is |

`...` |
additional arguments to be passed to the |

The output is a list with the following components:

`measures.values` |
a data frame with the values of the chosen pair of measures, as well as their difference, sum and mean, at each threshold. |

`MinDiff` |
numeric value, the minimum difference between both measures. |

`ThreshDiff` |
numeric value, the threshold that minimizes the difference between both measures. |

`MaxSum` |
numeric value, the maximum sum of both measures. |

`ThreshSum` |
numeric value, the threshold that maximizes the sum of both measures. |

`MaxMean` |
numeric value, the maximum mean of both measures. |

`ThreshMean` |
numeric value, the threshold that maximizes the mean of both measures. |

A. Marcia Barbosa

Barbosa, A.M., Real, R., Munoz, A.-R. & Brown, J.A. (2013) New measures for assessing model equilibrium and prediction mismatch in species distribution models. Diversity and Distributions 19: 1333-1338

Fielding A.H. & Bell J.F. (1997) A review of methods for the assessment of prediction errors in conservation presence/absence models. Environmental Conservation 24: 38-49

Liu C., White M., & Newell G. (2011) Measuring and comparing the accuracy of species distribution models with presence-absence data. Ecography, 34, 232-243.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ```
# load sample models:
data(rotif.mods)
# choose a particular model to play with:
mod <- rotif.mods$models[[1]]
optiPair(model = mod)
optiPair(model = mod, measures = c("UPR", "OPR"))
# you can also use optiPair with vectors of observed and predicted values
# instead of with a model object:
optiPair(obs = mod$y, pred = mod$fitted.values,
measures = c("UPR", "OPR"))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.