我将绘制残差与拟合值,但图表显示年数并连接在一起。如何删除年份并将其更改为点。
setwd("/Users/lok19_000/Desktop/project")
z = read.csv("data4.csv" , header = F)
names(z) = c("Date","Rate")
attach(z)
ts_rate <- ts(Rate,start=c(2010),frequency = 12)
lts_rate<-log(ts_rate)
fit3=tslm(lts_rate ~ trend + season)
windows()
plot(fit3$fitted.values,fit3$residuals,main="residuals vs.
fitted",xlab="Fitted Value",ylab="Residual value")
abline(h=0,lwd=2,col = "red3")