within {plm} | R Documentation |
Computes the within transformation
within(x, ...) ## S3 method for class 'pserie': within(x,effect="individual", ...) ## S3 method for class 'matrix': within(x,cond, ...)
x |
a numeric vector or a matrix, |
cond |
a vector containing the conditional variable, |
effect |
the effect for the within transformation (one of
individual , time and twoways ), |
... |
further arguments. |
a vector of the same length as x
containing the
within transformation.
Yves Croissant
library(Ecdat) data(Grunfeld) pdata.frame(Grunfeld,"firm","year") wi <- within(Grunfeld$inv) w2 <- within(Grunfeld$inv,effect="twoways") X <- model.matrix(~value+capital-1,Grunfeld) Xt <- within(X,Grunfeld$firm)