3.2.6 Introduction to Logistical Regression - Video 4 Logistic Regression in R
This plot shows two of our independent variables, the number of office visits on the x-axis and the number of narcotics prescribed on the y-axis. Each point is an observation or a patient in our data set. The red points are patients who received poor care, and the green points are patients who received good care. It's hard to see a trend in the data by just visually inspecting it. But it looks like maybe more office visits and more narcotics, or data points to the right of this line, are more likely to have poor care. Let's see if we can build a logistic regression model in R to better predict poor care. In our R console, let's start by reading our data set into R. Remember to navigate to the directory on your computer containing the file quality.csv. We'll call our data set "quality" and use the read.csv function to read in the data file quality.csv. Let's take a look at the structure of our data set by using the str function. We have 131 ob...