Docsity

Statistical Analysis of Frequencies: Binomial and Chi-square Tests - Prof. Brian P. Dyre, Study notes of Psychology

Toggle sidebar
bg1
1
PSYC512: Research MethodsPSYC512: Research Methods
PSYC512: Research MethodsPSYC512: Research Methods
Lecture 19Lecture 19
Brian P. DyreBrian P. Dyre
University of IdahoUniversity of Idaho
PSYC512: Research MethodsPSYC512: Research Methods
Lecture 19 OutlineLecture 19 Outline
nnInferential StatisticsInferential Statistics
nnTesting for differences vs. relationshipsTesting for differences vs. relationships
nnAnalyzing frequenciesAnalyzing frequencies
nnAnalyzing differences between meansAnalyzing differences between means
PSYC512: Research MethodsPSYC512: Research Methods
Using Inferential StatisticsUsing Inferential Statistics
nnWhich Statistic?Which Statistic?
nnThe statistical decision tree Howell Figure 1.1The statistical decision tree Howell Figure 1.1
nnTesting for relationships vs. differences (a false distinction)Testing for relationships vs. differences (a false distinction)
nnRelationships: assessing the strength of relationship Relationships: assessing the strength of relationship
between measured (dependent) variablesbetween measured (dependent) variables
nnDifferences: comparing different groups or treatments Differences: comparing different groups or treatments
on some measurementon some measurement
nnBut what causes those differences? The relationship But what causes those differences? The relationship
between the independent variable defining the between the independent variable defining the
groups or treatment and the dependent variablegroups or treatment and the dependent variable
nnHence, testing for differences is really testing the Hence, testing for differences is really testing the
relationship between the IV and DVrelationship between the IV and DV
PSYC512: Research MethodsPSYC512: Research Methods
Analyzing Differences Between Analyzing Differences Between
Treatments Treatments
nnNominal and Ordinal Frequency DataNominal and Ordinal Frequency Data
nn“Success vs. Failure” “Success vs. Failure” --Binomial Distribution and The Sign TestBinomial Distribution and The Sign Test
nnMultiple categories (> 2) Multinomial distribution and ChiMultiple categories (> 2) Multinomial distribution and Chi--squaresquare
nnMultidimensional categories: ChiMultidimensional categories: Chi--square contingency tablessquare contingency tables
nnIntegral and Ratio DataIntegral and Ratio Data
nn2 treatments or groups 2 treatments or groups ––tt--testtest
nnComparing two independent samples Comparing two independent samples ààHW3HW3
nnComparing two correlated (or paired samples) Comparing two correlated (or paired samples) ààHW4HW4
nnMore than 2 treatments or groups More than 2 treatments or groups ––ANOVAANOVA
nnMore than 2 independent variables More than 2 independent variables ––multifactor ANOVAmultifactor ANOVA ––HW5HW5
nn2 or more dependent variables (or repeated measures) 2 or more dependent variables (or repeated measures) ––
MANOVAMANOVA
nnCovariate Covariate ààANCOVA ANCOVA ––HW5HW5
nnRelations between measuresRelations between measures
nnCorrelation or RegressionCorrelation or Regression
PSYC512: Research MethodsPSYC512: Research Methods
Analyzing Frequencies Analyzing Frequencies
(Howell, Chapter 5)(Howell, Chapter 5)
nnBernoulli Trials: series of Bernoulli Trials: series of independentindependent trials that result in one of two trials that result in one of two
mutually exclusive outcomesmutually exclusive outcomes
nnE.g. coin flips, gender of babies born, increase of decrease in E.g. coin flips, gender of babies born, increase of decrease in a a
measure after application of a treatmentmeasure after application of a treatment
nnThe Binomial DistributionThe Binomial Distribution
trialoneanyonfailureofyprobabilitThepq
trialoneanyonsuccessofyprobabilitThep
trialsofnumberTheN
successesXofyprobabilitTheXp
whereqp
XNX
N
Xp
hence
XNX
N
timeaatXtakenthingsNofnscombinatioofnumberTheC
whereqpCXp
XNX
N
X
XNXN
X
"")1(
""
)(
)!(!
!
)(
,
)!(!
!
,)(
)(
)(
=−=
=
=
=
−
=
−
==
=
−
−
PSYC512: Research MethodsPSYC512: Research Methods
Analyzing Frequencies Analyzing Frequencies
(Howell, Chapter 5)(Howell, Chapter 5)
nnUsing the binomial distributionUsing the binomial distribution
nnMean number of successes = Mean number of successes = NpNp
nnVariance in number of successes = Variance in number of successes = NpqNpq
nnTesting Hypotheses using the binomial distribution: The Sign TesTesting Hypotheses using the binomial distribution: The Sign Testt
nnHo is typically Ho is typically p= q = .50 p= q = .50 (50(50--50 chance of success of failure), but 50 chance of success of failure), but
that doesn’t have to be the casethat doesn’t have to be the case
nnH1 is typically H1 is typically p ?qp ?q
nnPlug in values for N, X, p, and q and Plug in values for N, X, p, and q and p(Xp(X) directly provides the ) directly provides the
probability that the pattern of data could result given the nullprobability that the pattern of data could result given the null
hypothesis is truehypothesis is true
nnSum the probabilities Sum the probabilities p(Xp(X) for all number >= X to get the total ) for all number >= X to get the total
probability of finding p(>=X)probability of finding p(>=X)
nnImportant: The sign test takes into account direction of differeImportant: The sign test takes into account direction of differences nces
but not magnitudebut not magnitude
)(
)!(!
!
)( XNXqp
XNX
N
Xp−
−
=
pf3

Partial preview of the text

Download Statistical Analysis of Frequencies: Binomial and Chi-square Tests - Prof. Brian P. Dyre and more Study notes Psychology in PDF only on Docsity!

PSYC512: Research MethodsPSYC512: Research Methods

PSYC512: Research MethodsPSYC512: Research Methods

Lecture 19Lecture 19

Brian P. DyreBrian P. Dyre

University of IdahoUniversity of Idaho

PSYC512: Research MethodsPSYC512: Research Methods

Lecture 19 OutlineLecture 19 Outline

nn Inferential StatisticsInferential Statistics

nn Testing for differences vs. relationshipsTesting for differences vs. relationships

nn Analyzing frequenciesAnalyzing frequencies

nn Analyzing differences between meansAnalyzing differences between means

PSYC512: Research MethodsPSYC512: Research Methods

Using Inferential StatisticsUsing Inferential Statistics

nn Which Statistic?Which Statistic?

nn The statistical decision tree Howell Figure 1.1The statistical decision tree Howell Figure 1.

nn Testing for relationships vs. differences (a false distinction)Testing for relationships vs. differences (a false distinction)

nn Relationships: assessing the strength of relationshipRelationships: assessing the strength of relationship

between measured (dependent) variablesbetween measured (dependent) variables

nn Differences: comparing different groups or treatmentsDifferences: comparing different groups or treatments

on some measurementon some measurement

nn But what causes those differences?But what causes those differences? The relationshipThe relationship

between the independent variable defining thebetween the independent variable defining the

groups or treatment and the dependent variablegroups or treatment and the dependent variable

nn Hence, testing for differences is really testing theHence, testing for differences is really testing the

relationship between the IV and DVrelationship between the IV and DV

PSYC512: Research MethodsPSYC512: Research Methods

Analyzing Differences BetweenAnalyzing Differences Between

TreatmentsTreatments

nn Nominal and Ordinal Frequency DataNominal and Ordinal Frequency Data

nn “Success vs. Failure”“Success vs. Failure” -- Binomial Distribution and The Sign TestBinomial Distribution and The Sign Test nn Multiple categories (> 2) Multinomial distribution and ChiMultiple categories (> 2) Multinomial distribution and Chi--squaresquare

nn Multidimensional categories: ChiMultidimensional categories: Chi --square contingency tablessquare contingency tables

nn Integral and Ratio DataIntegral and Ratio Data nn 2 treatments or groups2 treatments or groups –– tt--testtest

nn Comparing two independent samplesComparing two independent samples ‡‡ HW3HW nn Comparing two correlatedComparing two correlated (or paired samples)(or paired samples) ‡‡ HW4HW

nn More than 2 treatments or groupsMore than 2 treatments or groups –– ANOVAANOVA

nn More than 2 independent variablesMore than 2 independent variables –– multifactor ANOVAmultifactor ANOVA –– HW5HW

nn 2 or more dependent variables (or repeated measures)2 or more dependent variables (or repeated measures) –– MANOVAMANOVA

nn CovariateCovariate ‡‡ ANCOVAANCOVA –– HW5HW

nn Relations between measuresRelations between measures nn Correlation or RegressionCorrelation or Regression

PSYC512: Research MethodsPSYC512: Research Methods

Analyzing FrequenciesAnalyzing Frequencies

(Howell, Chapter 5)(Howell, Chapter 5)

nn Bernoulli Trials: series ofBernoulli Trials: series of independentindependent trials that result in one of twotrials that result in one of two

mutually exclusive outcomesmutually exclusive outcomes

nn E.g. coin flips, gender of babies born, increase of decrease inE.g. coin flips, gender of babies born, increase of decrease in aa measure after application of a treatmentmeasure after application of a treatment

nn The Binomial DistributionThe Binomial Distribution

q p Theprobabilityof failureonanyone trial

pTheprobabilityofsuccessonanyonetrial

NThenumberoftrials

pX TheprobabilityofXsuccesses

pq where X NX

N

pX

hence X NX

N

C ThenumberofcombinationsofNthingstakenXatatime

pX Cpq where

XN X

N X

NXNX X

( )

( )

−

−

PSYC512: Research MethodsPSYC512: Research Methods

Analyzing FrequenciesAnalyzing Frequencies

(Howell, Chapter 5)(Howell, Chapter 5)

nn Using the binomial distributionUsing the binomial distribution nn Mean number of successes =Mean number of successes = NpNp nn Variance in number of successes =Variance in number of successes = NpqNpq

nn Testing Hypotheses using the binomial distribution: The Sign TesTesting Hypotheses using the binomial distribution: The Sign Testt nn Ho is typicallyHo is typically p= q = .50p= q = .50 (50(50--50 chance of success of failure), but50 chance of success of failure), but that doesn’t have to be the casethat doesn’t have to be the case

nn H1 is typicallyH1 is typically p? qp? q nn Plug in values for N, X, p, and q andPlug in values for N, X, p, and q and p(Xp(X) directly provides the) directly provides the probability that the pattern of data could result given the nullprobability that the pattern of data could result given the null hypothesis is truehypothesis is true nn Sum the probabilitiesSum the probabilities p(Xp(X) for all number >= X to get the total) for all number >= X to get the total probability of finding p(>=X)probability of finding p(>=X) nn Important: The sign test takes into account direction of differeImportant: The sign test takes into account direction of differencesnces but not magnitudebut not magnitude

( )

X NX

pq

X N X

N

p X

−

PSYC512: Research MethodsPSYC512: Research Methods

Analyzing FrequenciesAnalyzing Frequencies

(Howell, Chapter 5)(Howell, Chapter 5)

nn What about multiple (more than 2) possible outcomes?What about multiple (more than 2) possible outcomes?

nn Multinomial distributionMultinomial distribution

p TheprobabilityofobservationXbeingincategorykonanyone trial

N Thenumberoftrials

pXX X TheprobabilityoffrequencyXineachcategoryk

where

p p p where XX X

N

pXX X

k

k

X

k

X X X

k

k

1 2

1 2

1 2

1 2

PSYC512: Research MethodsPSYC512: Research Methods

Analyzing FrequenciesAnalyzing Frequencies

(Howell, Chapter 5)(Howell, Chapter 5)

nn Using the multinomial distributionUsing the multinomial distribution

nn MeanMean XXkk == NpNp XkXk

nn Variance inVariance in XX kk == NpNpXkXk^ (1(1-- ppXkXk ))

nn Testing Hypotheses using the multinomial distribution:Testing Hypotheses using the multinomial distribution:

nn Ho is typicallyHo is typically ppX1X1= p= pX2X2^ … =… = ppXkXk^ = 1/k= 1/k (each outcome has the(each outcome has the same chance), but that doesn’t have to be the casesame chance), but that doesn’t have to be the case

nn H1 is typicallyH1 is typically ppX1X1^? p? p X2 …X2 …?? ppXkXk

nn Plug in values for N, X, andPlug in values for N, X, and pp XX , and p(X, and p(X 11 , X, X 22 ……XXkk) directly provides) directly provides the probability that this particular pattern of data could resulthe probability that this particular pattern of data could resul tt given the null hypothesis is truegiven the null hypothesis is true

nn Must sum the probabilities for all patterns that deviate equal tMust sum the probabilities for all patterns that deviate equal to oro or more to get the total probabilitymore to get the total probability –– time consuming!time consuming!

XX X k

k

k pp p XX X

N p XX X ... ! !...!

! ( , ,... ) 1 2

1 2

1 2 =

PSYC512: Research MethodsPSYC512: Research Methods

Analyzing FrequenciesAnalyzing Frequencies

(Howell, Chapter 6)(Howell, Chapter 6)

nn Easier Alternative toEasier Alternative to

Multinomial distribution:Multinomial distribution:

ChiChi--square (square (χχ

22

)) testtest

nn Compare computed valueCompare computed value

ofof χχ

22

to value ofto value of χχ

22

distribution withdistribution with dfdf=k=k--1 1

nn Expected frequencies forExpected frequencies for

the null hypothesisthe null hypothesis

typically = N/k, where Ntypically = N/k, where N

is the total number ofis the total number of

observationsobservations

=

−

k

i i

i i k

E

O E

1

2 2 1

kk is the number ofis the number of

categories in the variablecategories in the variable

OO is the observed frequencyis the observed frequency for each categoryfor each category

EE is the expected frequencyis the expected frequency

for each categoryfor each category

ii is the category indexis the category index

PSYC512: Research MethodsPSYC512: Research Methods

Analyzing FrequenciesAnalyzing Frequencies

(Howell, Chapter 6)(Howell, Chapter 6)

nn UsingUsing χχ 22 with multiplewith multiple

dimensions: contingencydimensions: contingency

tablestables ——frequencies of onefrequencies of one

dimension aredimension are contingentcontingent onon

the other dimensionthe other dimension

nn EEijij == RRiiCCjj/N/N

nn NN is the total number ofis the total number of observationsobservations

nn Compare computed value ofCompare computed value of χχ 22

to value ofto value of χχ^22 distribution withdistribution with

dfdf=(R=(R--1)(C1)(C--1)1)

= =

− −

R

i

C

i ij

ij ij R C E

O E

1 1

2 2 ( 1 )( 1 )

χ

RR is the number of categories inis the number of categories in the dimension defined by thethe dimension defined by the

rows of the tablerows of the table

C is the number of categories inC is the number of categories in

the dimension defined by thethe dimension defined by the

columns of the tablecolumns of the table

OO is the observed frequency foris the observed frequency for each categoryeach category

EE is the expected frequency foris the expected frequency for

each categoryeach category

ii and j are category indicesand j are category indices

PSYC512: Research MethodsPSYC512: Research Methods

nn Assumptions of theAssumptions of the χχ

22

testtest

nn Each observation is independentEach observation is independent

nn Inclusion of nonInclusion of non--occurrencesoccurrences

Analyzing FrequenciesAnalyzing Frequencies

(Howell, Chapter 6)(Howell, Chapter 6)

PSYC512: Research MethodsPSYC512: Research Methods

zz--tests, ttests, t--teststests

nn σσ of population is known:of population is known: zz

nn σσ of population is estimated asof population is estimated as ss :: tt

nn dfdf = N= N--1 1

nn Comparing 2 paired (or correlated) samplesComparing 2 paired (or correlated) samples nn Difference scoresDifference scores nn DfDf = N= N --1 1

nn Comparing 2 independent samplesComparing 2 independent samples nn dfdf == n1 + n2n1 + n2 – – 2 2

nn Unequal sample sizes, heterogeneity ofUnequal sample sizes, heterogeneity of variance, and pooled variancesvariance, and pooled variances

N

X X

z

X

X

s N

X

s

X

t N

X

X /

μ − μ

2

2 2

1

2 1

1 2 1 2

n

s

n

s

X X

tn n X

s N

D

s

D

t N D D

X /