Learn R Programming

plm (version 0.1-1)

pdiff: Difference operator for panel data

Description

Computes the first difference of variables that have a temporal and an individual dimension.

Usage

pdiff(x,lag=0)

Arguments

x
a numeric vector or a numeric matrix for which the difference should be computed,
lag
the lag for the first difference.

Value

  • a vector (or matrix) of the same dimensions as x containing the lag values. NA values are inserted at the correct positions

Examples

Run this code
library(Ecdat)
data(Produc)
Produc=pdata.frame(Produc,state,year)
pmean(Produc$pc)
form <- pmean(log(gsp))~pmean(log(pc))
lm(form,data=Produc)

Run the code above in your browser using DataLab