library(Ecdat)
data(Grunfeld)
pdata.frame(Grunfeld,"firm","year")
Bi <- Between(Grunfeld$inv)
X <- model.matrix(~value+capital-1,Grunfeld)
BX <- Between(X,Grunfeld$firm)
bi <- between(Grunfeld$inv)
bX <- between(X,Grunfeld$firm)
# computes the between estimator with the lm command
blm <- lm(between(inv)~between(value)+between(capital),data=Grunfeld)
Run the code above in your browser using DataLab