panel2cs2 | R Documentation |
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 |
data.frame used in function |
yname |
name of outcome variable that can change over time |
idname |
unique id |
tname |
time period name |
balance_panel |
whether to ensure that panel is balanced. Default is TRUE, but code runs somewhat faster if this is set to be FALSE. |
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.