Learn R Programming

plm (version 0.1-2)

between: The between transformation

Description

Computes the between transformation

Usage

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

Arguments

x
a numeric vector or matrix,
cond
a vector containing the conditional variable,
effect
the effect for the Between transformation (one of individual and time),
...
further arguments.

Value

  • a vector (or a matrix) of the same length as x containing the between transformation (Between) or of a length equal of the number of modalities of the conditional variable (between). NA values are inserted at the correct positions

See Also

within and papply.

Examples

Run this code
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