Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
308 views
in Technique[技术] by (71.8m points)

r - ARIMAX Intervention time series analysis

i want to applied an interrupted time series analysis about impact of disaster on nightlight intensity. I have a 65 month data from january 2015 until May 2020. The disaster happen in october 2018 (46). I have an arima model function ARIMA(0,0,0),(1,0,0)12. so I have the code here

m3 <- arimax(kota, order=c(0,0,0), seasonal=list(order=c(1,0,0), period=12),include.mean=TRUE,
         xtransf=data.frame(gempa=1*(seq(newdata)==45)), transfer=list(c(1,1)), method="ML")

then i got an error like this

Error in model.frame.default(formula = x ~ xtransf[, i], na.action = na.omit,:variable lengths differ (found for 'xtransf[, i]')

Why this is happening?, is anyone knows how to solve it?

Here is the kota variable looks like

1   467.38
2   441.67
3   579.30
4   600.41
5   793.38
6   576.80
7   741.21
8   634.66
9   582.00
10  661.35
11  249.46
12  482.33
13  516.02
14  241.41
15  443.20
16  502.98
17  497.31
18  668.08
19  596.89
20  686.76
21  598.28
22  598.23
23  391.71
24  492.66
25  325.89
26  253.30
27  737.37
28  462.75
29  609.31
30  559.05
31  581.16
32  680.36
33  753.18
34  476.41
35    3.12
36  608.01
37  428.74
38  584.53
39  508.92
40  655.63
41  867.83
42 1059.98
43  509.34
44  820.85
45  825.13
46  382.61
47  393.34
48  554.91
49  578.26
50  790.31
51  569.96
52 1078.35
53 1189.82
54  560.40
55  824.06
56  912.22
57 1186.49
58 1269.71
59  960.18
60  860.56
61  942.47
62  973.25
63  948.07
64 1104.49
65  636.02
question from:https://stackoverflow.com/questions/65832374/arimax-intervention-time-series-analysis

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...