【发布时间】:2016-12-21 23:05:18
【问题描述】:
我正在使用 GLM 进行物种分布建模。我有来自 GBIF (http://www.gbif.org/species/5846514) 的 凯门鳄 物种的(南美洲)数据和来自 Worldclim (http://worldclim.org/current) 的生物气候数据。我试图运行 GLM 以模拟物种分布(使用 dismo 包):
modelGLM = pres ~ bioclim_10 + bioclim_11+ bioclim_16 + I(bioclim_16^2) + bioclim_17
GLM <- glm(modelGLM, family=binomial(link=logit), data=PresBackTrainRaw)
projecaoSuitability = predict(predictors, GLM, type='response')
直到这里,一切看起来都很好,但是当我尝试获取阈值(截止)时,返回负值:
library(dismo)
> evaluation=evaluate(p=presencesTest,a=backgroundTest,m=GLM,x=predictors)
> thresholdValues=threshold(evaluation,'spec_sens')
> thresholdValues
> [1] -2.578797
由于 glm 输出(type='response')的范围是 0 到 1,负阈值没有意义。有人可以帮我看看有什么问题吗?
【问题讨论】:
-
您是否 100% 确定此计算是在概率尺度而非 logit/log-odds 尺度上进行的?
-
来自
?evaluate:evaluate似乎有一个...参数用于predict。尝试添加type='response' -
是的!这提供了正确的阈值。非常感谢!