projvar: Project Variables

View source: R/projvar.R

projvarR Documentation

Project Variables

Description

projvar uses the matrices from projdummies to project a variable. In practice, all dependent and independent variables must be project for the two way regression

Usage

projvar(var, struc)

Arguments

var

A vector of a single variable

struc

The output of projdummies, containing matrices necessary to project

Value

A list will be returned with the following named values: var - the projected variable delta, tau - intermediate variables

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)
x1 <- rnorm(15, mean=50, sd=10)   

struc <- projdummies(hhid, tid, w)
x1p <- projvar(x1, struc)

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