# NOT RUN {
## Hypothesis Testing
## ------------------
contingency_table <- as.table(rbind(c(762, 327, 468), c(484, 239, 477), c(484, 239, 477)))
Xsq <- chisq.test(contingency_table)
effectsize(Xsq)
effectsize(Xsq, type = "phi")
Ts <- t.test(1:10, y = c(7:20))
effectsize(Ts)
Aov <- oneway.test(extra ~ group, data = sleep, var.equal = TRUE)
effectsize(Aov)
effectsize(Aov, type = "omega")
## Bayesian Hypothesis Testing
## ---------------------------
# }
# NOT RUN {
if (require(BayesFactor)) {
bf1 <- ttestBF(mtcars$mpg[mtcars$am == 1], mtcars$mpg[mtcars$am == 0])
effectsize(bf1, test = NULL)
bf2 <- correlationBF(attitude$rating, attitude$complaints)
effectsize(bf2, test = NULL)
data(raceDolls)
bf3 <- contingencyTableBF(raceDolls, sampleType = "poisson", fixedMargin = "cols")
effectsize(bf3, test = NULL)
effectsize(bf3, type = "oddsratio", test = NULL)
}
# }
# NOT RUN {
## Models and Anova Tables
## -----------------------
fit <- lm(mpg ~ factor(cyl) * wt + hp, data = mtcars)
effectsize(fit)
anova_table <- anova(fit)
effectsize(anova_table)
effectsize(anova_table, type = "epsilon")
# }
Run the code above in your browser using DataLab