how to plot the linear regression in R?

前端 未结 5 1612
时光取名叫无心
时光取名叫无心 2020-12-14 23:43

I want to make the following case of linear regression in R

year<-rep(2008:2010,each=4)
quarter<-rep(1:4,3)
cpi<-c(162.2,164.6,166.5,166.0,166.4,167         


        
5条回答
  •  醉酒成梦
    2020-12-15 00:10

    cpi<-c(162.2,164.6,166.5,166.0,166.4,167.0,168.6,169.5,170.0,172.0,173.3,174.0)
    cpits <- ts(cpi, start=2008, frequency=4)
    plot(decompose(cpits))
    

    enter image description here

提交回复
热议问题