Re: [R] Plotting Fitted vs Observed Values in Logistic Regression Model

2023-08-02 Thread Rui Barradas
Às 14:57 de 01/08/2023, Paul Bernal escreveu: Dear friends, I hope this email finds you all well. This is the dataset I am working with: dput(random_mod12_data2) structure(list(Index = c(1L, 5L, 11L, 3L, 2L, 8L, 9L, 4L), x = c(5, 13, 25, 9, 7, 19, 21, 11), n = c(500, 500, 500, 500, 500, 500, 50

Re: [R] Plotting Fitted vs Observed Values in Logistic Regression Model

2023-08-01 Thread Ben Bolker
logistic_regmod2 <- glm(formula = ratio~x, family = binomial(logit), data = random_mod12_data2, weights =n) plot(ratio ~ x, data = random_mod12_data2) pframe <- data.frame(x = sort(random_mod12_data2$x)) pframe$ratio <- predict(logistic_regmod2, newdata = pframe, type = "response") with(pframe

[R] Plotting Fitted vs Observed Values in Logistic Regression Model

2023-08-01 Thread Paul Bernal
Dear friends, I hope this email finds you all well. This is the dataset I am working with: dput(random_mod12_data2) structure(list(Index = c(1L, 5L, 11L, 3L, 2L, 8L, 9L, 4L), x = c(5, 13, 25, 9, 7, 19, 21, 11), n = c(500, 500, 500, 500, 500, 500, 500, 500), r = c(100, 211, 391, 147, 122, 310, 343