Hypothesis Tests
t.test compares means, chisq.test tests counts and cor.test tests correlation. A small p-value (below 0.05) is evidence against the null hypothesis.
Example
a <- c(5.1, 4.9, 5.6, 5.8, 6.0); b <- c(4.1, 4.5, 4.9, 4.2, 4.8)
r <- t.test(a, b)
print(round(r$p.value, 4))Exercise
Compare two means.
.test(a, b)Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.