时间序列代码(R语言)
#-----------------------线性回归---------------------------------
setwd("D:/data")
da = read.table("m-ibm6708.txt",header = T)#读到一个data.frame里
ibm = da$ibm
sp = da$sprtn
plot(sp,ibm)
cor(sp,ibm)
marketmodel = lm(ibm~sp)
summary(marketmodel)#回归结果的summary
#---------------------------------------------------------------
#---------------------------------------------------------
#Measure of Correlation and Depend