.makeWide {bsynth} | R Documentation |
Convert Data to Wide Format
Description
This internal helper function transforms data from a long format, where each row represents an observation for a specific unit and time, to a wide format, where each row represents a time period and each column represents a unit's outcome. It specifically focuses on separating treated and untreated units.
Usage
.makeWide(data, id, time, outcome, treatment)
Arguments
data |
A data frame containing the input data. |
id |
The name of the variable in |
time |
The name of the time period variable (as a string). |
outcome |
The name of the outcome variable (as a string). |
treatment |
The name of the variable in |
Value
A data frame in wide format, where each row corresponds to a time period, and columns include the time variable, the treatment indicator, and the outcome values for each treated unit and all untreated units.