Вы находитесь на странице: 1из 99

Unit V

Dr. Jos e Joy T h op pan


UNIT V
Data analysi s
Descriptive analysis of univariate and
bivariate data

Parametric tests for hypotheses testing

Non-parametric tests for hypotheses


testing

Correlation and regression analysis

Multivariate analysis
Dependency techniques

Interdependency techniques
Session I
Descriptive Analysis of Univariate
& Multivariate Data

Parametric Testing
Z test, t test, ANOVA

Introduction to MANOVA and ANCOVA

SEM
Descriptive & Inferential Statistics
Descriptive Statistics Inferential Statistics
Organize Generalize from samples to pops

Summarize Hypothesis testing

Simplify Relationships among variables

Presentation of data

Describing data Make predictions


Descriptive Statistics
3 Types

1. Frequency Distributions 3. Summary Statistics

# of Ss that fall Describe data in just one


in a particular category number

2. Graphical Representations

Graphs & Tables


Frequency Distributions
# of Ss that fall
in a particular category
How many males and how many females are
in our class?

total

Frequency ? ?
(%)
?/tot x 100 ?/tot x 100
scale of measurement? nominal
-----% ------%
Frequency Distributions
Categorize on the basis of more that one variable at same time
CROSS-TABULATION
# of Ss that fall
in a particular category

total

Democrats 24 1 25

Republican 19 6 25

Total 43 7 50
Graphical Representations
Bar graph (ratio data - quantitative)
Graphs & Tables
Graphical Representations
Histogram of the categorical variables
Graphs & Tables
Graphical Representations
Polygon - Line Graph
Graphs & Tables
Best Graph Ever
Charles Minards 1869 graph of Napoleons 1812 march on Moscow shows the
dwindling size of the army. The broad line on top represents the armys size on
the march from Poland to Moscow. The thin dark line below represents the
armys size on the retreat. The width of the lines represents the army size,
which started over 400,000 strong and dwindled to 10,000. The bottom lines
are temperature and time scales, and the overall plot shows distance travelled.
Best Graph Ever Modern Version
jagged

smooth

Central Limit Theorem:


The larger the sample size, the closer a distribution will approximate the normal distribution or A
distribution of scores taken at random from any distribution will tend to form a normal curve
Normal Distribution:
half Two Tail
the scores above 68%
meanhalf below
(symmetrical)

95%
2.5% 2.5%

13.5%
13.5%

5% region of rejection of null hypothesis


Non directional
Summary Statistics
describe data in just 2 numbers

Measures of central tendency Measures of variability


typical average score typical average variation
Measures of Central Tendency
Quantitative data:
Mode the most frequently occurring observation
Median the middle value in the data (50 50 )
Mean arithmetic average

Qualitative data:
Mode always appropriate
Mean never appropriate
Summary Statistics
describe data in just 2 numbers

Measures of variability
Measures of central tendency typical average variation
typical average score
1. Range: distance from lowest to highest (use 2 data points)
2. Variance: (use all data points)
3. Standard Deviation
4. Standard Error of the Mean
Inferential Statistics
Used to draw conclusions about a population by examining the sample

Accuracy of inference depends on representativeness of sample from population

Random selection
Equal chance for anyone to be selected makes sample more representative

It help test hypotheses, answer research questions and derive meaning from the results

Inferential statistics test the likelihood that the alternative (research) hypothesis (H1) is true
and the null hypothesis (H0) is not
Steps in Inferential Statistics
State Hypothesis

Ho: no difference between 2 means; any difference found is due to sampling error
Results stated in terms of probability that Ho is false

Level of Significance
Probability that sample means are different enough to reject Ho (.05 or .01)

Computing Calculated Value


Use statistical test to derive some calculated value (e.g., t value or F value)

Obtain Critical Value


A criterion used based on df and alpha level (.05 or .01) is compared to the calculated value to
determine if findings are significant and therefore reject Ho
Steps in Inferential Statistics
Reject or Fail to Reject Ho
CALCULATED value is compared to the CRITICAL value to determine if the difference is
significant enough to reject Ho at the predetermined level of significance
If CRITICAL value > CALCULATED value --> fail to reject Ho

If CRITICAL value < CALCULATED value --> reject Ho

If reject Ho, only supports H1; it does not prove H1


