Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my_sample <- c(80, 90, 100, 80, 130)
- mu0 <- 125
- mean(my_sample)
- t.test(my_sample, mu = mu0, alternative = 'greater')
- # mu > mu0
- curve(dt(x, df=4), from = -5, to=5)
- # exercise
- # Find p-value for alternative = 'less'
- # We can do it without R
- 1 - 0.9824
- t.test(my_sample, mu = mu0, alternative = 'less')
- # Find p-value for alternative = 'two.sided'
- # H1: mu != mu0
- # We do it without R
- t.test(my_sample, mu = mu0, alternative = 'two.sided')
- 0.01764 * 2
- x <- c(3, 2, 5, 1, 7) # treatment group
- y <- c(4, 5, 3, 5, 7, 8) # control group
- t.test(x, y, alternative = 'less')
- t.test(x, y, alternative = 'two.sided')
- t.test(rep(x, 3), rep(y, 3), alternative = 'less')
- dat <- read.csv("https://bit.ly/39Fr0gD")
- # Is it true that time for round sounds is
- # greater or less than time for unrounded sounds?
- round_times <- dat[dat$roundness == "round", "time"]
- # get values of time variable
- # where roundness == "round"
- dat[dat$roundness == "round", "time"]
- unrounded_times <- dat[dat$roundness == "unrounded", "time"]
- round_times
- mean(round_times)
- sd(round_times)
- length(round_times)
- mean(unrounded_times)
- sd(unrounded_times)
- length(unrounded_times)
- # Exercise:
- # use t.test to test a hypothesis
- # and answer: can we say that
- # there is a statistically significant
- # difference between round and unrounded times?
- t.test(round_times, unrounded_times)
- # p-value = 0.33 > 0.05 => do not reject H0
- t.test(time ~ roundness, data=dat)
- unique(dat$roundness)
- t.test(vowel.dur ~ roundness, data=dat)
Add Comment
Please, Sign In to add comment