[英]r programming - logistic regression plot
mutate(prob = ifelse(outcome == "pos", 0","1"))%>%
> ggplot(aes( plasma_glucose, prob)) +
+ geom_point(alpha = 1) +
+ geom_smooth(method = "glm", method.args = list(family = "binomial")) +
+ labs(
+ title = "Logistic Regression Model",
+ x = "Plasma Glucose Concentration",
+ y = "Probability of being diabete-pos"
+ )
輸出錯誤: mutate()
column prob
有問題。 我prob = ifelse(outcome == "pos", 0, 1, )
。 x 未使用的參數 (alist())
我是 R 編程的新手,不知道如何糾正上面的代碼? 我正在嘗試 plot 邏輯回歸結果。
這是關於您的第一個錯誤消息unused argument (alist())
的答案,以防其他人通過谷歌搜索該錯誤消息到達這里:
unused argument
錯誤:例如:foo <- function(x) x
foo(x = 10, y = 10) # notice the y-argument
#> Error in foo(x = 10, y = 10): unused argument (y = 10)
unused argument (alist())
錯誤,因為 R 將其視為另一個完全空的參數。 例如:foo(x = 10, ) # notice the comma
#> Error in foo(x = 10, ): unused argument (alist())
正如@Rfanatic 在評論中所說,刪除多余的逗號,此錯誤消息就會消失。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.