0% found this document useful (0 votes)
5 views18 pages

Statistical Modeling and Hypothesis Testing

Uploaded by

Zain Ahmed
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views18 pages

Statistical Modeling and Hypothesis Testing

Uploaded by

Zain Ahmed
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Lecture 3 notes

Populations and samples

Lecture 3:
Statistical & mathematical
modelling: Part 2

• Sample data ‘represents’ the whole population

Point estimation
Summarizing Data
• sample data is used to estimate parameters
of a population
• statistics are calculated using sample data
• parameters are the characteristics of
population data
sample mean Population mean
estimates

Sample SD Population SD

1
Lecture 3 notes

How can continuous data


Choosing summary statistics
(interval/ratio) be summarised?
Which average and measure of
spread? e.g., Exam marks for 60 students (marked
out of 65)
Scale* Categorical

Normally Skewed data Ordinal: Nominal:


distributed Median Median Mode
Mean (Standard (Interquartile (Interquartile (None)
deviation) range) range)

Note: * “Scale” = Interval or Ratio

Fairness and data Example

• when making graphs, consider the following graph, that


the researcher should presents exam scores for 12
strive to be as “fair” to seminar groups
the data as possible.
• something that isn’t
always followed!

2
Lecture 3 notes

Mean Score (%) Ttttt


for 2nd PS101 Examination Mean Score (%) Ttttt
for 2nd PS101 Examination
100

90
66.0
80

T T 70
% For Exam 2

% For Exam 2
t t 60
t 64.5 t
t t 50
t t
40
f f
63.0
30

20

61.5 10

0
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12

Groups Groups

Group frequency table Histogram for exam marks data


Frequency Percent
0 but less than 10 4 6.7
10 but less than 20 9 15.0
20 but less than 30 17 28.3
30 but less than 40 15 25.0
40 but less than 50 9 15.0
50 but less than 60 5 8.3
60 or over 1 1.7
Total 60 100.0

3
Lecture 3 notes

Summary statistics n

x Measures of central tendency


Mean = i 1
x
n
Standard deviation (s) is a n

measure of how much the  x  x 


i
2

s  i 1

individuals differ from the n 1


mean

For exam scores, mean = 30.5, SD = 14.46

14

Sometimes the median makes Measures of variability


more sense!

2/3rd people

50% people

16

4
Lecture 3 notes

Interpretation of standard deviation Assessing normality


Normally
Or….Skewed
distributed
larger the
standard
deviation,
the more
spread out
the data is.
Note: mean and median are very different for
skewed data.

Kurtosis

• the steepness of a distribution at its


center
• platykurtic: relatively flat
• leptokurtic: relatively peaked

5
Lecture 3 notes

Hypothesis testing Hypothesis testing (continued)


• sample data used to choose between two
An objective choices (i.e. hypotheses) about a
method of population
making
decisions or
• we typically do this by comparing what we
inferences from
have observed to what we expected if one
sample data
of the statements (Null Hypothesis) was
(evidence)
true

Hypothesis testing framework Types of errors


Typically restrict to a 5% Risk
Always two hypotheses: = level of significance

HA: Research (Alternative) Hypothesis Study reports Study reports


NO difference IS a difference
• what we aim to gather evidence of
(Do not reject H0) (Reject H0)
• typically that there is a H0 is true
difference/effect/relationship etc.
H0: Null Hypothesis
Difference Does
NOT exist in X Type I
Error
population
• what we assume is true to begin with
X
HA is true
Type II
• typically that there is no Difference DOES Error
exist in population
difference/effect/relationship etc.

6
Lecture 3 notes

Steps to undertaking a Hypothesis


Types of errors Controlled via sample
size (=1-Power of test) test
Define study question
Study reports Study reports Choose a
NO difference IS a difference Set null and alternative suitable
(Do not reject H0) (Reject H0) hypothesis
test
H0 is true
Calculate a test
Difference Does
NOT exist in X Type I
Error
statistic

Calculate a p-value
population

X
HA is true
Type II
Difference DOES Error Make a decision and interpret
exist in population your conclusions

Probability of this = Power of test

Example

Titanic sank in 1912 with the loss of most of


its passengers; 809 of the 1,309 passengers
and crew died (or 61.8%)
• Research question: Did “class” of
travel(i.e., 1st vs 2nd vs 3rd) affect
survival?

7
Lecture 3 notes

Null hypothesis:
• there is NO association between class
and survival

Alternative hypothesis:
• there IS an association between class and
survival

• test statistic involves a test of proportions


(e.g., chi-square)

What would be expected if


the null is true?
Same proportion of people (61.8%) would
have died in each class

8
Lecture 3 notes

Chi-Squared test compares Chi-squared test statistic


observed and expected frequencies
• chi-squared test is used when we want to
see if two categorical variables are related
• test statistic uses the sum of the squared
differences between each pair of observed
(O) and expected values (E)

 
2
n
Oi  Ei 2
i 1 Ei

