Question

In: Statistics and Probability

You are applying for a data job, and your assignment is to analyze the following data...

You are applying for a data job, and your assignment is to analyze the following data set for monthly average temperatures at St Catherines in the programming language R.

(a) Prepare some plots that visualize the data.

(b) Find the appropriate time series model and fit the data. Explain your choice of parameters.

(c) Make predictions for the next 3 years, plot these predictions.

(d) Summarize your findings.

The Data is provided below. Please show the R codes as well. Thank you!

"Month","Average monthly temperatures St Cathrines"

“1980-01", 3.3

“1980-02", 5.5

“1980-03", 0.5

“1980-04", 7.4

“1980-05", 14.4

“1980-06", 16.6

“1980-07", 21.8

“1980-08", 22.8

“1980-09", 16.9

“1980-10", 8.4

“1980-11", 3.4

“1980-12", 4.3

“1981-01", 7.6

“1981-02", 0.6

“1981-03”, 1.6

“1981-04", 8.5

“1981-05", 12.4

“1981-06", 19.2

“1981-07", 22.1

“1981-08", 20.7

“1981-09", 16.0

“1981-10", 7.7

“1981-11", 4.5

“1981-12", 1.3

“1982-01", 7.7

“1982-02", 5.3

“1982-03", 0.3

“1982-04", 5.7

“1982-05", 14.0

“1982-06", 15.9

“1982-07", 21.9

“1982-08", 18.4

“1982-09", 15.9

“1982-10", 11.2

“1982-11", 5.8

“1982-12", 3.0

“1983-01", 2.3

“1983-02", 1.6

“1983-03", 1.9

“1983-04", 6.5

“1983-05", 11.6

“1983-06", 19.6

“1983-07", 23.3

“1983-08”, 21.5

“1983-09", 17.5

“1983-10", 10.8

“1983-11", 4.9

“1983-12", 4.2

“1984-01", 6.1

“1984-02", 0.4

“1984-03", 3.0

“1984-04", 7.5

“1984-05", 11.0

“1984-06", 19.6

“1984-07", 21.0

“1984-08", 22.0

“1984-09", 15.4

“1984-10", 11.3

“1984-11", 4.6

“1984-12", 0.9

“1985-01", 6.0

“1985-02", 4.0

“1985-03", 2.3

“1985-04", 8.7

“1985-05", 14.3

“1985-06", 17.0

“1985-07", 21.1

“1985-08", 20.7

“1985-09", 18.3

“1985-10”, 10.9

“1985-11", 4.9

“1985-12", 3.2

“1986-01", 3.6

“1986-02", 4.8

“1986-03", 1.9

“1986-04", 8.1

“1986-05", 15.0

“1986-06", 17.7

“1986-07", 21.9

“1986-08", 19.7

“1986-09", 16.1

“1986-10", 10.4

“1986-11", 2.9

“1986-12", 0.4

“1987-01”, 3.1

“1987-02", 3.7

“1987-03", 2.7

“1987-04", 9.0

“1987-05", 15.0

“1987-06", 20.2

“1987-07", 23.5

“1987-08", 20.3

“1987-09", 16.8

“1987-10", 8.3

“1987-11", 5.3

“1987-12", 1.1

“1988-01", 3.3

“1988-02", 4.5

“1988-03”, 1.1

“1988-04", 6.7

“1988-05", 14.6

“1988-06", 18.4

“1988-07", 23.7

“1988-08", 22.2

“1988-09", 16.4

“1988-10", 8.4

“1988-11", 6.0

“1988-12", 1.1

“1989-01", 0.7

“1989-02", 4.7

“1989-03", 0.3

“1989-04", 5.6

“1989-05", 13.2

“1989-06", 19.2

“1989-07", 22.2

“1989-08", 20.7

“1989-09", 16.8

“1989-10", 11.1

“1989-11", 3.7

“1989-12", 7.5

