O'Reilly logo

Regression Analysis with R by Giuseppe Ciaburro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a model

Let's now look at a practical case: in a company, we have been collecting employee wages based on years of experience. We now want to create a model that allows us to see an employee's salary progression over time. Three types of employees were considered: Management, TechnicalStaff, and GeneralStaff. Let's start by importing data into the R environment; we have a worksheet named employees.xlsx:

library(readxl)setwd ("c://R")EmployeesSalary <- read_excel("employees.xlsx")summary(EmployeesSalary)

First, we loaded the library through the library command.

Remember that to install a library that is not present in the initial distribution of R, you must use the install.package function. This is the main function used to install ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required