within {plm}R Documentation

The within transformation

Description

Computes the within transformation

Usage

within(x, ...)
## S3 method for class 'pserie':
within(x,effect="individual", ...)
## S3 method for class 'matrix':
within(x,cond, ...)

Arguments

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.

Value

a vector of the same length as x containing the within transformation.

Author(s)

Yves Croissant

See Also

between and papply

Examples

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)

[Package plm version 0.2-2 Index]