Dear all,

I have a basic(!) econometric question which i couldnt find the way to do it
in R. Well this could be also because of my wrong interpretation of the
econometric process that i am trying to implemet.so here i wanna ask if am
doing a logical mistake!!!

so here is the question with the explanation of the process, hope there will
be someone who can help me!

suppose i have a basic Cobb-Douglas production function, ( i am not gonna
give many information about the R commands or about the data since my
questionn is rather theoric)
and i run this model with OLS as following;

>mdl1 = lm(lnQ~lnC+lnL+lnM+lnE,data=newdata)
 than in the second step, i need to get the predicted residual as a mesure
of "total factor productivity" ==> epsilon(hat)it= lnQit-lnQ(hat)it
and i get the residual by typing;
residuals(mdl1) ==> do i make mistake here or should i write another command
get the epsilon(hat), suppose i typed the correct command

than i save the residuals as a vector with
>resid<-mdl1$residuals

supposing that epsilon(hat) measures the TFP (TFPit=epsilon(it)), i need to
regress knowledge variables on it, such as "eco" and "RD" and i want to use
panel-data techniques in order to get the effect of eco and RD net of
unobserved heterogeneity.
 so the theortically the model that i want to estimate is

TFPit=alpha0+alpha1(eco)+alpha2(RD)+Ui+Vt+Wit

so i run this command;
>mdl2<-plm(resid~eco+RD, data=newdata)
then there is an error
Error in model.frame.default(formula = resid ~ eco + RD, data = ds,
drop.unused.levels = TRUE) :
  variable lengths differ (found for 'eco')


well here in fact, probably i am doing a econometrical mistake that might be
quite easy for somepeople, think that it is a silly question, but i need
help in this situation... if someone knows about Total Factor Productivity
and willing to help i would be greatful
cheers

	[[alternative HTML version deleted]]

