projdummies: Projection Dummies

Description Usage Arguments Value Examples

View source: R/projdummies.R

Description

projdummies returns necessary matrices to project variables on fixed effect dummies. The input parameters all need to be of the same length.

Usage

1
projdummies(hhid, tid, w)

Arguments

hhid

A vector of individual effect identifiers

tid

A vector of time effect identifiers

w

A vector of weights for each observation

Value

A list will be returned with necessary matrices to project upon. If the time effect has more levels, the matrices B, C, invDD, and invDDDH will be returned If the individual effect has more levels, the matrices A, B, invHH and invHHDH will be returned

hhid and tid as factors will always be returned, as well as the original weights w that are passed.

Examples

1
2
3
4
hhid <- c("a","b","c","a","b","c" ,"a","b","c" ,"a","b","c" ,"a","b","c")
tid <- c("1","1" ,"1" ,"2","2" ,"3","3","3" ,"4","4","5" ,"5","6","6" ,"6")
w <- rep(1, 15)
projdummies(hhid, tid, w)

xtreg2way documentation built on Aug. 11, 2020, 9:06 a.m.