Doubles the dataset by swapping left/right profiles and inverting the outcome.
This satisfies the profile order constraint required for valid CRT hypothesis
testing with HierNet. Apply this BEFORE calling cj_fit() with
method = "crt".
Value
A data frame with 2 * nrow(data) rows: the original data followed
by the swapped copy (left/right exchanged, outcome inverted).
Examples
# \donttest{
df <- data.frame(
y = sample(0:1, 100, TRUE),
left_a = factor(sample(c("x","y"), 100, TRUE)),
left_b = factor(sample(c("p","q"), 100, TRUE)),
right_a = factor(sample(c("x","y"), 100, TRUE)),
right_b = factor(sample(c("p","q"), 100, TRUE))
)
augmented <- augment_profile_order(df, "y",
left = c("left_a", "left_b"), right = c("right_a", "right_b"))
nrow(augmented) # doubled
#> [1] 200
# }
