1/307
lectures 1-7 (quiz 1), Lectures 9-13 (quiz 2), Lectures 15-17( quiz 3), lecture 19 (quiz 4)
Science
A way of understanding the natural world by testing explanations
t-statistic for one sample test gets larger when
the difference between null and actual increases
null hypothesis of single sample t-test
actual mean is near the given mean
5 steps of single sample t-test
calculate sample mean
calculate standard deviation
calculate standard error of the mean
calculate t statistic
compare to t-distribution with degrees of freedom
3 types of t-tests
compare data to a fixed number
compare two groups of paired data
compare two groups of unpaired data
z value’s 0.05
1.96
95% confidence interval
2 SE above and below the mean
applications of t
confidence interval of the mean
compare estimate of the mean to given value
compare paired groups
compare unpaired groups
does z or t reject the null more?
t
degrees of freedom is related to
sample size
the t distribution
always centered at zero
has a single parameter, degrees of freedom
as degrees of freedom gets bigger, it gets closer to a normal distribution
z =
observation - mean /SD
whats the problem if we try to find the Z of the sampling distribution of the means?
the denominator, we dont know the standard deviation of the sampling distribution of the mean
how is the t distribution different
it has a bell shape but the tails are thicker, making it more likely for observations to fall beyond two standard deviations from the mean
t distribution is not
normal because it has thicker tails and the standard error is not constant and it depends on the sample, adding error to our estimate of t. however, as sample size increases SE gets better and t gets closer to z
thick tails of students t
helpful for resolving problem with a less reliable estimate of standard error when n is small
anatomy of a test statistic
point estimate - null value / SE of point estimate
SE =
s / sqrt n
students t has its own
t distribution
how do we fix the z equation for sampling distributions?
use students t = Y-u / SE
z score
the number of standard deviations it falls above or below the mean
observations more than 2 SD away from the mean
|z| > 2
A p value is not…
the probability that the null hypothesis is true
the probability that the alternative hypothesis is false
not the probability of random chance
does not indicate the magnitude of importance
Type 1 error
rejecting the null hypothesis when it is true, false positive
if we dont want a type 1 error
decrease a
statistical power
the probability that a random sample will lead to a rejection of the false null hypothesis (type 2 error); increases with sample size; complement of beta
fixing probability of type 1 error
make alpha smaller, divide by number of tests, bonferroni, can be too restrictive
accept a certain number of errors
The probability of making at lease 1 type 1 error in N tests
1- (1-a)^N
The probability of making no errors in N tests
(1-a)^N
problem with multiple tests
by chance, 5% of data will give you a false positive
type 2 error increases with
overlap between null and alt
if we dont want a type 2 error
increase a
area to the right of the critical value of the alt graph
reject null, when you are supposed to, or statistical power
if the test statistic is to the left of the critical value
the p value is larger than the alpha value
p value on graph
to the right of the test statistic
increasing a increases
error rate
p(type 1 error | H0 true) =
5%
to the left of the critical value on the alt hypothesis curve
the probability for a type 2 error or beta
when using a 5 % significance level there is a
5% change of making a type one error
we dont want to incorrectly reject the null more than…
5% of the time
Type 2 error
not rejecting the null hypothesis when we should have, false negative
normal distribution
natural, and artifically made, most widely used assumption in statistics; gaussian distribution
standard normal distribution
mean is 0 and sd is 1; x axis = z values; area under curve is probability; infinite tails
low p-value
unlikely, reject
high p-value
likely, accept
chi squared does not work with…
proportions
chi square distribution
distribution of the statistic under the null hypothesis
steps of chi squared
question, anything interesting in the data?
null hypothesis
find chi squared
is the test statistic grater than the critical value?
make conclusion
why do we square in chi square?
negatives will become positive
unusual differences will be exaggerated
df =
number of categories - 1
x2 =
sum of (observed-expected)2 / expected
Null hypothesis (H0)
you want to reject, what you would expect if the world was boring
hypothesis testing framework
null hypothesis
alternative hypothesis
conduct hypothesis under assumption that null hypothesis is true
use test results to determine if null hypothesis is true or not
P-value
probability of obtaining the observation or more extreme value if the null hypothesis is true, probability measured as area under the curve to the right of the chi squared
null distribution
sampling distribution of the test statistic assuming H0, describes the probability distribution of expected outcomes under H0
Alternative hypothesis (HA or H1)
the interesting hypothesis you want to support; cannot be proven by null hypothesis testing
How is null hypothesis testing used in science?
to see if we have sufficient evidence to support a scientific claim
The standard deviation of the sampling distribution for proportion is the same as…
the standard error of the estimated proportion
example of multinomial distribution
chances of something happen on days of the week
discrete data
usually finite countable numbers, but can be infinite
what plots are used for discrete probability distributions?
bar plots
What rule can we use in discrete probability distributions and why?
because the data is mutually exclusive, you can use the sum rule
probability density function of continuous probability distributions
a smooth curve
How to find the probability of something using a continuous distribution?
the proportion of data in the shaded area

since continuous probabilities are estimated as the area under the curve, the probability of an exact value is….
0
N(u, o)
normal with mean u and standard deviation o
not all bell shaped curves are
normal distributions
Pr [a<x<b]
integral between a and b; generalized sum rule
binomial distribution is…
a function over each possible outcome
probability of proportion calculated using..?
binomial probability formula
proportion =
successes / trials
binomial distribution depends on..
p and n
Pascals triangle
sides are all ones
second row diagonal: 1,2,3,4…
each number is the sum of the ones on top
1’s are zeros
n = 5, k = 3. row 5 column 3
simple binomial distribution formula
number of scenarios x probability of single scenario
k
number of successes
# of scenarios
(n/k) = n! / k! (n-k)!
0!
1
(n/k)
n! / k! (n-k!)
(n/n-1) =
n
n!
n x n-1 x n-2 …
1!
1
choose function
calculates the number of ways to choose k successes in n trials
P(single scenario)
pk (1-p)n-k
n
number of trials
if we selected four individuals to participate in the experiment, how would we find the probability of a certain number of individuals succeeding or failing?
Since they are independent joint (and) variables, multiply each persons probability together, and then multiply by the amount of ways it could possibly happen, aka which person does what
Bernoulli random variable
when an individual trial has only two outcomes
since 35% of people refused to administer a shock, the probability of SUCCESS is
0.35
failure milgrams
administers shock
Success milgrams
refuses to administer shock
Trials in Milgram’s experiment
each person
Milgram Experiment
Stanley Milgram
Experimenter orders teacher to shock the learner each time they answer a question incorrectly
shocks are not real
65% of people would give the shocks
What did the Milgram experiment measure?
the willingness of participants to obey an authority figure who instructed them to perform acts that conflicted with their personal conscience
Sensitivity
High probability of true positives, fewer false negatives; Pr (+|has disease) = TP / TP + FN
Specificity
High probability of True negatives, fewer false positives; Pr(-|doesn’t have disease) = TN / TN + FP
Is it better to know if the test will be positive given you have the disease, or that you have the disease given the test is positive.
knowing if you have the disease given the test is positive.
Precision
Pr [has disease | positive result] = TP / TP + FP
False negative / Type 2 error
test says negative when truly positive
False positive / Type 1 error
tests says positive when really negative
True Negative
Test predicts negative when truly negative.