【发布时间】:2018-07-01 18:43:34
【问题描述】:
在给定变量 x 的情况下,我有一个任务选择数据集(1 或 0)。以 mtcars 为例
#binomial_smooth() from https://ggplot2.tidyverse.org/reference/geom_smooth.html
binomial_smooth <- function(...) {
geom_smooth(method = "glm", method.args = list(family = "binomial"), ...)
}
#plot
ggplot(data = mtcars, aes(x = disp, y = am)) + geom_point(alpha = 0.5) + binomial_smooth()
#create a model
model <- glm(am ~ disp, family = "binomial", data = mtcars)
其中 am 将是主题选择并显示 x 变量。我想计算二进制变量 = 0.5 的 x +/- SE 的值(我想这是 binomial_smooth 绘制的,尽管我可能是错的)。
使用 mtcars,我想找出 disp +/- SE am = 0.5。环顾四周,只是变得更加困惑,所以任何帮助将不胜感激!
最好的,
【问题讨论】:
-
也许关注link?
-
如果我理解正确的话,你会追求这样的东西。 stats.stackexchange.com/questions/44790/…
标签: r logistic-regression prediction