if (FALSE) {
indiv=gl(6,12,labels=LETTERS[1:6])
#creates A,A,A 12 times B B B also 12 times etc.
set.seed(99);cost=sample(30:90, 72, replace=TRUE)
revenu=sample(50:110, 72, replace=TRUE); month=rep(1:12,6)
df=data.frame(indiv,month,cost,revenu);head(df);tail(df)
L2cost=PanelLag(ID=month,xj=df[,'cost'], lag=2)
head(L2cost)
tail(L2cost)
gmcmtx0(cbind(revenu,cost,L2cost))
gmcxy_np(revenu,cost)
}
Run the code above in your browser using DataLab