From the course: Tableau and R for Analytics Projects

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Create a single- and multiple-variable linear regression model in R

Create a single- and multiple-variable linear regression model in R

From the course: Tableau and R for Analytics Projects

Start my 1-month free trial

Create a single- and multiple-variable linear regression model in R

- [Instructor] Linear regression, which finds the line that best fits a dataset is one of the most useful forms of data analysis you can perform. In this movie, I will show you how to perform linear regression using one or more input variables in R. I have opened a new R console and I can start by importing data from an external file into a vector. So I'll start by naming a variable for the vector. I'll just call it rdata. The assignment operator is a less than sign followed by a hyphen, looks like a left pointing arrow. Now we can use the read.table method so I'll type read.table followed by a ('. Now we need to identify the file path for the data that we want to use. To do that in Windows, I will press Alt + Tab to move to the folder that contains the file. And then on the address bar, I'll click the folder icon to highlight the actually path in my operating system to that file. I'll press Ctrl + C and then Alt + Tab…

Contents