+ - 0:00:00
Notes for current slide
Notes for next slide

Which test statistics is better? for two-sample hypothesis test

a simulation study

Lin Yu

2023-03-28

1 / 10

Distributions

we considered normal and nonnormal (uniform, weibull) distributions

2 / 10

Scenarios

We simulated different settings, simply put,

  • sample size varies from 10(small) to 1000(large);
  • different magnitude of diff between μ1 and μ2, sd1 and sd2;
  • finally, both normal and nonnormal distribution were tested.

Details are noted in the following table:

parameter description setting
μ1 mean of population 1 c(0.1,1,3,5)
μ2 mean of population 2 c(1,3,10)
sd1 standard deviation of ppl 1 c(1,5,10)
sd2 standard deviation of ppl 2 c(0.1,1,10)
nsample1 sample size of ppl 1 c(10,20,30,50,100,1000)
nsample2 sample size of ppl 2 c(10,20,30,100,1000)
dist study population distribution normal, uniform, and weibull
3 / 10

Pseudo-code

function(seed,mu1,mu2,sd1,sd2,nsample1,nsample2,dist,Nsim){
#### for loop over all paramaters
for (parameter in 1:length(mu1)){
-------------------------------------------------------
#### calculate the test stats and pval for Nsim times
for(i in 1:Nsim){
dat1 =
dat2 =
test_stats =
pval =
}
--------------------------------------------------------
#### calculate type I error and power by counting
pval/Nsim
}
}
4 / 10

Results

##wide table to long table
library(tidyr)
## Warning: 程辑包'tidyr'是用R版本4.1.3 来建造的
long <- final_res %>%
pivot_longer(
cols = `t_equal`:`wilcox`,
names_to = "test_stat",
values_to = "value",
)
5 / 10
6 / 10

Type I error

7 / 10

8 / 10

Statistical power

9 / 10

10 / 10

Distributions

we considered normal and nonnormal (uniform, weibull) distributions

2 / 10
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
oTile View: Overview of Slides
sToggle scribble toolbox
Alt + fFit Slides to Screen
Esc Back to slideshow