“1990-01", 0.7

“1990-02", 1.8

“1990-03", 2.1

“1990-04”, 8.9

“1990-05", 12.1

“1990-06", 19.4

“1990-07", 21.5

“1990-08", 21.0

“1990-09", 16.2

“1990-10", 10.7

“1990-11", 5.8

“1990-12", 0.6

“1991-01", 3.9

“1991-02", 0.6

“1991-03", 2.9

“1991-04", 9.1

“1991-05", 16.8

“1991-06", 20.6

“1991-07", 22.1

“1991-08", 21.8

“1991-09", 16.4

“1991-10", 11.4

“1991-11", 4.2

“1991-12”, 0.1

“1992-01", 2.5

“1992-02", 2.1

“1992-03", 0.1

“1992-04", 6.1

“1992-05", 12.8

“1992-06", 16.9

“1992-07", 18.8

“1992-08", 18.9

“1992-09", 15.9

“1992-10", 8.5

“1992-11", 4.2

“1992-12", 0.3

“1993-01", 1.8

“1993-02", 6.8

“1993-03”, 1.7

“1993-04", 7.4

“1993-05", 12.7

“1993-06", 17.8

“1993-07", 22.4

“1993-08", 21.7

“1993-09", 15.1

“1993-10", 9.0

“1993-11", 3.9

“1993-12", 1.7

“1994-01”, 9.1

“1994-02", 6.2

“1994-03", 0.2

“1994-04", 8.2

“1994-05", 11.6

“1994-06", 19.3

“1994-07", 22.2

“1994-08", 19.6

“1994-09", 16.4

“1994-10", 10.6

“1994-11", 6.8

“1994-12", 1.0

“1995-01", 1.2

“1995-02", 5.7

“1995-03", 3.0

“1995-04", 5.2

“1995-05", 13.6

“1995-06", 20.0

“1995-07", 22.1

“1995-08", 21.9

“1995-09", 15.4

“1995-10”, 12.0

“1995-11", 2.4

“1995-12", 3.4

“1996-01", 5.2

“1996-02", 4.4

“1996-03", 2.0

“1996-04", 6.0

“1996-05", 12.2

“1996-06", 19.4

“1996-07", 20.5

“1996-08”, 21.7

“1996-09", 17.3

“1996-10", 10.7

“1996-11", 2.4

“1996-12", 0.8

“1997-01", 4.1

“1997-02", 0.9

“1997-03", 0.4

“1997-04", 6.2

“1997-06", 20.0

“1997-07", 20.7

“1997-08", 19.6

“1997-09", 16.3

“1997-10", 10.1

“1997-11", 3.3

“1997-12", 0.5

“1998-01", 0.6

“1998-02", 0.7

“1998-03", 3.3

“1998-04", 9.0

“1998-05", 16.9

“1998-06", 19.5

“1998-07", 21.8

“1998-08”, 22.1

“1998-09", 19.0

“1998-10", 11.6

“1998-11", 6.1

“1998-12", 2.5

“1999-01", 4.7

“1999-02", 0.5

“1999-03", 0.7

“1999-04", 8.1

“1999-05”, 15.4

“1999-06", 21.2

“1999-07", 24.6

“1999-08", 20.3

“1999-09", 18.5

“1999-10”, 10.6

“1999-11", 6.8

“1999-12", 0.5

Solutions

Expert Solution

rm(list=ls())

## Import Data as data set named rdata

