Basic Statistics in R
Now the fun part β actual statistics, run live. Edit and Run each box.
Summary statistics
summary() gives the minimum, quartiles, median, mean and maximum in one call.
Frequency table
Count how many cars have each cylinder count:
Correlation
How strongly are two variables related? (β1 to +1)
A strong negative value: heavier cars have clearly lower mpg. (Pearson vs Spearman.)
Your first t-test
Do automatic and manual cars differ in fuel efficiency? A t-test answers it:
Look at the p-value: small (below 0.05) means the difference is unlikely to be chance. (What a p-value really means.)
Fit a simple model
That summary() is a full linear regression β coefficients, p-values and RΒ². (How to read it.)
Your turn
Youβve run summaries, a t-test, a correlation and a regression β the core of applied statistics.
Where next? Keep experimenting in the R playground, read deeper R tutorials on the blog, or reach for the free statistics calculators. When your analysis gets serious, thatβs what we do.