Module 12
Module 12 ```R # Install and load necessary packages install.packages("forecast") library(forecast) # Create a data frame with the provided data data <- data.frame( Month = month.abb, Year_2012 = c(31.9, 27, 31.3, 31, 39.4, 40.7, 42.3, 49.5, 45, 50, 50.9, 58.5), Year_2013 = c(39.4, 36.2, 40.5, 44.6, 46.8, 44.7, 52.2, 54, 48.8, 55.8, 58.7, 63.4) ) # Convert the data to a time series object ts_data <- ts(cbind(data$Year_2012, data$Year_2013), start = c(2012, 1), frequency = 12) # Plot the time series plot(ts_data, main = "Student Credit Card Charges Over Time", xlab = "Month", ylab = "Charges", col = c("blue", "red"), lty = 1:2) # Apply exponential smoothing model fit <- ets(ts_data) summary(fit) ``` This code does the following: 1. Installs and loads the `forecast` package. 2. Creates a data frame with the provided data. 3. Converts the data frame into a time series object. 4. Plots a time series plot for the s...