Parametric Vs. Non Parametric Tests
Parametric test
Hypothesis test which provides generalizations for making statements about mean of parent population
Rests on assumption that variable is normally distributed and mean in known or assumed to be known
The population variance is calculated for the sample.
It is assumed that the variables of interest, in the population are measured on an interval scale.
Nonparametric test
Hypothesis test which does not require populations distribution to be denoted by specific parameters
The test is mainly based on differences in medians.
Hence, it is alternately known as the distribution-free test.
Test assumes that variables are measured on a nominal or ordinal level
It is used when the independent variables are non-metric.
Parametric Vs. Non Parametric Tests
A statistical test, with specific assumptions A statistical test in the case of non-metric
about population parameter is known as independent variables is called nonparametric
parametric test. test.

In parametric test, the test statistic is based on In nonparametric test, the test statistic is
distribution. arbitrary and not based on any distribution.

In the parametric test, it is assumed that the In nonparametric test, it is assumed that the
measurement of variables of interest is done variable of interest are measured on nominal
on interval or ratio level. or ordinal scale.

In general, the measure of central tendency in In the case of the nonparametric test the
the parametric test is mean measure of central tendency is median.
Parametric Vs. Non Parametric Tests
In parametric test, there is complete Conversely, in the nonparametric test, there is
information about the population no information about the population.

The applicability of parametric test is for Nonparametric test applies to both variables
variables only and attributes

For measuring the degree of association For measuring the degree of association
between two quantitative variables, Pearsons between two quantitative variables,
coefficient of correlation is used in the spearmans rank correlation is used in the
parametric test nonparametric test.
Error in Hypothesis Testing
Type I error: The null hypothesis is
Truth rejected when it is true.
Null Alternative
Decision Type II error: The null hypothesis is not
hypothesis hypothesis
Do not reject TYPE II rejected when it is false.
OK
null ERROR
TYPE I There is always a chance of making one of
Reject null OK
ERROR
these errors. Well want to minimize the
chance of doing so!
Parametric Vs. Non Parametric Tests
Parametric Vs. Non Parametric Tests
Identifying the Appropriate Statistical Test of Difference
One variable One-way chi-square

Two variables
t-test
(1 IV with 2 levels; 1 DV)

Two variables
ANOVA
(1 IV with 2+ levels; 1 DV)

Three or more variables ANOVA


Review: Standardization
Allows us to easily see how one score (or sample) compares with all other scores
(or a population).
Z Test Example
Reshma is 15 years old and 66.41 in. tall
For 15 year old girls, = 63.8, = 2.66

z
X

(66.41 63.8)
0.98
2.66
Z Test Example
1. Percentile: How many 15 year old girls are shorter than Reshma?
50% + 33.65% = 83.65%
Z Test Example
2. What percentage of 15 year old girls are taller than Reshma?
50% - 33.65% OR 100% - 83.65% = 16.35%
Z Test Example
3. What percentage of 15 year old girls are as far from the mean as Reshma (tall
or short)?
16.35 % + 16.35% = 32.7%
Z Test Example 2
Manu is 15 years old and 61.2 in. tall
For 15 year old boys, = 67, = 3.19

z
X

(61.2 67)
1.82
3.19

Consult z table for 1.82 46.56%


Z Test Example
1. Percentile
Negative z, below mean: 50% - 46.56% = 3.44%
Z Test Example 2
2. Percent Above Manu
100% - 3.44% = 96.56 %
Z Test Example
3. Percent as extreme as Manu
3.44% + 3.44% = 6.88%
Percentages to z Scores
MAT Example: = 500, = 100
You find out you are at 63rd percentile
Consult z table for 13%
THIS z Table lists the percentage under the normal
curve, between the mean (center of distribution)
and the z statistic.

63rd Percentile = 63%

50% + 13%

z= ?_
t - Test
The t-test is used to test hypotheses about means when the population variance is
unknown (the usual case).

Closely related to z, the unit normal.

Developed by Gossett for the quality control of beer.

Comes in 3 varieties:
Single sample, independent samples, and dependent samples.
t - Test
Single sample t we have only 1 group; want to test against a hypothetical mean.

Independent samples t we have 2 means, 2 groups; no relation between groups,


e.g., people randomly assigned to a single group.

Dependent t we have two means. Either same people in both groups, or people
are related, e.g., husband-wife, left hand-right hand, hospital patient and visitor.
The t Distribution
We use t when the population variance is unknown (usual case) and sample size is small (N<100,
usual case). If you use a stat package for testing hypotheses about means, you will use t.

