Skip to content

Instantly share code, notes, and snippets.

@revodavid
Created August 2, 2016 15:05
Show Gist options
  • Select an option

  • Save revodavid/a6cc2bf05da2c9e1894ff95941499b42 to your computer and use it in GitHub Desktop.

Select an option

Save revodavid/a6cc2bf05da2c9e1894ff95941499b42 to your computer and use it in GitHub Desktop.
fit_glm <- glm(bad_widget ~ x, training_set, family=binomial(link="logit"))
glm_link_scores <- predict(fit_glm, test_set, type="link")
glm_response_scores <- predict(fit_glm, test_set, type="response")
score_data <- data.frame(link=glm_link_scores,
response=glm_response_scores,
bad_widget=test_set$bad_widget,
stringsAsFactors=FALSE)
score_data %>%
ggplot(aes(x=link, y=response, col=bad_widget)) +
scale_color_manual(values=c("black", "red")) +
geom_point() +
geom_rug() +
ggtitle("Both link and response scores put cases in the same order")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment