how to plot the linear regression in R?

前端 未结 5 1615
时光取名叫无心
时光取名叫无心 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:14

    The Predict.Plot and TkPredict functions in the TeachingDemos package will plot the relationship between one of the predictors and the response variable conditioned on the values of the other predictors. Predict.Plot makes it fairly simple to see multiple lines from different conditions while TkPredict lets you interactively change the values being conditioned on (and will produce the Predict.Plot code to recreate the current plot).

    These functions are general for regression models on multiple predictors, but will not be as good as decompose for a time series.

提交回复
热议问题