temp<-c(3.3, 5.5, 0.5, 7.4, 14.4, 16.6, 21.8, 22.8, 16.9, 8.4, 3.4, 4.3, 7.6, 0.6, 1.6, 8.5, 12.4, 19.2,

22.1, 20.7, 16, 7.7, 4.5, 1.3, 7.7, 5.3, 0.3, 5.7, 14, 15.9, 21.9, 18.4, 15.9, 11.2, 5.8, 3, 2.3,

1.6, 1.9, 6.5, 11.6, 19.6, 23.3, 21.5, 17.5, 10.8, 4.9, 4.2, 6.1, 0.4, 3, 7.5, 11, 19.6, 21, 22,

15.4, 11.3, 4.6, 0.9, 6, 4, 2.3, 8.7, 14.3, 17, 21.1, 20.7, 18.3, 10.9, 4.9, 3.2, 3.6, 4.8, 1.9,

8.1, 15, 17.7, 21.9, 19.7, 16.1, 10.4, 2.9, 0.4, 3.1, 3.7, 2.7, 9, 15, 20.2, 23.5, 20.3, 16.8, 8.3,

5.3, 1.1, 3.3, 4.5, 1.1, 6.7, 14.6, 18.4, 23.7, 22.2, 16.4, 8.4, 6, 1.1, 0.7, 4.7, 0.3, 5.6,

13.2, 19.2, 22.2, 20.7, 16.8, 11.1, 3.7, 7.5, 0.7, 1.8, 2.1, 8.9, 12.1, 19.4, 21.5, 21, 16.2, 10.7,

5.8, 0.6, 3.9, 0.6, 2.9, 9.1, 16.8, 20.6, 22.1, 21.8, 16.4, 11.4, 4.2, 0.1, 2.5, 2.1, 0.1, 6.1,

12.8, 16.9, 18.8, 18.9, 15.9, 8.5, 4.2, 0.3, 1.8, 6.8, 1.7, 7.4, 12.7, 17.8, 22.4, 21.7, 15.1, 9,

3.9, 1.7, 9.1, 6.2, 0.2, 8.2, 11.6, 19.3, 22.2, 19.6, 16.4, 10.6, 6.8, 1, 1.2, 5.7, 3, 5.2, 13.6,

20, 22.1, 21.9, 15.4, 12, 2.4, 3.4, 5.2, 4.4, 2, 6, 12.2, 19.4, 20.5, 21.7, 17.3, 10.7, 2.4, 0.8, 4.1,

0.9, 0.4, 6.2, 0, 20, 20.7, 19.6, 16.3, 10.1, 3.3, 0.5, 0.6, 0.7, 3.3, 9, 16.9, 19.5, 21.8, 22.1, 19,

11.6, 6.1, 2.5, 4.7, 0.5, 0.7, 8.1, 15.4, 21.2, 24.6, 20.3, 18.5, 10.6, 6.8, 0.5)

# conevert data into time series data

ts_data<-ts(data = temp, start = c(1980,1),end = c(1999,12),frequency = 12)

#### (a) Time series plot

plot(ts_data,xlab="Year",ylab="Temperature",main="Time Series")

#### (b) Appropriate model fitting

fit<-forecast::auto.arima(ts_data)

# Series: ts_data

# ARIMA(1,0,0)(1,1,0)[12] with drift

# Coefficients:

# ar1 sar1 drift

# 0.0466 -0.4651 0.0031

# s.e. 0.0666 0.0586 0.0090

#

# sigma^2 estimated as 5.134: log likelihood=-509.97

# AIC=1027.94 AICc=1028.12 BIC=1041.66

#### (c) prediction for next 3 year

pred<-forecast::forecast(fit,h=36)

Month Forecast
Jan-00 2.79
Feb-00 0.64
Mar-00 1.96
Apr-00 8.57
May-00 16.15
Jun-00 20.46
Jul-00 23.35
Aug-00 21.19
Sep-00 18.79
Oct-00 11.12
Nov-00 6.53
Dec-00 1.48
Jan-01 3.73
Feb-01 0.63
Mar-01 1.43
Apr-01 8.41
May-01 15.86
Jun-01 20.86
Jul-01 23.99
Aug-01 20.83
Sep-01 18.71
Oct-01 10.93
Nov-01 6.71
Dec-01 1.08
Jan-02 3.35
Feb-02 0.69
Mar-02 1.73
Apr-02 8.54
May-02 16.05
Jun-02 20.73
Jul-02 23.74
Aug-02 21.05
Sep-02 18.80
Oct-02 11.07
Nov-02 6.68
Dec-02 1.32

