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 ...

Get Regression Analysis with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.