Logistic regression is a technique used to make a prediction when the thing to predict can take only one of two values. For example, suppose you want to predict a person’s political party (“red” or “blue”) based on their age and education level.

Here’s my micro-demo using the R language. First I read data stored in a text file: