Getting a clear working environment:
rm(list = ls())
Setting a working directory in my class folder:
setwd("/Users/noam/Desktop/Brandeis University/Graduate/Spring 2022/Forecasting/R Files")
Loading the data:
data.ridership <- read.csv("AmtrakPassengers.csv", header = TRUE)
Plotting the data:
plot(data.ridership$Ridership,
main = "Amtrak Passanger Ridership, Jan 1991 - Dec 2003",
xlab = "Time",
ylab = "Ridership (000s)",
bty = "l")
lines(data.ridership$Ridership, col = "purple")

Discussion Paragraph:
The level of the time series remains relatively constant across the time series, with an average value of around 1800 (000s) ridership throughout it. At the same time, the graph has a seasonal pattern component which indicates that in certain seasons of the year there were more passengers riding the Amtrak compared to other seasons. This may suggest that less passengers ride the Amtrak during the summertime compared to wintertime. The seasonal pattern (what is seen as a sort of a noisy zig-zagging or broken pattern shape of the graph over time) persists throughout the time series. In addition, we see a downward trend in rides roughly until halfway through the time series (until time = 75 or so), after which we see an upward trend in the annual average number of rides, reaching higher levels in the last portion of the graph (around time = 150 and onward) compared to the middle area (where time = 75).
Summary Statistics:
summary(data.ridership$Ridership)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1361 1696 1826 1820 1966 2223