Description Format Details Source References Examples
Given that the variances of two groups are unequal, we compute the difference of P-values assuming equal or unequal variances respectively by simulation.
A data frame with 1000 rows and 99 columns.
See the Examples section for the generation of this data.
By simulation.
Welch B (1947). “The generalization of Student's problem when several different population variances are involved.” Biometrika, 34(1/2), 28–35.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(t.diff)
boxplot(t.diff, axes = FALSE, xlab = expression(n[1]))
axis(1)
axis(2)
box()
## reproducing the data
if (interactive()) {
set.seed(123)
t.diff = NULL
for (n1 in 2:100) {
t.diff = rbind(t.diff, replicate(1000, {
x1 = rnorm(n1, mean = 0, sd = runif(1, 0.5, 1))
x2 = rnorm(30, mean = 1, sd = runif(1, 2, 5))
t.test(x1, x2, var.equal = TRUE)$p.value - t.test(x1, x2,
var.equal = FALSE)$p.value
}))
}
t.diff = as.data.frame(t(t.diff))
colnames(t.diff) = 2:100
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.