get_Yibar_pre: get_Yibar_pre

View source: R/BMisc.R

get_Yibar_preR Documentation

get_Yibar_pre

Description

A function to calculate average outcomes for units in their pre-treatment periods (this function can also be used to recover pre-treatment averages of covariates, etc.). For units that do not participate in the treatment (and therefore have group==0), the function calculates their overall average outcome.

Usage

get_Yibar_pre(df, idname, yname, tname, gname)

Arguments

df

the data.frame used in the function

idname

name of column that holds the unit id

yname

name of column containing the outcome (or other variable) for which to calculate its outcome in the immediate pre-treatment period

tname

name of column that holds the time period

gname

name of column containing the unit's group


bcallaway11/BMisc documentation built on March 13, 2024, 1:39 a.m.