Fix small stuff

This commit is contained in:
Nora Wickelmaier 2026-01-09 17:07:12 +01:00
parent e2b548c00c
commit d411821974
2 changed files with 4 additions and 4 deletions

View File

@ -63,7 +63,7 @@ dat <- data.frame(
A = factor(rep(1:2, each = n/2), labels = c("low", "high")), A = factor(rep(1:2, each = n/2), labels = c("low", "high")),
B = factor(rep(rep(1:2, each = n/4), 2), labels = c("low", "high")) B = factor(rep(rep(1:2, each = n/4), 2), labels = c("low", "high"))
) )
X <- model.matrix(~ A*B, dat) X <- model.matrix(~ A * B, dat)
unique(X) unique(X)
beta <- c(mu = 30, a2 = 30, b2 = 5, ab22 = 12) beta <- c(mu = 30, a2 = 30, b2 = 5, ab22 = 12)
means <- X %*% beta means <- X %*% beta
@ -86,7 +86,7 @@ boxplot(t(out))
pval <- replicate(2000, { pval <- replicate(2000, {
y <- means + rnorm(n, sd = 10) y <- means + rnorm(n, sd = 10)
m <- aov(y ~ A*B, dat) m <- aov(y ~ A * B, dat)
summary(m)[[1]]$"Pr(>F)"[3] # test of interaction summary(m)[[1]]$"Pr(>F)"[3] # test of interaction
}) })
mean(pval < 0.05) mean(pval < 0.05)

View File

@ -5,8 +5,8 @@
#' bibliography: ../lit.bib #' bibliography: ../lit.bib
#' --- #' ---
library(lattice) library("lattice")
library(lme4) library("lme4")
#' # Reanalysis #' # Reanalysis