LoslegenKostenlos loslegen

Visualizing linear and logistic models

As with linear regressions, ggplot2 will draw model predictions for a logistic regression without you having to worry about the modeling code yourself. To see how the predictions differ for linear and logistic regressions, try drawing both trend lines side by side. Spoiler: you should see a linear (straight line) trend from the linear model, and a logistic (S-shaped) trend from the logistic model.

churn is available and ggplot2 is loaded.

Diese Übung ist Teil des Kurses

Introduction to Regression in R

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Using churn plot has_churned vs. time_since_first_purchase
___ +
  # Make it a scatter plot
  ___ +
  # Add an lm trend line, no std error ribbon, colored red
  ___
Code bearbeiten und ausführen