1. I have a known population mean (\(\mu\)) and standard deviation (\(\sigma\))
2. I can calculate a population SE of any estimate of the mean, \(\frac{\sigma}{\sqrt{n}}\)
3. Now calculate a test statistic
\[\Large z = \frac{\bar{X} - \mu}{\sigma_{\bar{X}}}\]
Does this look normal?
What does this mean?
We’re familiar with quantiles - let’s say you have a normally distributed random variable:
0% 25% 50% 75% 100%
-3.78067252 -0.67818866 -0.01041209 0.67146298 3.61989650
There are many quantiles - all numbers between between 0% and 100%
0% 10% 20% 30% 40% 50%
-3.78067252 -1.26370725 -0.84012734 -0.53748706 -0.26382446 -0.01041209
60% 70% 80% 90% 100%
0.25880431 0.52504744 0.83012841 1.28781239 3.61989650
N.B. Quantiles are the 1-tailed P-Value!
0% 8.333333% 16.66667% 25% 33.33333% 41.66667% 50%
-26 -24 -23 -19 -16 -12 -9
58.33333% 66.66667% 75% 83.33333% 91.66667% 100%
-6 -2 4 11 17 20
A Normal QQ Plot shows these values plotted against the corresponding quantiles of a Normal Distribtion
If these values were normally distibuted, there would be a linear relationship, as the pattern of quantiles would be the same.
estimate statistic p.value parameter method alternative
1 -0.05615385 -1.271409 0.2276739 12 One Sample t-test two.sided
Horns prevent these lizards from being eaten by birds. Are horn lengths different between living and dead lizards?
What is the data generating process?
\[Horn\: Length_{ij} = \beta_i\]
\[\beta_i = Horn\: Length\, for\, group\: i\]
\[Horn\: Length_{ij} = \beta_i + \epsilon_j\]
\[\beta_i = Horn\: Length\: for\, group\: i\]
\[\epsilon \sim N(0,\sigma)\]
\[\LARGE t = \frac{\bar{x_1} - \bar{x_2}}{s_{12}\sqrt(n)}\]
s12 is a pooled standard deviation:
\[\large s_{12} = \sqrt(s_1 + s_2)\]
There’s a formula for that!
Unequal Sample Sizes - Alternate Formula for Denominator
Unequal Population Variances - Welch’s T-Test (different denominator and DF)
Residuals Not Normal - Transform - Non-Parametric Test - Golem with a different error structure
Welch Two Sample t-test
data: Squamosal horn length by Status
t = -3.8175, df = 46.93, p-value = 0.000394
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-3.264484 -1.011215
sample estimates:
mean in group Dead mean in group Living
21.98667 24.12452
What is being shown here?
Test | Purpose | Assumptions |
---|---|---|
1 sample t-test | Tests whether the mean of a sample is equal to a target value | Normality of population |
2 sample t-test | Tests whether the the means of two independent samples are equal | Normality, Equal Variance, Equal Sample Size |
Paired t-test | Tests whether the mean of the differences between paired observations are equal | Normality of difference |