Hypothesis testing: Decision rule Results

• If p < 0.05 reject H0 = Evidence of


HA being true (i.e. there IS an
association)

• If p > 0.05 do not reject H0 (i.e. NO • since p < 0.05 we reject the null
association)
• there is evidence (x2 =127.86, p <
0.001) to suggest an association
between class and survival

9
Lecture 3 notes

Example with 2 means


Comparing means

• look for
outliers/
errors (e.g.,
via a box-
plot)

t-tests

• Paired Data
used to compare two population means
• Paired t-test: same individuals studied
at two different times or under two
conditions
• Independent samples t-test: data
collected from two separate groups • Independent
Groups

10
Lecture 3 notes

Paired example Independent samples example


• If the same people have reported their
hours for 1988 and 2014 have PAIRED • If different people are used in 1988 and 2014
measurements of the same variable have independent measurements
(hours) • Independent Null hypothesis: The mean
• Paired Null hypothesis: The mean of the hours worked in 1988 is equal to the mean
paired differences = 0 for 2014
H 0 : 1988   2014

Assumptions in t-Tests Weight loss example


1. Normality (e.g., check via histogram) weight loss
2. Equal population variances: Compare was measured
sample standard deviations (e.g., after taking
Levene’s) to formally test for differences either a new
weight loss
treatment or
Note: the t-test is very robust to violations of placebo for 8
the assumptions, particularly for moderate weeks
(i.e. >30) and larger sample sizes

11
Lecture 3 notes

Weight loss example H0: μnew = μplacebo

t df Sig.
(2-tailed)

4.539 35 .000
p < 0.05, reject the null

• there is evidence of a difference in


weight loss between treatment and
placebo

Do these histograms look approximately


normally distributed?

Other statistics for comparing Other statistics for comparing


means means (continued)
• One-Way Analysis of variance • One-Way multivariate analysis of
(ANOVA) & t Test variance (MANOVA)
• One-Way Analysis of covariance • One-Way multivariate analysis of
(ANCOVA) covariance (MANCOVA)
• Factorial ANOVA • Factorial MANOVA
• Factorial ANCOVA • Factorial MANCOVA

47 48

12
Lecture 3 notes

Investigating Scatterplot
relationships

• displays the
relationship
between two
continuous
variables

also
summarizes
the way the two
• also helpful variables co-
for detecting Outlier vary (correlate):
the presence • positive or
of outliers negative
• strong vs.
weak

13
Lecture 3 notes

Correlation coefficient
also
summarizes:
• linear vs. • a number that provides us with an
non-linear index of the strength of the relationship
between two things
statistic used:
• ranges from -1.00 to +1.00
• r= Linear
correlation
coefficient

Pearson r Coefficient of determination

• most widely used measure of • represented as r2


correlation • indicates how much of the variance is
• used when 2 variables are shared by X and Y
continuous and the relationship is • e.g., r = .9 then r2 = .81 (81% shared
linear variance)

14
Lecture 3 notes

Spearman Rho Strong and weak correlations

• also known as rank-order correlation Strong relationships Weak relationships

• frequently used with small samples (N < Y Y

30) or when both sets of measurements


are ordinal
X X

Y Y

X X

Correlation interpretation
Linear & Nonlinear relationships
Linear relationships Curvilinear relationships
interpretations for the size of coefficient r
has been suggested by Cohen (1992)
Y Y

Correlation coefficient value Relationship

-0.3 to +0.3 Weak


X X
-0.5 to -0.3 or 0.3 to 0.5 Moderate
Y Y
-0.9 to -0.5 or 0.5 to 0.9 Strong

-1.0 to -0.9 or 0.9 to 1.0 Very strong


X X

15
Lecture 3 notes

• Impact of
outliers? Outlier
• r without
outlier = -.66
• r for all data-
points = -.34

Limits of correlational Does chocolate make you


research clever or crazy?

correlation does
not mean
causation

16
Lecture 3 notes

Messerli (2012) Winters & Roberts (2012)


Examined the r between chocolate and
Examined the r between chocolate and Nobel Prize
serial killers
winners

r = 0.791
Messerli 2012

r = 0.52

Limits of correlational research Limits of correlational research:


Confounding?

Is there something else affecting both


chocolate consumption and Nobel prize Chocolate
Number of
Nobel
consumption
winners? winners

Number of
Chocolate
Nobel ???
consumption
winners

17
Lecture 3 notes

Causal possibilities in a Causal possibilities in a


correlation correlation

1. X causes Y 1. X causes Y
X Y 2. Y causes X
X Y

Causal possibilities in a Causal possibilities in a


correlation correlation

1. X causes Y
1. X causes Y
2. Y causes X
2. Y causes X
3. X and Y both caused by third variable
Their correlation is an artifact 3. X and Y both caused by Z
X Y 4. X and Y involved in complex pattern of
multivariate cause and effect

18

You might also like