Eamonn Mallon
25/09/2019
cor.test(babies$gestation, babies$bwt)
Pearson's product-moment correlation
data: babies$gestation and babies$bwt
t = 15.609, df = 1221, p-value < 2.2e-16
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.3600303 0.4535398
sample estimates:
cor
0.407854
The length of gestation correlates with a baby's weight (pearson: r = 0.408, t = 15.609, df =1221, p < 0.0001 )
cor.test(babies$gestation, babies$bwt, method = "spearman")
Spearman's rank correlation rho
data: babies$gestation and babies$bwt
S = 181438572, p-value < 2.2e-16
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
0.4048838
The length of gestation correlates with a baby's weight (spearman: rho = 0.405, n = 1223, p < 0.0001 )
Blue.eyes | Brown.eyes | Row.totals | |
---|---|---|---|
Fair hair | 38 | 11 | 49 |
Dark hair | 14 | 51 | 65 |
Column totals | 52 | 62 | 114 |
count <- matrix(c(38,14,11,51), nrow=2)
chisq.test(count)
Pearson's Chi-squared test with Yates' continuity correction
data: count
X-squared = 33.112, df = 1, p-value = 8.7e-09
Hair colour is associated with eye colour (\( \chi^2 \) = 33.112, d.f. = 1, p = \( 8.7 \times 10^{-9} \))
Is hair colour associated with eye colour
These are examples of almost any biological question. Can you think of one that doesn't fit above? At a simple level, there isn't anything you can't ask with the tools you have