灵敏度和特异性最大总和的最佳截止点
我想计算我的 glm 模型的敏感性特异性总和最大化阈值(约登指数):
model = glm(present ~ Summer_precipitation + Summer_Temperature + Frost_days + Snowcover_days + Forest_presence + Population_密度 + Tick_密度 + Vaccination_coverage, family = binomial( link = "logit"), data = tbe_data)
我计算了模型的预测概率。 “天气数据”是上面模型中列出的所有协变量栅格的堆叠栅格文件。
#根据天气数据创建预测
predictions=predict(weather_data,model,type="response")
#plot 预测
plot(predictions)
我现在如何计算最佳概率模型的截止点?我会使用“cutpointr”函数,但不知道如何使代码适应我的情况
I would like to calculate the sensitivity-specificity sum maximization threshold (Youden Index) for my glm model:
model = glm(present ~ Summer_precipitation + Summer_temperature + Frost_days + Snowcover_days + Forest_presence + Population_density + Tick_density + Vaccination_coverage, family = binomial(link = "logit"), data = tbe_data)
I calculated predicted probabilities for the model. "Weather data" is a stacked raster file of all the covariate rasters listed in the model above.
#create predictions based on weather data
predictions=predict(weather_data,model,type="response")
#plot predictions
plot(predictions)
How can I now calculate the optimal probability cutoff point from the model? I would use the "cutpointr" function but don't know how to adapt the code to my situation
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用 R 包
dismo
进行许多建模评估。您可以首先计算完美的threshold()
,然后精确地使用该阈值evaluate()
。I use R package
dismo
for many of my modelling evaluations. You can first calculate the perfectthreshold()
and thenevaluate()
using excatly this threshold.