Book Image

Introduction to R for Business Intelligence

By : Gendron
Book Image

Introduction to R for Business Intelligence

By: Gendron

Overview of this book

Explore the world of Business Intelligence through the eyes of an analyst working in a successful and growing company. Learn R through use cases supporting different functions within that company. This book provides data-driven and analytically focused approaches to help you answer questions in operations, marketing, and finance. In Part 1, you will learn about extracting data from different sources, cleaning that data, and exploring its structure. In Part 2, you will explore predictive models and cluster analysis for Business Intelligence and analyze financial times series. Finally, in Part 3, you will learn to communicate results with sharp visualizations and interactive, web-based dashboards. After completing the use cases, you will be able to work with business data in the R programming environment and realize how data science helps make informed decisions and develops business strategy. Along the way, you will find helpful tips about R and Business Intelligence.
Table of Contents (13 chapters)
9
A. References
11
C. R Packages Used in the Book
12
D. R Code for Supporting Market Segment Business Case Calculations

Analyzing time series data with linear regression


You learned how to predict responses using linear regression in Chapter 4, Linear Regression for Business; however, this technique is less useful and sometimes not even appropriate to analyzing time series data. Why? This question is the catalyst to understand the proper application of time series models.

Before working with the data from the use case, we will use a dataset already in R. The TSA package contains a dataset called airpass. This dataset provides the total monthly count of international airline passengers covering the period from January 1960 to December 1971. This represents twelve years of monthly passenger data, which is 144 observations. After loading the library, the airpass dataset is available using the data() function. You can examine the dataset using methods discussed in the previous chapters:

library(TSA) 
data(airpass) 
str(airpass) 
summary(airpass) 

The output is as follows:

Time-Series [1:144...