panel2cs2 takes a 2 period dataset and turns it into a cross sectional dataset; i.e., long to wide. This function considers a particular case where there is some outcome whose value can change over time. It returns the dataset from the first period with the outcome in the second period and the change in outcomes over time appended to it
panel2cs2(data, yname, idname, tname, balance_panel = TRUE)
data from first period with .y0 (outcome in first period), .y1 (outcome in second period), and .dy (change in outcomes over time) appended to it
data.frame used in function
name of outcome variable that can change over time
unique id
time period name
whether to ensure that panel is balanced. Default is TRUE, but code runs somewhat faster if this is set to be FALSE.