我有一个数据集,我想计算弹性系数 具有功能lm的纠错模型-ECM。我不知道在哪里 我在下面的代码中错了,但是我得到的结果不是 正确。计算公式为ΔPt= a +b0ΔWt+ b1Pt-1 + b2Wt-1。 正确的结果应该是:
截距= -2.679358 diff(log(W))= 1.045140 log(P)[-1] =-1.279491 log(W)[-1] = 1.278038
但是下面我有一些类似的结果
截距= 2.4896 diff(log(W))= 1.1798 log(P)[-1] = 1.2499 log(W)[-1] = -1.2063
那么有人可以帮助我,如何解决这个问题?
TEST<-data.frame( T=c(2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017), P=c(1.32225,1.4643,1.59008,1.72585,1.72579,1.93372,2.07582,2.41522,2.30599,2.27247,2.32,2.34942,2.18307,2.2474,2.33428,2.4385,NA), W=c(10.75985,11.81686,12.75945,13.81505,14.61576,15.6497,17.21165,18.95588,18.78965,19.01828,18.92123,18.48667,18.0731,18.38971,18.90066,19.74001,20.71245))
summary(lm(diff(log(P)) ~ diff(log(W)) + log(P)[-1] + log(W[-1],data=TEST))