Consider the dataset below, it is a nonstationary time series dataset.
Monthly Unemployed Young Women between Ages 16 and 19 in the U.S. from January 1961 to August 2002 (in Thousands)
*note the data set is only a part of a whole so please I need the R codes so I can apply it to my whole dataset*
Year | Jan | Feb | Mar | Apr | May | June | July | Aug | Sept | Oct | Nov | Dec |
1990 | 535 | 543 | 542 | 523 | 544 | 529 | 514 | 561 | 562 | 533 | 565 | 574 |
1991 | 659 | 578 | 587 | 608 | 579 | 586 | 620 | 618 | 586 | 620 | 594 | 661 |
1992 | 594 | 601 | 600 | 575 | 621 | 715 | 659 | 614 | 655 | 552 | 652 | 621 |
1993 | 629 | 621 | 614 | 584 | 661 | 601 | 560 | 571 | 576 | 591 | 589 | 567 |
1994 | 558 | 587 | 590 | 654 | 566 | 596 | 561 | 587 | 550 | 614 | 531 | 560 |
1995 | 575 | 565 | 581 | 630 | 600 | 594 | 658 | 584 | 622 | 585 | 610 | 625 |
1996 | 621 | 576 | 568 | 584 | 577 | 556 | 531 | 578 | 542 | 553 | 584 | 603 |
1997 | 604 | 646 | 572 | 551 | 618 | 551 | 638 | 546 | 582 | 516 | 545 | 554 |
1998 | 483 | 492 | 526 | 505 | 523 | 562 | 505 | 547 | 519 | 581 | 516 | 465 |
1999 | 567 | 551 | 528 | 546 | 502 | 522 | 498 | 517 | 587 | 530 | 515 | 472 |
2000 | 465 | 512 | 556 | 482 | 496 | 383 | 494 | 506 | 489 | 488 | 507 | 482 |
2001 | 499 | 473 | 527 | 515 | 465 | 513 | 549 | 523 | 531 | 542 | 540 | 584 |
2002 | 612 | 547 | 561 | 591 | 570 | 594 | 587 | 523 |
A. Build an appropriate model for the series.
Please use RStudio for the problem, also please include codes and packages/libraries used, for me to use to review.
Thank you!
R-codes for ARIMA time series model building
#Read data from Excel csv file
data=read.csv(file.choose(),header = T)
#convert data frame in to vector-matrix
data.vec <- as.vector(t(as.matrix(data[,2:13])))/1000
#convert vector data in to time sries dat
data.ts <- ts(data.vec, c(1990,1), end = c(2001,12), frequency =
12)
#Decompose time series
data.decompose<-decompose(data.ts)
#Plot components of time series
plot(data.decompose)
#Build ARIMA model
AutoArimaModel=auto.arima(data.ts)
AutoArimaModel
summary(AutoArimaModel)
# Forecast for next 12 months
forecast(AutoArimaModel,12)
plot(forecast(AutoArimaModel,12))
Get Answers For Free
Most questions answered within 1 hours.