The t distribution is a short, fat relative of the normal. The shape of t depends on its df. As N
becomes infinitely large, t becomes normal.
Single-sample z test
For large samples (N>100) can use z to test hypotheses about means.
( X ) ( X X ) 2

zM sX N 1
est. M est. M
N

N
Suppose
H 0 : 10; H1 : 10; s X 5; N 200
Then
sX 5 5
est. M .35
N 200 14.14
If
(11 10)
X 11 z 2.83; 2.83 1.96 p .05
.35
Single-sample t-test
With a small sample size, we compute the same numbers as we did for z, but we
compare them to the t distribution instead of the z distribution.
H 0 : 10; H1 : 10; s X 5; N 25
sX 5 (11 10)
est. M 1 X 11 t 1
N 25 1

t (.05,24) 2.064 (c.f. z=1.96) 1<2.064, n.s.

Interval = X t M
11 2.064(1) [8.936, 13.064]
Interval is about 9 to 13 and contains 10, so n.s.
The basic ANOVA situation
Two variables: 1 Categorical, 1 Quantitative

Main Question: Do the (means of) the quantitative variables depend on which
group (given by categorical variable) the individual is in?

If categorical variable has only 2 values:


2-sample t-test

ANOVA allows for 3 or more groups


ANOVA
Subjects: 25 patients with blisters
Treatments: Treatment A, Treatment B, Placebo
Measurement: # of days until blisters heal
Data [and means]:
A: 5,6,6,7,7,8,9,10 [7.25]
B: 7,7,8,9,9,10,10,11 [8.875]
P: 7,9,9,10,10,10,11,12,13 [10.11]
Are these differences significant?
Informal Investigation
Graphical investigation:
Side-by-side box plots
13
Multiple histograms 12

Whether the differences between the groups 11

10
are significant depends on

days
9

The difference in the means 8

7
The standard deviations of each group
6

The sample sizes 5

ANOVA determines P-value from the F statistic A B P


treatment
What ANOVA does?
At its simplest (there are extensions) ANOVA tests the following hypotheses:
H0: The means of all the groups are equal.

Ha: Not all the means are equal

Doesnt say how or which ones differ.

Can follow up with multiple comparisons

Note: we usually refer to the sub-populations as groups when doing ANOVA.


Assumptions of ANOVA
Each group is approximately normal
Check this by looking at histograms and/or normal quantile plots, or use assumptions

Can handle some non-normality, but not severe outliers

Standard deviations of each group are approximately equal


Rule of thumb: ratio of largest to smallest sample st. dev. must be less than 2:1
How ANOVA works (outline)
ANOVA measures two sources of variation in the data and compares their relative sizes
Variation BETWEEN groups

for each data value look at the difference between its group mean and the overall mean

x i x
2

Variation WITHIN groups

for each data value we look at the difference between that value and the mean of its group

x ij xi
2
How ANOVA works
The ANOVA F-statistic is a ratio of the Between Group Variation divided by the Within
Group Variation:

Between MSG
F
Within MSE
A large F is evidence against H0, since it indicates that there is more difference between
groups than within groups.
An even smaller example
Suppose we have three groups
Group 1: 5.3, 6.0, 6.7
Group 2: 5.5, 6.2, 6.4, 5.7
Group 3: 7.5, 7.2, 7.9

We get the following statistics:


Excel ANOVA Output
ANOVA
Source of Variation SS df MS F P-value F crit
Between Groups 5.127333 2 2.563667 10.21575 0.008394 4.737416
Within Groups 1.756667 7 0.250952

Total 6.884 9

1 less than number of number of data values - number of


