bulk.aov <- function(dataset, DV, IV) {
p.IV <- list()
df <- data.frame(DV = DV)
for(j in 1:length(IV)) {
for(i in 1:length(DV)) {
IVname <- IV[j]
group <- IVname
DVname <- DV[i]
x <- aov(dataset[,DVname] ~ dataset[, group])
summm <- summary(x)
p <- summm[[1]][["Pr(>F)"]][[1]]
p.IV[i] <- p
}
df$p.IV <- unlist(p.IV)
df$p.IV <- symnum(df$p.IV,legend = F, corr = FALSE, na = FALSE,
cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, max(df$p.IV, na.rm = TRUE)),
symbols = c("***", "**", "*", ".", " "))
names(df)[names(df) == 'p.IV'] <- IVname
}
View(df)
return(df)
}
# bulk.aov(mtcars, DV = c('disp', 'mpg', 'hp', 'drat'), IV = c('am', 'gear', 'carb', 'cyl'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.