How to remove NA from this time series?
x <- structure(c(NA, 15.3471263711111, 23.7495828967391, 17.6522039782609,
13.950342245, 18.6679701043956, 21.7398276684783, 22.4975495326087,
17.1164915533333, 17.7142983241758, 20.5018974402174, 20.841587,
18.9183467888889, 15.4600196181319, 17.8721988695652, 20.0170066630435,
18.5086658241758, 15.5306393346154, 16.0669595836957, 20.2165807554348,
16.25535685, 14.8567082505495, 15.2826896483696, 12.1608449365543,
8.88960227944444, 16.1804220681319, 19.7431830652174, 15.0564858630435,
15.1309696333333, 15.9665181153846, 17.7906991630435, 18.3519159722826,
15.7932861428571, 11.9033367478022, 16.378045125, 16.4570617070652,
11.8673526106667, 17.0768826978022, 17.6064028967391, 18.8143230434783,
15.1196432378882, NA, NA, NA), .Tsp = c(2004, 2014.75, 4), class = "ts")
# Qtr1 Qtr2 Qtr3 Qtr4
#2004 NA 15.347126 23.749583 17.652204
#2005 13.950342 18.667970 21.739828 22.497550
#2006 17.116492 17.714298 20.501897 20.841587
#2007 18.918347 15.460020 17.872199 20.017007
#2008 18.508666 15.530639 16.066960 20.216581
#2009 16.255357 14.856708 15.282690 12.160845
#2010 8.889602 16.180422 19.743183 15.056486
#2011 15.130970 15.966518 17.790699 18.351916
#2012 15.793286 11.903337 16.378045 16.457062
#2013 11.867353 17.076883 17.606403 18.814323
#2014 15.119643 NA NA NA
This is causing me trouble:
acf(x)
#Error in na.fail.default(as.ts(x)) : missing values in object
pacf(x)
#Error in na.fail.default(as.ts(x)) : missing values in object
na.omit
does not omit internal NA's, i.e. NA's not at the ends, of ts objects. It gives an error in that case. – Elastic