projdummies: Projection Dummies

View source: R/projdummies.R

projdummiesR Documentation

Projection Dummies

Description

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

Usage

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

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)

bchivers-stanford/xtreg2way documentation built on Jan. 5, 2023, 7:58 p.m.