Related Solutions

Project Assignment The purpose of this assignment is for you to gain practice in applying the...
Project Assignment The purpose of this assignment is for you to gain practice in applying the concepts and techniques we learned in class. In order to complete the assignment, please do the following: 1. find or create a data set containing values of at least one interval or ratio variable for at least one-hundred cases (n >= 100); 1 2. provide basic descriptive statistics to summarize the central tendency and variability of the data; 3. provide at least one table...
In your first assignment on the job, your supervisor has asked you to report on the...
In your first assignment on the job, your supervisor has asked you to report on the company’s competitors future products. You really want to succeed. What do you do? A. You could call the competitors pretending you are a college student working on project needing information B. You could ask a college friend to call the competitors and ask for the information C. You could call the competitors, but would not tell them who you really are unless if asked...
In applying t-tests to your data and you find that your data are very non-normal. How...
In applying t-tests to your data and you find that your data are very non-normal. How would you expect that non-normality to affect your results if corrected by family-wise error rate (FWER)? How about by false discovery rate (FDR)?
On your first day on a new IT job, your boss gives you this assignment: Because...
On your first day on a new IT job, your boss gives you this assignment: Because you completed coursework on usability, you are responsible for evaluating the usability of the company website. Include hard data in your report. You are required to use this definition of usability: The usability of a system or any product is a key factor for all the organizations determining that everyone is having a good user experience and easy to use. In the cutting-edge technology,...
CS 400 Assignment 2: applying ArrayList In this assignment, you are going to build a program...
CS 400 Assignment 2: applying ArrayList In this assignment, you are going to build a program that can help rental car companies to manage their rental fleet. Requirement: - build ArrayList class as container. - build Car class/structure to represent car objects. - An ArrayList object is to hold Car objects. Car class should have following fields: - id (int) - make (string) - model (string) - color (string) Instructions: - make up 15 cars and save them into a...
Welcome to the Body Company. You are applying for a job with us as a vitamin....
Welcome to the Body Company. You are applying for a job with us as a vitamin. Please describe (in an interview) 3 roles (functions) you can play for the body company and which other nutrients you work best with. Include in the description what will happen when there is too much of you (toxicity) or not enough (deficiency) as well as the 3 best places to get you (food sources). Supplements List 3 vitamins that are typically included in "stress...
Welcome to the Body Company. You are applying for a job with us as a vitamin...
Welcome to the Body Company. You are applying for a job with us as a vitamin or mineral. Please describe 3 functions you can play for The Body Company and which other nutrients you work best with. Include in your interview what will happen when there is too much of you (toxicity) or not enough (deficiency) as well as the 3 best places to get you (food sources). Please find your name on the table below. Supplements Use Google or...
You are applying for a job as a departmental manager in an office setting. The organisation...
You are applying for a job as a departmental manager in an office setting. The organisation has made it clear that having a high level of emotional intelligence will be a deciding factor in selecting the successful candidate. You have been asked to submit a document that addresses the following points: 1. What are your emotional strengths and weaknesses? 2. What are personal causes of stress in your work life and how do you deal with them? 3. What are...
How do you analyze a job description?
How do you analyze a job description?
As a data scientist of a company, you want to analyze the following data collected by...
As a data scientist of a company, you want to analyze the following data collected by your company which relates the advertising expenditure A in thousands of dollars to total sales S in thousands of dollars. The following table shows this relationship Advertising Expenditure (A) Total Sales (S) 18.6 312 18.8 322 18.8 333 18.8 317 19 301 19 320 19.2 305 Using Advertising expenditure (A) as the domain and Total Sales (S) as the range, the data is not...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT