Question: I have some questions about my R code because my final plot is very strange, where am I going wrong? Where is the code incorrect?

I have some questions about my R code because my final plot is very strange, where am I going wrong? Where is the code incorrect?

Processing real data TS on US monthly CPI index. Clean up the data and create the TS plot:

This is my R code:

library(TSA) library(forecast) library(tidyverse) library(lubridate) library(readxl) data<- read_xlsx("CPIdata1971-2023.xlsx",skip = 11) data<- na.omit(data) data<- plyr::rename(data,c("Year" = "Year", "Jan" = "Jan", "Feb" = "Feb", "Mar" = "Mar", "Apr" = "Apr", "May" = "May", "Jun" = "Jun", "Jul" = "Jul", "Aug" = "Aug", "Sep" = "Sep", "Oct" = "Oct", "Nov" = "Nov", "Dec" = "Dec")) data tsdata<- ts(data, frequency=12, start = c(1971.00),end = c(2023.00)) autoplot(tsdata) + labs(y="CPI")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!