首页 > 解决方案 > 为不同时间段创建假人

问题描述

我试图为时间序列分析创建假人。数据为月度芯片产量,暂时波动,产量水平明显下降后恢复上升趋势。

所以我想我可以将数据分成三个不同的时间段并对其进行回归。这是一些代码:

date2 <- seq(as.Date("1987/1/1"), as.Date("2017/12/1"), by ="month")
T2<- length(date2)
data.rt <- data[1:T2,]
time.rt <- seq(1:T2)

总长度是350,我想把数据分成三部分:

time.rt[0:200] #increasing trend before the fluctuation
time.rt[200:300] #fluctuation occurs during this period
time.rt[300:350] #the increasing trend resumes

如何构建假人并对其进行回归?

感谢您的时间和帮助!对此,我真的非常感激。:)

标签: rtime-serieslinear-regressiondummy-variable

解决方案


推荐阅读