Helper function to reshape data for gmm_survey if in wide format.
Examples
if (FALSE) { # \dontrun{
# Wide format data
wide_data <- data.frame(
id = 1:100,
y_t0 = rnorm(100),
y_t1 = rnorm(100),
y_t2 = rnorm(100)
)
# Convert to long
long_data <- wide_to_long(
data = wide_data,
id_var = "id",
outcome_vars = c("y_t0", "y_t1", "y_t2")
)
} # }