groups groups
(equals df for each group added
1 less than number of individuals together)
(just like other situations)
Computing ANOVA F statistic
WITHIN BETWEEN
difference: difference
group data - group mean group mean - overall mean
data group mean plain squared plain squared
5.3 1 6.00 -0.70 0.490 -0.4 0.194
6.0 1 6.00 0.00 0.000 -0.4 0.194
6.7 1 6.00 0.70 0.490 -0.4 0.194
5.5 2 5.95 -0.45 0.203 -0.5 0.240
6.2 2 5.95 0.25 0.063 -0.5 0.240
6.4 2 5.95 0.45 0.203 -0.5 0.240
5.7 2 5.95 -0.25 0.063 -0.5 0.240
7.5 3 7.53 -0.03 0.001 1.1 1.188
7.2 3 7.53 -0.33 0.109 1.1 1.188
7.9 3 7.53 0.37 0.137 1.1 1.188
TOTAL 1.757 5.106
TOTAL/df 0.25095714 2.55275
overall mean: 6.44 F = 2.5528/0.25025 = 10.21575
ANOVA
Core component of all 4 is the ANOVA.
ANOVA tests 3 or more groups for mean
differences based on a continuous (i.e.
scale or interval) response variable (
dependent)
Factor" refers to variable that
distinguishes this group membership.
Race, level of education, and treatment condition
are examples of factors.
Types of ANOVA
"one-way" ANOVA compares levels (i.e. groups)
of a 1 factor based on 1 continuous response
(e.g. comparing test score by 'level of edu.)

"two-way" ANOVA compares levels of 2 or more


factors for mean differences on a 1 continuous
response variable(e.g. comparing test score by
both 'level of education' and 'zodiac sign').

In practice, one-way ANOVAs is used more often


One Way ANCOVA (Analysis of Covariance)
One-way ANCOVA can be thought of as an extension of one-way ANOVA to incorporate a covariate.

Like one-way ANOVA, one-way ANCOVA is used to determine whether there are any significant
differences between two or more independent (unrelated) groups on a dependent variable.

However, instead of differences in the group means, ANCOVA looks for differences in adjusted means
(i.e., adjusted for the covariate).

One-way ANCOVA has the additional benefit of "statistically controlling" for a third variable
(sometimes known as a "confounding variable"), which is believed to affect results.

The third variable that could confound results is called covariate


One Way ANCOVA (Analysis of Covariance)
Like ANOVA, "Analysis of Covariance"
(ANCOVA) has a single continuous response
variable.

Unlike ANOVA, ANCOVA compares a response


variable by both a factor and a continuous
independent variable (e.g. comparing test
score by both 'level of education' and 'number
of hours spent studying').

The term for the continuous independent


variable (IV) used in ANCOVA is "covariate".
One Way ANCOVA (Analysis of
Covariance)
ANCOVA is also used in analyses with a single response variable, continuous IVs, and no factors.

Such an analysis is also known as a regression.

In fact, you can get almost identical results in SPSS by conducting this analysis using either the
"Analyze > Regression > Linear" dialog menus or the "Analze > General Linear Model (GLM) >
Univariate" dialog menus.

A key (but not only) difference in these methods is that you get slightly different output tables.

Also, regression requires that user dummy code factors, while GLM handles dummy coding through
the "contrasts" option. The linear regression command in SPSS also allows for variable entry in
hierarchical blocks (i.e. stages).
One way MANOVA (Multivariate analysis of
Variance )
One-way MANOVA is used to determine if there are any differences between independent
groups on more than one continuous dependent variable.
It differs from one-way ANOVA, which only measures one dependent variable
In basic terms, A MANOVA is an ANOVA with two or more continuous response variables.
If there are two independent variables rather than one, a two-way MANOVA is used
One-way MANOVA is an omnibus test statistic and cannot tell you which specific groups
were significantly different from each other
Post-hoc test have to be carried out to test which of these groups are significant
One way MANOVA (Multivariate analysis
of Variance )
SEM (Structural Equation Modeling )
SEM is a very general statistical modeling technique widely used in behavioral science

which can be viewed as a combination of factor analysis, regression and path analysis

It can be often visualized as a graphical path diagram


A path diagram consists of Boxes and circles which are connected by arrows
Observed (measured) variables are represented in a rectangular/square box and Latent
(unmeasured) variables are represented in circles / ellipse
Single headed arrows paths define causal relationships variable at tail causing variable at point
Double headed arrows indicate correlation without causation
Single headed arrows represent regression coefficients, double headed arrows represent
covariance
SEM (Structural Equation Modeling )
Session III
Correlation & Regression

Multivariate analysis

Dependency techniques
Multiple regression
Discriminant analysis
Conjoint analysis

Inter-dependency techniques
Factor Analysis
Cluster Analysis
Correlation
Pearson correlation is a measure of strength and direction of association that exists
between two variables measured on at least an interval scale.

It attempts to draw a line of best fit through data of two variables, and Pearson correlation
r, indicates how far away all data points are from this line of best fit

Determine if there is linear component of association between 2 continuous variables.

As such, linearity is not actually an assumption of Pearson's correlation


Correlation
Regression
Linear regression is the next step up after correlation.
Used when we want to predict value of a variable based on the value of another variable.
Variable we want to predict is called dependent variable (outcome variable)
Variable we are using to predict the other variable's value is called independent variable
(predictor variable)
Multiple Regression
Multiple regression is an extension of simple linear regression.

Used to predict the value of a variable based on the value of two or more other variables.

Variable to predict is called dependent variable (the outcome, target or criterion variable).

Variables to predict the value of dependent variable are called the independent variables

(the predictor, explanatory or regressor variables).

Multiple regression also allows to determine overall fit (variance explained) of the model

and the relative contribution of each of the predictors to the total variance explained.
Interpreting Result
Form of the equation to predict VO2max from Age, Weight, Heart_rate, Gender, is:

VO2max = 87.83 (0.165 x age) (0.385 x weight) (0.118 x heart_rate) + (13.208 x gender)
Interpreting Result
Discriminant Analysis
Linear discriminant function analysis (i.e., discriminant analysis) performs a multivariate
test of differences between groups.
In addition, discriminant analysis is used to determine the minimum number of dimensions
needed to describe these differences.
It builds a predictive model for group membership
The model is composed of a discriminant function based on linear combinations of
predictor variables.
Those predictor variables provide the best discrimination between groups
Conjoint Analysis
Used to study factors that influence customers, A numerical part-worth utility value is
purchasing decisions computed for each level of each attribute.
Products possess attributes such as price, color, Large part-worth utilities are assigned to most
ingredients, guarantee, environmental impact, preferred levels, and small part-worth utilities
predicted reliability and so on. are assigned to the least preferred levels.
Subjects provide data on preferences for The attributes with the largest part-worth
hypothetical products defined by attribute utility range are considered the most
combinations. important in predicting preference.
Conjoint analysis decomposes the judgment Conjoint analysis is a statistical model with an
data into components, based on qualitative error term and a loss function.
attributes of the products.
Factor Analysis
A class of procedures used for data Problem formulation

reduction and summarization. Construction of the Correlation Matrix


An interdependence technique: no
Method of Factor Analysis
dependent and independent variables
Determination of Number of Factors
Factor analysis is used:
To identify underlying dimensions / factors, Rotation of Factors
that explain correlations among variables.
Interpretation of Factors
To identify a new, smaller, set of
uncorrelated variables to replace the Calculation of Factor Scores

original set of correlated variables.


Determination of Model Fit
Market Segmentation - Clustering
Classify objects/cases into relatively homogeneous groups called clusters

Objects in a cluster are similar but dissimilar to objects in other clusters

Cluster analysis and Discriminant analysis are concerned with classification

However, DA requires a priori cluster membership for classification rule

Statistical Terms
Hierarchical clustering

Cluster centroid and Cluster centers

Cluster membership

Dendogram
A Dendogram
Session II
Non parametric test for
Hypothesis Testing
Run test for randomness

Sign test

Chi-Square

Mann-Whitney U test

Wilcoxon signed-rank test

Kruskal-Wallis test
Non Parametric Tests
They are also called distribution free tests
The popular tests are
One sample run test, a method for determining randomness
Sign test for paired data where positive and negative signs are substituted for
quantitative values
Rank sum test, also called Mann Whitney U Test, which can be used to determine if two
independent samples have been drawn from same population.
Kruskal Wallis test, another rank sum test which generalizes the Analysis of Variance
Advantages and Disadvantages
They do not require us to make They ignore a certain amount of
assumption that the population is information
normally distributed They are often not as efficient or sharp
Generally, they are easier to do and to as parametric tests
understand

Sometimes even formal ordering or


ranking is not required
Run Test
To test whether the distribution functions F(x) and G(y) of two continuous random variables X
and Y, respectively, are equal.
H0:F(z)=G(z)

Note that other than the requirement that the random variables be continuous, no other
conditions about the distributions must be met in order for the Run Test to be an appropriate
test.

we have n1 observations of the random variable X, and n2 observations of the random variable Y.

Suppose we combine the two sets of independent observations into one larger collection of n1 +
n2 observations, and then arrange the observations in increasing order of magnitude.
Example
A charter bus line has 48-passenger buses and 38-passenger buses. With X and Y denoting
the number of miles traveled per day for the 48-passenger and 38-passenger buses,
respectively, the bus company is interested in testing the equality of the two distributions
The company observed the following data on a random sample of n1 = 10 buses holding 48
passengers and n2 = 11 buses holding 38 passengers:
Sign test
Tests one population median, (eta) P(X)
30% .273
.219 .219
Corresponds to t-test for one mean 20%
.109 .109
Assumes population is continuous 10%
.031 .031
.004 .004
0%
Small sample test statistic: Number of
0 1 2 3 4 5 6 7 8 X
sample values above (or below) median Sign Test Uses p-Value to Make Decision
Can use normal approximation if n 30 P-value is the probability of getting an observation at
least as extreme as we got.
One sample sign test
One-Tailed Test Let pH0 = qH0 = 0.5
H0: = 0 N=30
Ha: > 0 [or Ha: < 0 ] Pbar = 0.633 and Pbar = .367
Test statistic: Then Pbar = sqrt (p.q/n)
S = No. of sample measurements > than 0 = sqrt (.5*.5 / 30) = 0.091
[or S = no. of measurements less than 0]
Z = (0.633 0.5) / 0.091 = 1.462 < 1.96
Observed sig. level: p-value = 2P(x S) This lies in the acceptance region and so
where x has a binomial distribution with at = .05, we cannt reject H0
parameters n and p = .5

Rejection region: Reject H0 if p-value .05


Mann-Whitney U test
n1 n1 1
Used to compare differences between
U 1 n1 n2 R1
two independent groups when dependent 2

variable is either ordinal or continuous,


n2 n2 1
but not normally distributed. U 2 n1 n2 R2
2
The Mann-Whitney U test is often Evaluation of Mann Whitney U
considered the nonparametric alternative Choose the smaller of the two U values.
to the independent t-test. Find the critical value (Mann Whitney table)

When computed value is smaller than the critical


value the outcome is significant!
Mann-Whitney U test
n1 n1 1 n2 n2 1
U 2 n1 n2 R2
group 1 group 2
U 1 n1 n2 R1 2
24 28 2

18 42 6 7 6 7
U 1 6 6 26.5 U 2 6 6 515
.
45 63 2 2

57 57 U 2 36 21 515
U 1 36 21 26.5 .
12 90
30 68 U 1 30.5 U 2 55
.
U 1 30.5
Critical Value = 5
U 2 55
. So, This is a nonsignificant outcome

5.5 30.5

U 55
.
Kruskal-Wallis test
The Kruskal-Wallis H test (also called the "one-way ANOVA on ranks")
It is a rank-based nonparametric test, used to determine if there are statistically significant
differences between two or more groups of an independent variable on a continuous or
ordinal dependent variable.
Data need not be normally distributed
It is considered the nonparametric alternative to the one-way ANOVA, and an extension of
the Mann-Whitney U test to allow comparison of more than two independent groups.
Kruskal-Wallis H test is an omnibus test statistic and cannot tell you which specific groups of
your independent variable are statistically significantly different
Kruskal-Wallis test
Rank the total measurements in all k H0: the k distributions are identical versus
samples from 1 to n. Ha: at least one distribution is different
Tied observations are assigned average of Test statistic: Kruskal-Wallis H
ranks they would have gotten if not tied.
When H0 is true, the test statistic H has an
Calculate approximate chi-square distribution with df
Ti = rank sum for the ith sample i = 1, 2,,k = k-1.
And the test statistic Use a right-tailed rejection region or p-value
12 Ti 2 based on the Chi-square distribution.
H 3(n 1)
n(n 1) ni
Example
Four groups of students were randomly assigned to H0: the distributions of scores are the same

be taught with four different techniques, and their Ha: the distributions differ in location

achievement test scores were recorded. Are the 12 Ti 2


Test statistic: H 3(n 1)
distributions of test scores the same, or do they n(n 1) ni
differ in location? 12 312 352 152 552
3(17) 8.96
16(17) 4
1 2 3 4 A B C D
(3) (7) (1) (16)
65 75 59 94
(13) (5) (8) (15) Rejection region: For a right-tailed chi-square test
87 69 78 89
(6) (12) (4) (10) with = .05 and df = 4-1 =3, reject H0 if H 7.81.
73 83 67 80 (9) (11) (2) (14)
So Reject H0
79 81 62 88 Ti 31 35 15 55
Chi Square
The chi-square test for goodness of fit and the Let
chi-square test for independence. O = observed count and

Test statistic is based on counts that represent E = Expected count

the number of items that fall in each category

Test statistics measures the agreement


2 (O E )2
between actual counts and expected counts
E
assuming the null hypothesis

The chi-square distribution can be used to see


whether or not an observed counts agree with
an expected counts.
Example: Are Coins Biased
Observed Expected 2 statistic formula

Frequency Frequency
( O E )2

2

E
( 40 50 )2 ( 60 50 )2

H 40 50 50 50
( 10 )2 (10 )2 100 100
T 60 50
50 50 50 50
22
4
sum 100 100
degrees of freedom = (R 1)(C 1)
R = number of rows
C = number of columns
Title
Chi Square is a test of significance based on
bivariate tables
Rows Columns Total
Columns are scores of the independent
variable.
Row 1 cell a cell b Row
There will be as many columns as there are scores Marginal 1

on the independent variable. Row 2 cell c cell d Row


Marginal 2
Rows are scores of the dependent variable.
Total Column Column N
There will be as many rows as there are scores on Marginal 1 Marginal 2
the dependent variable.
Are the homicide rate and volume of H0: The variables are independent
gun sales related for a sample of 25 You can also say: H0: fo = fe
cities? H1: The variables are dependent
GUN Or: H1: fo fe
Low High Totals
SALES
Alpha = .05
High 8 5 13
df = (r-1)(c-1) = 1
Low 4 8 12 2 (critical) = 3.841

Totals 12 13 N = 25 ( fo fe )2
2 (calcilated) f
e
To find fe = row marginal column marginal
N GUN
Multiply column and row marginals for each Low High Total
SALES
cell and divide by N.
fo = 8 fo = 5
High 13
(13*12)/25 = 156/25 = 6.24 fe = 6.24 fe = 6.76
(13*13)/25 = 169/25 = 6.76 fo = 4 fo = 8
Low 12
(12*12)/25 = 144/25 = 5.76 fe = 5.76 fe = 6.24

(12*13)/25 = 156/25 = 6.24 Total 12 13 N = 25


fo fe fo - fe (fo - fe)2 (fo - fe)2 /fe 2 (critical) = 3.841

8 6.24 1.76 3.10 .50 2 (obtained) = 2.00

The test statistic is not in the Critical Region. Fail


5 6.76 -1.76 3.10 .46
to reject the H0.
4 5.76 -1.76 3.10 .54
There is no significant relationship between
8 6.24 1.76 3.10 .50 homicide rate and gun sales.
Total
25 0 2 = 2.00
25
Wilcoxon signed-rank test
T-test used to test whether mean of a Frank Wilcoxon was Chemist in USA who
sample is significantly different from a wanted to develop test similar to t-test
hypothesised sample mean but without requirement of Normal

T-test relies on the sample being drawn distribution

from a normally distributed population Wilcoxon Signed Rank paired t-test

If sample not Normal then use Wilcoxon Wilcoxon Rank Sum independent t-test
Signed Rank Test as an alternative
Wilcoxon signed-rank test
NP test relating to the median as measure As the number of ranks (n) becomes
of central tendency larger, the distribution of W becomes
Ranks of absolute differences between approximately Normal
the data and hypothesised median
Generally, if n>20
calculated
Mean W=n(n+1)/4
Ranks for negative and positive
Variance W=n(n+1)(2n+1)/24
differences are then summed separately
Z=(W-mean W)/SD(W)
(W- & W+ resp.)

Minimum of these is test statistic, W


Wilcoxon signed-rank test
A group of 10 patients with chronic QoL Score
Before After Diff Rank -/+
anxiety receive sessions of cognitive 6 9 3 5.5 +
therapy. 5 12 7 10 +
3 9 6 9 +
Quality of Life scores are measured before 4 9 5 8 +
and after therapy. 2 3 1 4 +
1 1 0 3 tied
W=2 3 2 -1 2 -
Mean W = 27.5 8 12 4 7 +
6 9 3 5.5 +
Var W = 96.26
12 10 -2 1 -
Z= (2-27.5)/9.81 = 0.2649
W- = 2 ; W+ = 7 ; 1 tied
Semester End

Thank You!

Вам также может понравиться