powered by
wtd.anova performs a weighted analysis of variance across groups using a continuous response variable and a grouping factor.
wtd.anova
wtd.anova(response, group, weight = NULL)
A data frame with rows for "Between" and "Within" group variance and columns for SS, df, MS, F statistic, and p-value.
Numeric vector of outcome values.
Factor indicating group membership.
Optional numeric vector of weights. If NULL, equal weights are used.
NULL
Josh Pasek
aov, lm
aov
lm
set.seed(1) group <- rep(c("A", "B", "C"), each = 10) x <- c(rnorm(10), rnorm(10, mean = 1), rnorm(10, mean = 2)) w <- runif(30, 0.5, 2) wtd.anova(x, group, weight = w)
Run the code above in your browser using DataLab