← R Programming learning pathR Programming · Module 7 of 10
Statistics in R
Calculate statistics and run tests.
📖 Key ideas
- Descriptive: mean, median, sd, var, quantile, table.
- Correlation: cor(x, y).
- t.test compares means; chisq.test tests categorical association.
- p-values help judge if results are likely due to chance.
- R makes statistics easy, but you must interpret carefully.
💡 Real-life example: Statistical tests are referees: they judge if a difference is real or just luck.
sd()Standard deviation
cor()Correlation coefficient
t.test()Compares means
p-valueChance of results if no real effect