SHARE
TWEET

Untitled

a guest Jun 25th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set.seed(1234)
  2. dat <- data.frame(y=c(rnorm(10),
  3.                        rnorm(10, mean=1),
  4.                        rnorm(50, sd=0.5)),
  5.                    group=rep(LETTERS[1:3], times=c(10,10,50)))
  6.  
  7. boxplot(y~group, data=dat)
  8.      
  9. TukeyHSD(aov(y~group, data=dat))
  10.   Tukey multiple comparisons of means
  11.     95% family-wise confidence level
  12.  
  13. Fit: aov(formula = y ~ group, data = dat)
  14.  
  15. $group
  16.           diff        lwr        upr     p adj
  17. B-A  1.2649867  0.5198000  2.0101734 0.0003695
  18. C-A  0.2405365 -0.3366827  0.8177556 0.5801783
  19. C-B -1.0244502 -1.6016694 -0.4472311 0.0001951
  20.  
  21. t.test(dat$y[dat$group=="A"], dat$y[dat$group=="B"])
  22.  
  23.     Welch Two Sample t-test
  24.  
  25. data:  dat$y[dat$group == "A"] and dat$y[dat$group == "B"]
  26. t = -2.7404, df = 17.914, p-value = 0.01349
  27. alternative hypothesis: true difference in means is not equal to 0
  28. 95 percent confidence interval:
  29.  -2.2351190 -0.2948544
  30. sample estimates:
  31.  mean of x  mean of y
  32. -0.3831574  0.8818293
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top