Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

predicted.prevalence

Predicted Prevalence


Description

predicted.prevalence calculates the observed prevalence and predicted prevalence for one or more models at one or more thresholds.

Usage

predicted.prevalence(DATA, threshold = 0.5, which.model = (1:N.models), na.rm = FALSE)

Arguments

DATA

a matrix or dataframe of observed and predicted values where each row represents one plot and where columns are:

DATA[,1] plot ID text
DATA[,2] observed values zero-one values
DATA[,3] predicted probabilities from first model numeric (between 0 and 1)
DATA[,4] predicted probabilities from second model, etc...
threshold

a cutoff values between zero and one used for translating predicted probabilities into 0 /1 values, defaults to 0.5. threshold can be a single value between zero and one, a vector of values between zero and one, or a positive integer representing the number of evenly spaced thresholds to calculate.

which.model

a number indicating which models from DATA should be used

na.rm

a logical indicating whether missing values should be removed

Details

Function will work for one model and multiple thresholds, or one threshold and multiple models, or multiple models each with their own threshold.

Value

returns a dataframe where:

[,1] threshold thresholds used for each row in the table
[,2] Obs.Prevalence this will be the same in each row
[,3] Model 1 Predicted prevalence for first model
[,4] Model 2 Predicted prevalence for second model, etc...

Author(s)

Elizabeth Freeman eafreeman@fs.fed.us

Examples

data(SIM3DATA)

predicted.prevalence(SIM3DATA)
predicted.prevalence(SIM3DATA,threshold=11,which.model=1,na.rm=FALSE)
predicted.prevalence(SIM3DATA,threshold=c(.2,.5,.7),na.rm=FALSE)

PresenceAbsence

Presence-Absence Model Evaluation

v1.1.10
Unlimited
Authors
Elizabeth Freeman
Initial release
2022-02-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.