Calculate Means Using the Pool Adjacent Violators Algorithm (PAVA)
Source:R/Endpoints.R
pavaMean.RdThis function computes adjusted means and standard errors for groups defined by a factor variable using the Pool Adjacent Violators Algorithm (PAVA).
Value
A data frame containing the following columns:
- pavaMean
The adjusted means for each group.
- SE.diff
The standard errors of the differences.
Examples
# Example usage:
x <- c(1, 2, 3, 4, 5, 6)
g <- factor(c("A", "A", "B", "B", "C", "C"))
result <- pavaMean(x, g)
print(result)
#> pavaMean SE.diff
#> A 1.5 0.7071068
#> B 3.5 0.7071068
#> C 5.5 0.7071068
x <- c(106, 114, 116, 127, 145,
110, 125, 143, 148, 151,
136, 139, 149, 160, 174)
g <- gl(3,5)
levels(g) <- c("0", "I", "II")
pavaMean(x,g)
#> pavaMean SE.diff
#> 0 121.6 10.1712
#> I 135.4 10.1712
#> II 151.6 10.1712