Skip to content

Instantly share code, notes, and snippets.

@avi202020
avi202020 / LinearRegression.R
Created December 5, 2020 13:40 — forked from mGalarnyk/LinearRegression.R
Univariate Linear Regression (relationship between the dependent variable y and the independent variable x is linear) using R programming Language for the blog post https://medium.com/@GalarnykMichael/univariate-linear-regression-using-r-programming-3db499bdd1e3#.kcm3t9rl3
# Linear Regression predicts linear relationship between two variables
# Set path to Desktop
setwd("~/Desktop")
download.file(url = 'https://raw.githubusercontent.com/mGalarnyk/Python_Tutorials/master/Python_Basics/Linear_Regression/linear.csv'
, destfile = 'linear.csv')
rawData=read.csv("linear.csv", header=T)
# Show first n entries of data.frame, notice NA values