A function to calculate outcomes for units in the period right before they become treated (this function can also be used to recover covariates, etc. in the period right before a unit becomes treated). For units that do not participate in the treatment (and therefore have group==0), they are assigned their outcome in the last period.
get_YiGmin1(df, idname, yname, tname, gname)
the data.frame used in the function
name of column that holds the unit id
name of column containing the outcome (or other variable) for which to calculate its outcome in the immediate pre-treatment period
name of column that holds the time period
name of column containing the unit's group