Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mix = sample(0:1, 1000, rep=T)
- x = mix*rnorm(500, 100, 15) + (1-mix)*rnorm(500, 150, 20)
- mean(x); sd(x)
- ## 126.7677
- ## 30.89346
- shapiro.test(x)
- ## Shapiro-Wilk normality test
- ## data: x
- ## W = 0.9703, p-value = 2.043e-13
- mix = sample(0:1, 1000, rep=T, prob=c(.20, .80))
- y = mix*rnorm(500, 100, 15) + (1-mix)*rnorm(500, 115, 20)
- shapiro.test(y)
- ## Shapiro-Wilk normality test
- ## data: y
- ## W = 0.9966, p-value = 0.02869
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement