One sample T hypothesis test for Mean μ

Is a particular claimed (hypothesized) value for μ plausible? Does our sample give enough evidence to reject that claim?

Underlying machinery: the sampling distribution of x̄, the (estimated) standard error of the mean (SEM)≈ s/√n, the t distribution.

Null hypothesis H0: already "known", [current] belief, established, default, status quo, old, pre-existing, current practice, well-known, consensus, reference, "true until proven otherwise", original, working assumption, nothing new, boring. The parameter μ equals some number a; there is no significant difference between μ and x̄.
Alternative hypothesis HA: new, exciting, hoped/wished, changed, different, research, challenger, the conjecture. Either the parameter μ<a, or μ>a, or μ≠a; there is a difference, there is an effect that is not caused by random chance. AKA H1
Test if the sample (i.e. its statistic x̄ and its size n) provides enough evidence to overthrow ("warrant rejection of") the null hypothesis. Is the sample statistic x̄ extreme enough (i.e. very improbable under the null hypothesis).
Either "reject" or "fail to reject" the null hypothesis; never "accept" it. Rejecting it ≡ "support" the alternative.
The alternative hypothesis is neither rejected nor accepted.
Nothing is ever "proven". (would need entire population to prove anything) We never have certainty.

T-Test for mean μ. Uses μ, s, x̄, and n. Test statistic is t.

Assumes population is normal or n≥30 and no outliers or heavy tails.
Sample must be SRS random.

The test statistic t is a measure of discrepancy between the sample statistic x̄ and the H0 claimed value of the population parameter μ.
t = (observed x̄ - expected μ) / SEM

Given null hypothesis H0: μ = a
Choose one:
HA: parameter μ < a "HA < H0" Left-tailed
HA: parameter μ > a "HA > H0" Right-tailed
HA: parameter μ ≠ a "HA ≠ H0" Two-tailed

"μ":
:    s:
n:

t:           df:   estimated SEM=s/√n:     skip: set t and df, look at p-value below
   Critical value: α=0.05: α=0.01:
If t is outside/beyond the bounds of the critical value, i.e. |t|>|crit val|, reject H0.
   If Left-tailed and t≤CritValue then Reject H0 at that α level.
   If Right-tailed and t≥CritValue then Reject H0 at that α level.
   If Two-tailed and |t|≥|CritValue| then Reject H0 at that α level.

p-value (TCDF(t,df)): if p < α, reject H0

Chance that the test statistic t would be this much or more if H0 were true.
                            (this little or less) (this extreme or more).
"If the p is low, the null must go." Too unlikely to have occurred by chance if H0 were true.
Typically the critical/rejection region ("level of significance", α) is chosen to be .05 or .01, so if p is less than it reject H0; if p is not less than the critical value don't reject H0 ("fail to reject" = "cannot disprove").
Probability (area) in a tail (or two) of the test statistic's PDF curve.
If p is high (bigger than α), can't reject H0.
Selecting Two-tailed case doubles the p-value over the One-tailed cases.
Mean One-tailed tests are "symmetric".
Tip: if the p-value is like .9, check that you selected the appropriate "tail" above before failing to reject.

A confidence interval and a two-sided hypothesis test are two sides of the same coin:
 Any value of μ that lies inside a 95% confidence interval would not be rejected by a two-sided test at α=0.05.
 Any value of μ that lies outside the 95% confidence interval would be rejected by that same test.
So the confidence interval is essentially the set of all hypothesized values that 
 are still considered plausible after seeing the data.

Exs.
Worksheet
μ=100 x̄=100 s n irrelevant. Can't reject claim that μ is 100.
μ=100 x̄=105 s=10 n=36 →SEM=1.66 An x̄≈3σ very unlikely → Reject claim that μ is 100.
μ=100 x̄=101.7 s=10 n=36 →SEM=1.66 An x̄≈1σ likely → Can't reject claim that μ is 100.. Can't reject claim that μ is 100.

T-test: μ=100, s=10, n=30. Try x̄= 102, 103, 104, 105. Ha>H0
T-test: μ=100, s=10, n=30. Try x̄= 102, 103, 104, 105. Ha≠H0

Effect of s:
T-test: μ=100, s=5, n=30. Try x̄= 101, 102, 103. Ha>H0
T-test: μ=100, s=5, n=30. Try x̄= 101, 102, 103. Ha≠H0

Effect of n:
T-test: μ=100, s=10, n=100. Try x̄= 101, 102, 103. Ha>H0
T-test: μ=100, s=10, n=100. Try x̄= 101, 102, 103. Ha≠H0


NB. p-hacking: great pressures (professional, monetary, publication bias, ideological) to have positive result.
So cheating and lying by:
stop data collection when p≤.05
discard data that prevents p≤.05
repeat the experiment until get p≤.05
test for different effects until find one with p≤.05
NB. Also possible to have:
H0: φ≤a and HA: φ>a
H0: φ≥a and HA: φ<a
NB. With very large sample a very small difference between x̄ and claimed μ can be "significant".