Member-only story
Linear regression in R for busy developers
(Sometimes simple model like linear regression can also win the war of machine learning algorithm)

Since the title speaks for busy developers, I don’t want to write any boring introduction. Fire up your Rstudio and let’s get started.
Download dataset from here
Step 1: Load the dataset
Step 2: Create a linear model
Assumption:
BMI(independent variable): Body mass index
charges(dependent variable): Charges depend on BMI
(Note: this is only my assumption for this article that charges are dependent on BMI.)

Step 3: Visualize what you did
Execute the following code to visualize your plot:
plot(select_dataframe, col="blue")

Cool! Now let’s draw that regression line we were waiting for. Execute the following command to draw a linear line above the graph shown above.