Date post: | 13-Jan-2016 |
Category: |
Documents |
Upload: | bernadette-gibson |
View: | 221 times |
Download: | 3 times |
UNIT 4-A: DATA ANALYSIS and REPORTING
1. Frequency Distribution2. Cross Tabulation3. Hypothesis Testing
GM07: RESEARCH METHODOLOGY
• Data in raw form (as collected): 24, 26, 24, 21, 27, 27, 30, 41, 32, 38
• Data in ordered array from smallest to largest: 21, 24, 24, 26, 27, 27, 30, 32, 38, 41
• Stem-and-leaf display:
Organizing Numerical Data
2 144677
3 028
4 1
Frequency Distribution
• In a frequency distribution, one variable is considered at a time.
• A frequency distribution for a variable produces a table of frequency counts, percentages, and cumulative percentages for all the values associated with that variable.
Organizing Numerical Data
0
1
2
3
4
5
6
7
10 20 30 40 50 60
Numerical Data
Ordered Array
Stem and LeafDisplay
Histograms Ogive
Tables
2 144677
3 028
4 1
41, 24, 32, 26, 27, 27, 30, 24, 38, 21
21, 24, 24, 26, 27, 27, 30, 32, 38, 41
Frequency DistributionsCumulative Distributions
Polygons
O g ive
0
20
40
60
80
100
120
10 20 30 40 50 60
Tabulating Numerical Data: Frequency Distributions
• Sort raw data in ascending order:12, 13, 17, 21, 24, 24, 26, 27, 27, 30, 32, 35, 37, 38, 41, 43, 44, 46, 53, 58
• Find range: 58 - 12 = 46• Select number of classes: 5 (usually between 5 and 15)• Compute class interval (width): 10 (46/5 then round up)
• Determine class boundaries (limits): 10, 20, 30, 40, 50, 60
• Compute class midpoints: 15, 25, 35, 45, 55
• Count observations & assign to classes
Frequency Distributions, Relative Frequency Distributions and Percentage Distributions
Class Frequency
10 but under 20 3 .15 15
20 but under 30 6 .30 30
30 but under 40 5 .25 25
40 but under 50 4 .20 20
50 but under 60 2 .10 10
Total 20 1 100
RelativeFrequency
Percentage
Data in ordered array:12, 13, 17, 21, 24, 24, 26, 27, 27, 30, 32, 35, 37, 38, 41, 43, 44, 46, 53, 58
Graphing Numerical Data: The Histogram
Histogram
0
3
65
4
2
001234567
5 15 25 36 45 55 More
Fre
qu
en
cy
Data in ordered array:12, 13, 17, 21, 24, 24, 26, 27, 27, 30, 32, 35, 37, 38, 41, 43, 44, 46, 53, 58
No Gaps Between
Bars
Class MidpointsClass Boundaries
Graphing Numerical Data: The Frequency Polygon
Frequency
0
1
2
3
4
5
6
7
5 15 25 36 45 55 More
Class Midpoints
Data in ordered array:12, 13, 17, 21, 24, 24, 26, 27, 27, 30, 32, 35, 37, 38, 41, 43, 44, 46, 53, 58
Tabulating Numerical Data: Cumulative Frequency
Cumulative CumulativeClass Frequency % Frequency
10 but under 20 3 15
20 but under 30 9 45
30 but under 40 14 70
40 but under 50 18 90
50 but under 60 20 100
Data in ordered array:12, 13, 17, 21, 24, 24, 26, 27, 27, 30, 32, 35, 37, 38, 41, 43, 44, 46, 53, 58
Graphing Numerical Data: The Ogive (Cumulative % Polygon)
Ogive
0
20
40
60
80
100
10 20 30 40 50 60
Class Boundaries (Not Midpoints)
Data in ordered array:12, 13, 17, 21, 24, 24, 26, 27, 27, 30, 32, 35, 37, 38, 41, 43, 44, 46, 53, 58
Graphing Bivariate Numerical Data (Scatter Plot)
Mutual Funds Scatter Plot
0
10
20
30
40
0 10 20 30 40
Net Asset Values
Tota
l Yea
r to
D
ate
Ret
urn
(%)
Tabulating and Graphing Categorical Data:Univariate Data
Categorical Data
Tabulating Data
The Summary Table
Graphing Data
Pie Charts
Pareto DiagramBar Charts
Summary Table(for an Investor’s Portfolio)
Investment Category Amount Percentage (in thousands )
Stocks 46.5 42.27
Bonds 32 29.09
CD 15.5 14.09
Savings 16 14.55
Total 110 100
Variables are Categorical
Graphing Categorical Data: Univariate Data
Categorical Data
Tabulating Data
The Summary Table
0 1 0 2 0 3 0 4 0 5 0
S to c k s
B o n d s
S a vin g s
C D
Graphing Data
Pie Charts
Pareto DiagramBar Charts
0
5
1 0
1 5
2 0
2 5
3 0
3 5
4 0
4 5
S to c k s B o n d s S a vin g s C D
0
2 0
4 0
6 0
8 0
1 0 0
1 2 0
Bar Chart(for an Investor’s Portfolio)
Investor's Portfolio
0 10 20 30 40 50
Stocks
Bonds
CD
Savings
Amount in K$
Pie Chart (for an Investor’s Portfolio)
Percentages are rounded to the nearest percent.
Amount Invested in K$
Savings
15%
CD 14%
Bonds
29%
Stocks
42%
Pareto Diagram
Axis for line graph shows
cumulative % invested
Axis for bar
chart shows
% invested in each
category
0%
5%
10%
15%
20%
25%
30%
35%
40%
45%
Stocks Bonds Savings CD
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
Tabulating and Graphing Bivariate Categorical Data
• Contingency tables: investment in thousands
Investment Investor A Investor B Investor C Total Category
Stocks 46.5 55 27.5 129
Bonds 32 44 19 95
CD 15.5 20 13.5 49
Savings 16 28 7 51
Total 110 147 67 324
Tabulating and Graphing Bivariate Categorical Data
• Side by side chartsComparing Investors
0 10 20 30 40 50 60
S toc k s
B onds
CD
S avings
Inves tor A Inves tor B Inves tor C
Principles of Graphical Excellence
• Presents data in a way that provides substance, statistics and design
• Communicates complex ideas with clarity, precision and efficiency
• Gives the largest number of ideas in the most efficient manner
• Almost always involves several dimensions• Tells the truth about the data
“Chart Junk”
Good Presentation
1960: $1.00
1970: $1.60
1980: $3.10
1990: $3.80
Minimum Wage Minimum Wage
0
2
4
1960 1970 1980 1990
$
Bad Presentation
No Relative Basis
Good PresentationA’s received by
students.A’s received by
students.
Bad Presentation
0
200
300
FR SO JR SR
Freq.
10
30
FR SO JR SR
%
FR = Freshmen, SO = Sophomore, JR = Junior, SR = Senior
Compressing Vertical Axis
Good Presentation
Quarterly Sales Quarterly Sales
Bad Presentation
0
25
50
Q1 Q2 Q3 Q4
$
0
100
200
Q1 Q2 Q3 Q4
$
No Zero Point on Vertical Axis
Good Presentation
Monthly SalesMonthly Sales
Bad Presentation
0
39
42
45
J F M A M J
$
36
39
42
45
J F M A M J
$
Graphing the first six months of sales.
36
Statistics for Frequency Distribution• Measures of central tendency
– Mean, median, mode, geometric mean• Quartile• Measure of variation
– Range, Interquartile range, variance and standard deviation, coefficient of variation
• Measure of Shape– Symmetric, skewed, using box-and-whisker plots
Measures of Central Tendency
Central Tendency
Average Median Mode
Geometric Mean1
1
n
ii
N
ii
XX
n
X
N
1/
1 2
n
G nX X X X
Mean (Arithmetic Mean)
• Mean (arithmetic mean) of data values– Sample mean
– Population mean
1 1 2
n
ii n
XX X X
Xn n
1 1 2
N
ii N
XX X X
N N
Sample Size
Population Size
Mean (Arithmetic Mean)
• The most common measure of central tendency
• Affected by extreme values (outliers)
(continued)
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 12 14
Mean = 5 Mean = 6
Median
• Robust measure of central tendency• Not affected by extreme values
• In an ordered array, the median is the “middle” number– If n or N is odd, the median is the middle number– If n or N is even, the median is the average of the two
middle numbers
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10 12 14
Median = 5 Median = 5
Mode• A measure of central tendency• Value that occurs most often• Not affected by extreme values• Used for either numerical or categorical data• There may be no mode• There may be several modes
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
Mode = 9
0 1 2 3 4 5 6
No Mode
Geometric Mean
• Useful in the measure of rate of change of a variable over time
• Geometric mean rate of return– Measures the status of an investment over time
1/
1 2
n
G nX X X X
1/
1 21 1 1 1n
G nR R R R
Quartiles
• Split Ordered Data into 4 Quarters
• Position of i-th Quartile
• and Are Measures of Noncentral Location• = Median, A Measure of Central Tendency
25% 25% 25% 25%
1Q 2Q 3Q
Data in Ordered Array: 11 12 13 16 16 17 18 21 22
1 1
1 9 1 12 13Position of 2.5 12.5
4 2Q Q
1Q 3Q
2Q
1
4i
i nQ
Measures of Variation
Variation
Variance Standard Deviation Coefficient of Variation
PopulationVariance
Sample
Variance
PopulationStandardDeviationSample
Standard
Deviation
Range
Interquartile Range
Range
• Measure of variation• Difference between the largest and the smallest
observations:
• Ignores the way in which data are distributed
Largest SmallestRange X X
7 8 9 10 11 12
Range = 12 - 7 = 5
7 8 9 10 11 12
Range = 12 - 7 = 5
• Measure of variation• Also known as midspread
– Spread in the middle 50%
• Difference between the first and third quartiles
• Not affected by extreme values3 1Interquartile Range 17.5 12.5 5Q Q
Interquartile Range
Data in Ordered Array: 11 12 13 16 16 17 17 18 21
2
2 1
N
ii
X
N
• Important measure of variation• Shows variation about the mean
– Sample variance:
– Population variance:
2
2 1
1
n
ii
X XS
n
Variance
Standard Deviation
• Most important measure of variation• Shows variation about the mean• Has the same units as the original data
– Sample standard deviation:
– Population standard deviation:
2
1
1
n
ii
X XS
n
2
1
N
ii
X
N
Comparing Standard Deviations
Mean = 15.5 s = 3.338 11 12 13 14 15 16 17 18 19 20 21
11 12 13 14 15 16 17 18 19 20 21
Data B
Data A
Mean = 15.5 s = .9258
11 12 13 14 15 16 17 18 19 20 21
Mean = 15.5 s = 4.57
Data C
Coefficient of Variation
• Measures relative variation
• Always in percentage (%)
• Shows variation relative to mean
• Is used to compare two or more sets of data measured in different units
• 100%S
CVX
Comparing Coefficient of Variation
• Stock A:– Average price last year = $50– Standard deviation = $5
• Stock B:– Average price last year = $100– Standard deviation = $5
• Coefficient of variation:– Stock A:
– Stock B:
$5100% 100% 10%
$50
SCV
X
$5100% 100% 5%
$100
SCV
X
Shape of a Distribution
• Describes how data is distributed• Measures of shape
– Symmetric or skewed
Mean = Median =Mode Mean < Median < Mode Mode < Median < Mean
Right-SkewedLeft-Skewed Symmetric
Exploratory Data Analysis
• Box-and-whisker plot– Graphical display of data using 5-number summary
Median( )
4 6 8 10 12
XlargestXsmallest1Q 3Q
2Q
Distribution Shape and Box-and-Whisker Plot
Right-SkewedLeft-Skewed Symmetric
1Q 1Q 1Q2Q 2Q 2Q3Q 3Q3Q
Cross-Tabulation• While a frequency distribution describes one variable at a
time, a cross-tabulation describes two or more variables simultaneously.
• Cross-tabulation results in tables that reflect the joint distribution of two or more variables with a limited number of categories or distinct values
Gender and Internet Usage
Gender
RowInternet Usage Male Female Total
Light (1) 5 10 15
Heavy (2) 10 5 15
Column Total 15 15
Two Variables Cross-Tabulation• Since two variables have been cross-classified,
percentages could be computed either columnwise, based on column totals, or rowwise, based on row totals .
• The general rule is to compute the percentages in the direction of the independent variable, across the dependent variable. The correct way of calculating percentages is as shown in next slide.
Internet Usage by Gender
Gender Internet Usage Male Female Light 33.3% 66.7% Heavy 66.7% 33.3% Column total 100% 100%
Gender by Internet Usage
Internet Usage Gender Light Heavy Total Male 33.3% 66.7% 100.0% Female 66.7% 33.3% 100.0%
Introduction of a Third Variable in Cross-Tabulation
Refined Association between the Two Variables
No Association between the Two Variables
No Change in the Initial Pattern
Some Association between the Two Variables
Some Association between the Two Variables
No Association between the Two Variables
Introduce a Third Variable
Introduce a Third Variable
Original Two Variables
The introduction of a third variable can result in four possibilities:• As can be seen from, 52% of unmarried respondents fell in the high-purchase
category, as opposed to 31% of the married respondents. Before concluding that unmarried respondents purchase more fashion clothing than those who are married, a third variable, the buyer's sex, was introduced into the analysis.
• As shown in the table, in the case of females, 60% of the unmarried fall in the high-purchase category, as compared to 25% of those who are married. On the other hand, the percentages are much closer for males, with 40% of the unmarried and 35% of the married falling in the high purchase category.
• Hence, the introduction of sex (third variable) has refined the relationship between marital status and purchase of fashion clothing (original variables). Unmarried respondents are more likely to fall in the high purchase category than married ones, and this effect is much more pronounced for females than for males.
Three Variables Cross-TabulationRefine an Initial Relationship
Purchase of Fashion Clothing by Marital Status
Purchase of Fashion
Current Marital Status
Clothing Married Unmarried
High 31% 52%
Low 69% 48%
Column 100% 100%
Number of respondents
700 300
Purchase of Fashion Clothing by Marital Status
Purchase of Fashion Clothing
Sex Male
Female
Married Not Married
Married Not Married
High 35% 40% 25% 60%
Low 65% 60% 75% 40%
Column totals
100% 100% 100% 100%
Number of cases
400 120 300 180
• Table shows that 32% of those with college degrees own an expensive automobile, as compared to 21% of those without college degrees. Realizing that income may also be a factor, the researcher decided to reexamine the relationship between education and ownership of expensive automobiles in light of income level.
• In Table, the percentages of those with and without college degrees who own expensive automobiles are the same for each of the income groups. When the data for the high income and low income groups are examined separately, the association between education and ownership of expensive automobiles disappears, indicating that the initial relationship observed between these two variables was spurious.
Three Variables Cross-Tabulation
Initial Relationship was Spurious
Ownership of Expensive Automobiles by Education Level
Own Expensive Automobile
Education
College Degree No College Degree
Yes
No
Column totals
Number of cases
32%
68%
100%
250
21%
79%
100%
750
Ownership of Expensive Automobiles by Education Level and Income Levels
Own Expensive Automobile
College Degree
No College Degree
College Degree
No College Degree
Yes 20% 20% 40% 40%
No 80% 80% 60% 60%
Column totals 100% 100% 100% 100%
Number of respondents
100 700 150 50
Low Income High Income
Income
• Table shows no association between desire to travel abroad and age. • When sex was introduced as the third variable, Table was obtained.
Among men, 60% of those under 45 indicated a desire to travel abroad, as compared to 40% of those 45 or older. The pattern was reversed for women, where 35% of those under 45 indicated a desire to travel abroad as opposed to 65% of those 45 or older.
• Since the association between desire to travel abroad and age runs in the opposite direction for males and females, the relationship between these two variables is masked when the data are aggregated across sex as in Table.
• But when the effect of sex is controlled, as in Table , the suppressed association between desire to travel abroad and age is revealed for the separate categories of males and females.
Three Variables Cross-TabulationReveal Suppressed Association
Desire to Travel Abroad by AgeDesire to Travel Abroad Age
Less than 45 45 or More
Yes 50% 50%
No 50% 50%
Column totals 100% 100%
Number of respondents 500 500
Desire to Travel Abroad by Age and Gender
• Consider the cross-tabulation of family size and the tendency to eat out frequently in fast-food restaurants as shown in Table . No association is observed.
• When income was introduced as a third variable in the analysis, Table was obtained. Again, no association was observed.
Three Variables Cross-TabulationsNo Change in Initial Relationship
Eating Frequently in Fast-Food Restaurants by Family Size
Eating Frequently in Fast Food-Restaurantsby Family Size and Income
• To determine whether a systematic association exists, the probability of obtaining a value of chi-square as large or larger than the one calculated from the cross-tabulation is estimated.
• An important characteristic of the chi-square statistic is the number of degrees of freedom (df) associated with it. That is, df = (r - 1) x (c -1).
• The null hypothesis (H0) of no association between the two variables will be rejected only when the calculated value of the test statistic is greater than the critical value of the chi-square distribution with the appropriate degrees of freedom, as shown.
Statistics Associated with Cross-Tabulation Chi-Square
• The phi coefficient ( ) is used as a measure of the strength of association in the special case of a table with two rows and two columns (a 2 x 2 table).
• The phi coefficient is proportional to the square root of the chi-square statistic
• It takes the value of 0 when there is no association, which would be indicated by a chi-square value of 0 as well. When the variables are perfectly associated, phi assumes the value of 1 and all the observations fall just on the main or minor diagonal.
Statistics Associated with Cross-Tabulation Phi Coefficient
= 2
n
• While the phi coefficient is specific to a 2 x 2 table, the contingency coefficient (C) can be used to assess the strength of association in a table of any size.
• The contingency coefficient varies between 0 and 1. • The maximum value of the contingency coefficient
depends on the size of the table (number of rows and number of columns). For this reason, it should be used only to compare tables of the same size.
Statistics Associated with Cross-TabulationContingency Coefficient
C = 2
2 + n
• Cramer's V is a modified version of the phi correlation coefficient, , and is used in tables larger than 2 x 2.
or
Statistics Associated with Cross-TabulationCramer’s V
V = 2
min (r-1), (c-1)
V = 2/n
min (r-1), (c-1)
• Asymmetric lambda measures the percentage improvement in predicting the value of the dependent variable, given the value of the independent variable.
• Lambda also varies between 0 and 1. A value of 0 means no improvement in prediction. A value of 1 indicates that the prediction can be made without error. This happens when each independent variable category is associated with a single category of the dependent variable.
• Asymmetric lambda is computed for each of the variables (treating it as the dependent variable).
• A symmetric lambda is also computed, which is a kind of average of the two asymmetric values. The symmetric lambda does not make an assumption about which variable is dependent. It measures the overall improvement when prediction is done in both directions.
Statistics Associated with Cross-TabulationLambda Coefficient
• Other statistics like tau b, tau c, and gamma are available to measure association between two ordinal-level variables. Both tau b and tau c adjust for ties.
• Tau b is the most appropriate with square tables in which the number of rows and the number of columns are equal. Its value varies between +1 and -1.
• For a rectangular table in which the number of rows is different than the number of columns, tau c should be used.
• Gamma does not make an adjustment for either ties or table size. Gamma also varies between +1 and -1 and generally has a higher numerical value than tau b or tau c.
Other Statistics Associated with Cross-Tabulation
Cross-Tabulation in PracticeWhile conducting cross-tabulation analysis in practice, it is useful to proceed along the following steps.
1. Test the null hypothesis that there is no association between the variables using the chi-square statistic. If you fail to reject the null hypothesis, then there is no relationship.
2. If H0 is rejected, then determine the strength of the association using an appropriate statistic (phi-coefficient, contingency coefficient, Cramer's V, lambda coefficient, or other statistics), as discussed earlier.
3. If H0 is rejected, interpret the pattern of the relationship by computing the percentages in the direction of the independent variable, across the dependent variable.
4. If the variables are treated as ordinal rather than nominal, use tau b, tau c, or Gamma as the test statistic. If H0 is rejected, then determine the strength of the association using the magnitude, and the direction of the relationship using the sign of the test statistic.
Hypothesis Testing In statistics, a hypothesis is a claim or statement about
a property of a population.
A hypothesis test (or test of significance) is a standard procedure for testing a claim about a property of a population.
Rare Event Rule for Inferential Statistics
If, under a given assumption, the probability of a particular observed event is exceptionally small, we conclude that the assumption is probably not correct
Steps Involved in Hypothesis Testing
Draw Research Conclusion
Formulate H0 and H1
Select Appropriate Test
Choose Level of Significance
Determine Probability Associated with Test Statistic
Determine Critical Value of Test Statistic TSCR
Determine if TSCR falls into (Non) Rejection Region
Compare with Level of Significance,
Reject or Do not Reject H0
Collect Data and Calculate Test Statistic
Note about Identifying H0 and H1
DefinitionsCritical Region
The critical region (or rejection region) is the set of all values of the test statistic that cause us to reject the null hypothesis.
Significance LevelThe significance level (denoted by ) is the probability that the test
statistic will fall in the critical region when the null hypothesis is actually true. Common choices for are 0.05, 0.01, and 0.10.
Critical ValueA critical value is any value that separates the critical region
(where we reject the null hypothesis) from the values of the test statistic that do not lead to rejection of the null hypothesis, the sampling distribution that applies, and the significance level . The critical value of z = 1.96 corresponds to a significance level of = 0.05.
Type I & Type II Errors A Type I error is the mistake of
rejecting the null hypothesis when it is true.
The symbol (alpha) is used to represent the probability of a type I error.
A Type II error is the mistake of failing to reject the null hypothesis when it is false.
The symbol (beta) is used to represent the probability of a type II error.
Controlling Type I and Type II Errors
For any fixed , an increase in the sample size n will cause a decrease in
For any fixed sample size n , a decrease in will cause an increase in . Conversely, an increase in will cause a decrease in .
To decrease both and , increase the sample size.
Conclusions in Hypothesis Testing
We always test the null hypothesis.
1. Reject the H0
2. Fail to reject the H0
Two-tailed,Right-tailed,
Left-tailed Tests
• The tails in a distribution are the extreme regions bounded by critical values.
Two-tailed Test is divided equally between the two tails of the critical
region
H0: =
H1: Means less than or greater than
Right-tailed TestH0: =
H1: > Points Right
Left-tailed TestH0: =
H1: < Points Left
Decision Criterion• Traditional method:
Reject H0 if the test statistic falls within the critical region.Fail to reject H0 if the test statistic does not fall within the critical region.
• P-value method: Reject H0 if P-value (where is the significance level, such as 0.05).Fail to reject H0 if P-value > .
• Another option: Instead of using a significance level such as 0.05, simply identify the P-value and leave the decision to the reader.
Decision Criterion
• Confidence Intervals: Because a confidence interval estimate of a
population parameter contains the likely values of that parameter, reject a claim that the population parameter has a value that is not included in the confidence interval.
P-ValueThe P-value (or p-value or probability value) is the probability of getting a value of the test statistic that is at least as extreme as the one representing the sample data, assuming that the null hypothesis is true. The null hypothesis is rejected if the P-value is very small, such as 0.05 or less.
Example: Finding P-values.
Wording of Final Conclusion
Accept versus Fail to Reject
Some texts use “accept the null hypothesis.”
We are not proving the null hypothesis.
The sample evidence is not strong enough to warrant rejection (such as not enough evidence to convict a suspect).
Comprehensive Hypothesis Test
Statistical Tests
ParametricInterval or ratio Scaled DataAssumption about population probability distribution
ExampleZ, t, F test etc.
Non-ParametricNominal or ordinal dataNo assumption about population probability distribution
Exampleχ2, sign, Wilcoxon Signed-Rank,Kruskal-Wallis Test etc.
A Classification of Hypothesis Testing Procedures for Examining Differences
Independent Samples
Paired Samples Independent
SamplesPaired Samples* Two-Group t
test* Z test
* Paired t test * Chi-Square
* Mann-Whitney* Median* K-S
* Sign* Wilcoxon* McNemar* Chi-Square
Hypothesis Tests
One Sample Two or More Samples
One Sample Two or More Samples
* t test* Z test
* Chi-Square * K-S * Runs* Binomial
Parametric Tests (Metric Tests)
Non-parametric Tests (Nonmetric Tests)
A Broad Classification of Hypothesis Tests
Median/ Rankings
Distributions Means Proportions
Tests of Association
Tests of Differences
Hypothesis Tests
Applications of Z – test (n>30)
• Test of significance for single mean• Test of significance for difference of means• Test of significance for difference of
standard deviation (s.d.) • Testing a Claim about a Proportion• Testing difference of Two proportions
Test of significance for single mean
Where • Sample Mean• Population mean• Population standard deviation(s.d.)• n Sample sizeNOTE: If population standard deviation(s.d.) is unknown then
estimated sample standard deviation s will be used.
95% confidence interval for is
99% confidence interval for is
n
XZ
X
nX
96.1
nX
57.2
n
iiXX
nS
1
2)(1
Test of significance for difference of means
Where , are the means of first and second sample , are standard deviations of samples , are the sample size of first sample & second
sample• IF and and are not known then
2
2
2
1
2
1
21
nn
XXZ
1X
1
1n
2X
2
2n
22
21 1 2
2
2
2
1
2
1
21
n
s
n
sXX
Z
Test of significance for difference of standard deviation (s.d.)
• IF and are not known then2
2
2
1
2
1
21
22 nn
ssZ
1 2
2
2
2
1
2
1
21
22 n
s
n
sss
Z
Testing a Claim about a Proportion
p = population proportion (used in the null
hypothesis)q = 1 – p
n = number of trials
p = x (sample proportion)n
n
pq
ppZ
ˆ
Testing difference of Two proportions
Where
Note that p* is the combined two sample proportion weighted by the two sample sizes
SE
PPZ
21
21
21**
*]1[
nn
nnppSE
21
2211* )*()*(
nn
pnpnP
Applications of t – test(n≤30)
• Test the significance of the mean of a random sample
• Test the difference between means of two samples (Independent Samples)
• Test the difference between means of two samples (Dependent Samples)
• Test of significance of an observed correlation coefficients
Test the significance of the mean of a random sample
s
nXt
)(
Where
X Sample Mean Population meanS standard deviation of the sample=
n
ii XX
n 1
2)(1
1
n Sample sizeDegree of freedom(d.f.)= n-1
95% confidence interval for is )1,05.0( ntn
X
Test of significance for difference of means
21
2121 )(nn
nn
S
XXt
Where
1X 1 1n
S combined standard deviation
2X 2 2n are the mean, standard deviation and sample size of first and second sample
2
)()(
21
1
1
2
1
22
21
nn
XXXXS
n
i
n
iii
IF s1, s2 and n1 n2 are given
2
)1()1(
21
222
211
nn
snsnS
d.f. = n1+ n2 -2
Test the difference between means of two samples (Dependent Samples)
nS
dt
Where
d is the mean of the differencesn is the number of paired observations
S is standard deviation of differences
n
ii dd
n 1
2)(1
1
d.f. = n – 1
Test of significance of an observed correlation coefficients
21 2
nr
rt
Wherer is correlation coefficientn is sample sized.f. = n – 2
An F test of sample variance may be performed if it isnot known whether the two populations have equalvariance. In this case, the hypotheses are:
H0: 12 = 2
2
H1: 12 2
2
Two Independent Samples F Test
The F statistic is computed from the sample variancesas follows
wheren1 = size of sample 1n2 = size of sample 2n1-1 = degrees of freedom for sample 1n2-1 = degrees of freedom for sample 2s1
2 = sample variance for sample 1s2
2 = sample variance for sample 2
suppose we wanted to determine whether Internet usage was different for males as compared to females. A two-independent-samples t test was conducted.
Two Independent Samples F Statistic
F(n1-1),(n2-1) = s1
2
s22
Nonparametric Tests
Nonparametric tests are used when the independent variables are nonmetric. Like parametric tests, nonparametric tests are available for testing variables from one sample, two independent samples, or two related samples.
Non-parametric Test
• Chi-Square Test• Binomial• Runs• 1-Samples K-S• 2-Independent samples• K-Independent Samples• 2-Dependent Samples• K-Dependent Samples
Applications of χ2 Test
1. Goodness of Fit2. Contingency Analysis (or Test of
Independence)3. Test of population variance
Where Oi and Ei are Observed and expected frequenciesDegree of freedom(d.f.) = n-1
Note:• No Ei should be less than 5, if so cell(s) must be
combined and d.f. should be reduced accordingly• If some parameters are calculated from Oi to calculate
Ei e.g. mean or standard deviation etc then d.f. should be reduced by 1 for each such parameters.
Goodness of Fit
n
i i
ii
E
EO
1
22
Contingency Analysis (or Test of Independence)
Where Oi and Ei are Observed and expected frequenciesDegree of freedom = (rows-1)(column-1)Note:When Degree of freedom is 1 AND N<50, adjust χ2 by Yates's Correction Factor i.e.
Unless in such case original (Oi – Ei)2 term is preserved
5.0iiEO
n
i i
ii
E
EO
1
22
n
i i
ii
E
EO
1
2
2 5.0
Test of population variance
Where S2 is sample varianceσ2 is population variance Degree of freedom = (n-1)n number of observations
2
2
2 )1(
Sn
Sometimes the researcher wants to test whether theobservations for a particular variable could reasonablyhave come from a particular distribution, such as thenormal, uniform, or Poisson distribution.
The Kolmogorov-Smirnov (K-S) one-sample testis one such goodness-of-fit test. The K-S compares thecumulative distribution function for a variable with aspecified distribution. Ai denotes the cumulativerelative frequency for each category of the theoretical(assumed) distribution, and Oi the comparable value ofthe sample frequency. The K-S test is based on themaximum value of the absolute difference between Ai
and Oi. The test statistic is
Nonparametric Tests One Sample
K = Max Ai - O
i
• The decision to reject the null hypothesis is based on the value of K. The larger the K is, the more confidence we have that H0 is false. For = 0.05, the critical value of K for large samples (over 35) is given by 1.36/ Alternatively, K can be transformed into a normally distributed z statistic and its associated probability determined.
• In the context of the Internet usage example, suppose we wanted to test whether the distribution of Internet usage was normal. A K-S one-sample test is conducted, yielding the data shown in Table indicates that the probability of observing a K value of 0.222, as determined by the normalized z statistic, is 0.103. Since this is more than the significance level of 0.05, the null hypothesis can not be rejected, leading to the same conclusion. Hence, the distribution of Internet usage does not deviate significantly from the normal distribution.
n
Nonparametric Tests One Sample
K-S One-Sample Test forNormality of Internet Usage
• The chi-square test can also be performed on a single variable from one sample. In this context, the chi-square serves as a goodness-of-fit test.
• The runs test is a test of randomness for the dichotomous variables. This test is conducted by determining whether the order or sequence in which observations are obtained is random.
• The binomial test is also a goodness-of-fit test for dichotomous variables. It tests the goodness of fit of the observed number of observations in each category to the number expected under a specified binomial distribution.
Nonparametric Tests One Sample
• When the difference in the location of two populations is to be compared based on observations from two independent samples, and the variable is measured on an ordinal scale, the Mann-Whitney U test can be used.
• In the Mann-Whitney U test, the two samples are combined and the cases are ranked in order of increasing size.
• The test statistic, U, is computed as the number of times a score from sample or group 1 precedes a score from group 2.
• If the samples are from the same population, the distribution of scores from the two groups in the rank list should be random. An extreme value of U would indicate a nonrandom pattern, pointing to the inequality of the two groups.
• For samples of less than 30, the exact significance level for U is computed. For larger samples, U is transformed into a normally distributed z statistic. This z can be corrected for ties within ranks.
Nonparametric TestsTwo Independent Samples
• We examine again the difference in the Internet usage of males and females. This time, though, the Mann-Whitney U test is used. The results are given in Table .
• One could also use the cross-tabulation procedure to conduct a chi-square test. In this case, we will have a 2 x 2 table. One variable will be used to denote the sample, and will assume the value 1 for sample 1 and the value of 2 for sample 2. The other variable will be the binary variable of interest.
• The two-sample median test determines whether the two groups are drawn from populations with the same median. It is not as powerful as the Mann-Whitney U test because it merely uses the location of each observation relative to the median, and not the rank, of each observation.
• The Kolmogorov-Smirnov two-sample test examines whether the two distributions are the same. It takes into account any differences between the two distributions, including the median, dispersion, and skewness.
Nonparametric TestsTwo Independent Samples
Mann-Whitney U - Wilcoxon Rank Sum W Test Internet Usage by Gender
Sex Mean Rank Cases
Male 20.93 15Female 10.07 15 Total 30 Corrected for ties U W z 2-tailed p 31.000 151.000 -3.406 0.001
Note U = Mann-Whitney test statistic W = Wilcoxon W Statistic
z = U transformed into normally distributed z statistic.
• The Wilcoxon matched-pairs signed-ranks test analyzes the differences between the paired observations, taking into account the magnitude of the differences.
• It computes the differences between the pairs of variables and ranks the absolute differences.
• The next step is to sum the positive and negative ranks. The test statistic, z, is computed from the positive and negative rank sums.
• Under the null hypothesis of no difference, z is a standard normal variate with mean 0 and variance 1 for large samples.
Nonparametric TestsPaired Samples
• The example considered for the paired t test, whether the respondents differed in terms of attitude toward the Internet and attitude toward technology, is considered again. Suppose we assume that both these variables are measured on ordinal rather than interval scales. Accordingly, we use the Wilcoxon test.
• The sign test is not as powerful as the Wilcoxon matched-pairs signed-ranks test as it only compares the signs of the differences between pairs of variables without taking into account the ranks.
• In the special case of a binary variable where the researcher wishes to test differences in proportions, the McNemar test can be used. Alternatively, the chi-square test can also be used for binary variables.
Nonparametric Tests Paired Samples
Wilcoxon Matched-Pairs Signed-Rank Test Internet with Technology
A Summary of Hypothesis TestsRelated to Differences
Sample Application Level of Scaling Test/Comments
One Sample
One Sample Distributions NonmetricK-S and chi-square for goodness of fit
Runs test for randomness
Binomial test for goodness of
fit for dichotomous variables
One Sample Means Metric t test, if variance is unknown
z test, if variance is known
Proportion Metric Z test
A Summary of Hypothesis TestsRelated to Differences
A Summary of Hypothesis TestsRelated to Differences