You are on page 1of 75

INFERENCES FROM TWO SAMPLES

SALVACION M. VINLUAN DR. IMELDA E. CUARTEL

UNIVERSITY OF LUZON
Doctor of Philosophy in Development Education

Professor

Definitions Testing Two Means, Dependent Case: The Mean of the Differences Testing of Two Variances Testing of Two Means, Independent Case: The Differences of the Means Testing Two Proportions

What is Statistical Inference?


This refers to the process of drawing conclusions from data that is subject to random variation, for example, observational errors or sampling variation.

More substantially, the term statistical inference, statistical induction and inferential statistics are used to describe systems of procedures that can be used to draw conclusions from datasets arising from systems affected by random variation, such as observational errors, random sampling, or random experimentation.

Initial requirements of such a system of procedures for inference and induction are that the system should produce reasonable answers when applied to welldefined situations and that it should be general enough to be applied across a range of situations.

The outcome of statistical inference may be an answer to the question what should be done next?, where there might be a decision about making further experiments or surveys, or about drawing conclusions before implementing some organizational or governmental policy.

Statistical inference refers to the statistical method concerned with making estimates of population value. This particular method and process will help us determine how accurate and acceptable our generalizations are.

Testing Two Means, Dependent Case: The Mean of the Difference


There are two possible cases when testing population means, the dependent case and the independent case.

The t-Test for Dependent Samples


The t-Test for dependent samples is applied to matched pairs or correlated samples. The samples are supposedly taken from one population. For example, in the research study on the degree of seriousness of problems encountered by college freshmen, data were taken before and after their individual counseling sessions.

From the 15-item problem checklist, the corresponding degree of seriousness of problems encountered by the students before and after their individual sessions comprises the data to be compared. This is also referred to as repeated measures.

To compute the t-value for dependent samples, the formula is as follows


where: t = t-value D = difference n = number of cases

t =

D nD (D) n-1

Example:
Student 1 2 3 4 5 6 7 8 9 10 Before 3.00 3.25 3.00 2.50 2.75 2.50 2.75 3.75 3.50 3.60 After 4.00 3.50 3.50 3.60 3.45 2.75 4.75 2.00 3.51 4.50

Solution:
Step 1. Ho : P1 = P2 H1 : P1 P2 Step 2: = 0.05 (two-tailed test) Step 3: Reject the null hypothesis if the computed t-value is greater than the critical t-value of 1.833 at =0.05 with nine degrees of freedom. Step 4: t-test for dependent samples t= D n D (D)

n-1

Student 1 2 3 4 5 6 7 8 9 10

Before (X1) 3.00 3.25 3.00 2.50 2.75 2.50 2.75 3.75 3.50 3.60

After(X2) 4.00 3.50 3.50 3.60 3.45 2.75 4.75 4.00 3.51 4.50

D -1.00 0.25 0.50 1.10 0.70 0.25 -2.00 0.25 0.01 0.90 6.96

D2 1.0000 0.0625 0.2500 1.2100 0.4900 0.0625 4.0000 0.0625 0.0001 0.8100 7.9476

t = D nD (D) n-1

t=

6.96 10- 1

10(7.9496) - (6.96)

t = 3.74

The degree of freedom: df = 10-1 df = 9 Step 5: Reject the null hypothesis since the computed value of 3.74 is greater than the critical value of 1.833 at = 0.05 with 9 degrees of freedom.

Conclusion:

There is a significant difference between the degrees of seriousness of problems encountered by the students before and after their exposures to individual counseling sessions.

Testing Two Variances


A technique commonly used under F-test is referred the Analysis of Variance (ANOVA), since it deals with the ratio between the variability occurring among the different groups or treatments against the variability occurring within the members of each of the groups or treatments.

Moreover, it is assumed that the different groups must have equal variances. The following is an example of the data layout for this test.
Groups or Treatments 1 2 3 X11 X12 X13 X21 X22 X23 X31 X32 X33

1 2 Replicates 3 . . m Totals Means Sum Squares

n X1n X2n X3n

Xm1 T1 X1 SS1

Xm2 T2 X2 SS2

Xm3 T3 X3 SS3

Xmn Tmn Xn SSn

where: m = is the number of replicates n = is the number of groups or treatments Xjk = is the observation belonging to the jth replicate of the kth treatment or group 1 j m and 1 k n Tk = is the total of all the kth treatments from each of the m replicates, i.e. Tk=Xjk
j=1

is the mean of the kth treatments from each of the m replicate; i.e. Xk = Xjk m SSk is the sum of the squares of all the kth treatments from each of the m replicates; i,e. SSk = Xjk Xk
j=1

To perform the test of hypothesis comparing more than two sample means the following steps and needed information must be noted.

Ho: All the means of the different groups or treatments are the same. Ha: At least one mean is different from the other means.

The rejection criteria from this test is stated as follows: Reject Ho is Fc > F(df1,df2). Do not reject Ho otherwise. where: F(df1,df2) is the critical value, is the level of significance, df1 = n-1, df2 = p-n, p = mn; m = number of replicates and n = number of groups or treatments. Fc is the computed test statistic.

In computing for the test statistic, we construct the ANOVA table as follows:
Analysis of Variance
Sources of Variation
Between Groups
Within Groups Total

df

Sum of Squares

Means Squares

F Ratio

df1 = n-1

SSB

MSB

Fc

df2 = p-n SSW P-1 SS MSW

where: SSB - sum of squares between groups SSW -sum of squares within groups MSB - mean squares between groups MSW -means squares within groups SST - total sum of squares Fc - test statistic n - number of groups or treatments m - number of replicates p - mn

a) the correction factor (CF), given by


n CF= Tk
P

b) the total sum of squares (SST) SST=SSk-CF c) the sum of squares between groups (SSB) SSB = Tk - CF k=1 m d) the sum of squares within groups (SSW) SSW = SST - SSB

e) the mean squares between groups (MSB) MSB = SSB = SSB df1 n-1 f) the mean squares within groups (MSW) MSW = SSW = SSW df1 n-1 g) the Fc, referred to as the test statistic is defined by Fc = MSB MSW

Example: Five bus companies were selected in order to determine if there is a difference in the number of hours travelling a 200 kilometer path from place A to place B at 5% level of significance. The data sets were given as follows:

u
Travel

Bus Companies v w x
3.0 4.2 4.3 4.1 3.2 4.0
22.80 88.18 3.80

y
4.6 3.8 4.6 3.2 2.9 2.5
21.60 81.66 3.60

time of
buses

1 2 3 4 5 6

2.7 2.8 4.0 3.5 3.8 4.9


21.70 81.83 3.62

3.4 3.6 4.6 2.8 5.0 2.3


21.70 83.81 3.62

4.9 2.6 5.1 3.5 3.1 3.2


22.40 88.88 3.73

Totals Sum of squares Means

Solution:
Statement of Hypothesis: Ho: The five bus companies have the same traveling time in hours from place A to place B. Ha: At least one of the five bus company has different traveling time in hours. Critical Region and Criteria for rejection Level of significance: = 5 Test: F-test df: df1= n-1= 5-1=4 df2= p-1= 30-5=25 ; p=mn

Criteria for rejection:

Reject the Ho is Fc > F0.05(4.25) Do not reject Ho otherwise Computation: Test Statistic: Fc
CF= Tk = (21.70+22.80+21.70+22.40+21.60) 30 30 = (110.2) 30 = 404.80

SST=SSk - CF =(81.83+88.18+83.81+88.88+81.66)- 404.80 = 19.56 SSB= (Tk) - CF k=1 m = 21.70+22.80+21.70+22.40+21.60 - 404.80 6 6 6 6 6 = 404.99 404.80 = 0.19

MSB = 0.19 = 0.0475 5 -1 SSW = SST SSB = 19.56 0.19 = 19.37


MSW = 19.37 = 0.7748 30-5

.:F = 0.475 = 0.0613 0.7748

Analysis of Variance
Sources of variation Between Bus Company Within Bus Company Total df Sum of squares 0.19 Means squares 0.0475 F Ratio

0.0613

25

19.37

0.7748

29

19.56

F0.05(4.25) = 2.76
Conclusion: Since the test statistic does not exceeds the critical value, the Ho is not rejected. Thus, the traveling time in hours of the five bus companies are the same from place A to place B at 5% level of significance.

Example:
Three teachers taught statistics to three sections. The final grades of six students per section and some descriptive were shown below. Can we say that there is a difference between the scores of each section? Test at 5% level of significance.
Sections Students final grade Total SS Mean

A B C

87 75 90

81 84 82

86 83 89

91 86 86

87 79 80

90 83 82

522 490 509

45,476 87.00 40.096 81.67 43,265 84.83

Solution:
Statement of Hypothesis: Ho: The three sections have the same mean final grades in Statistics Ha: At least one of the three sections has different mean final grades in Statistics

Critical Region and Criteria for rejection Level of significance: = 5% Test: F-test df: df1 = n-1= 3-1= 2 df2 = p-n =18-3 =15

Criteria for rejection:


Reject Ho is Fc > F0.05(2.15) Do not reject Ho otherwise Computation: Test Statistic: Fc CF=Tk = (522+490+509) n 18 = (1521) 18 = 128,524.50

SST = SSk CF
k=1

= (45,476+40,096+43,265)-128,524.50 = 128,837 128,524.50 = 312.5 SSB= (Tk) - CF


k=1 m

= 522 + 490 + 509 -128,524.5 6 6 6 = (45,414 + 40,016.67 + 43,180.17) 128,524.5 = 128,610.84 128,524.5 = 86.34

MSB = 86.34 = 43.1700 3-1 SSW = SST SSB = 312.5 86.34 = 226.16
MSW = 226.16 =15.0773 18-3

.: F = 43.1700 = 2.8632 15.0773

Analysis of Variance
Sources of Variation Between Sections df Sum of Squares 86.34 Means Squares 43.1700 F Ratio

2.8632

Within Sections Total

15 17

226.16 312.50

15.0773

F0.05(2.15) = 3.68

Conclusion: Since the test statistic does not exceeds the critical value, we have to accept Ho. Thus, the final grades of the students in the three sections are the same at 5% level of significance.

Testing Two Means, Independent Case: The Difference of the Means


The independent t-test is used when the two sample means are taken from separate groups of respondents or populations. For example, the researcher is interested to compare the research skills of assistant professors and associate professors in a certain university. The assistant professors comprise one group and the associate professors another group.

t = X1 X2 S1 + S2 n1 n 2
where: X1 = X2 = S1 = S2 = n1 = n2 = Mean of the first group Mean of the second group Variance of the first group Variance of the second group Number of cases in the first group Number of cases in the second group

Example:
In a study conducted to determine the research skills of assistant and associate professors in state universities and colleges, the following data represent the mean scores of the professors:
Assistant Prof.(X1) 3.0 4.2 2.75 3.50 3.50 4.00 4.50 4.00 2.50 3.50 2.60 3.00

Associate Prof.(X2) 3.75 4.50

Solution: Step 1: State the hypotheses Ho: There is no significant difference


between the research skills of assistant and associate professors.

H1:

There is a significant difference between the research skills of assistant and associate professors.

Step 2: Set the level of significance = 0.05; two-tailed test


Step 3: Reject Ho if the computed value is greater than 1.782. Step 4: Compute the value of the test statistics from the given data.

Asst. Professor
(X1) 3.00 4.20 2.75 3.50 4.50 2.50 2.60

Assoc. Professor
(X2) 3.75 4.50 3.50 4.00 4.00 3.50 3.00

__________ X1 = 23.05 X1 = 3.29 S1 = 0.64

___________ X2 = 26.26 X2 = 3.75 S2 =0.23

t = X1 - X2 S1 + S2 n2 n2 t = 3.29 -3.75 .64 + .23 7 7 t = -.46 .12 t = - 1.3143

The degree of freedom:


df = n1 + n2 n2 df = 7 + 7 2 df = 14 2 df = 12 Step 5: In as much as the computed t- value of 1.3143 is lower than the critical value, then there is no sufficient evidence to reject the null hypothesis. Step 6: State the conclusion. Since the computed t-value is lower than the critical tvalue, it means that there is no significant difference between the research skills of assistant and associate professors. Thus, they manifest comparable research skills.

Example:
A researcher wishes to compare the post-test performance of two groups of students classified according to their learning styles assimilators and convergers. Ten students were assigned per group. After their exposures to simplified instructional materials on Basic Statistics, the assimilators mean post-test performance was 20, with a standard deviation of 8.92, while the convergers mean posttest performance was 26.26, with a standard deviation of 8.67. Test the significant difference between the two group means.

Solution: Step 1: Ho: There is no significant difference in the mean post-test performance of the two groups of students classified according to their learning styles. H1: There exists significant difference in the mean post-test performance of the two groups of students classified according to their learning styles.

Step 2: = 0.05 (two-tailed test)

Step 3: Reject the null hypothesis (Ho) if the computed t-value is greater than the critical t-value of 1.734 at = 0.05 with 18 degrees of freedom.
Step 4: t-test for independent samples

t = X1 X2 S1 + S2 n1 n2
Convergers X1 = 26.26 S1 = 8.67 n1 = 10 Assimilators X2 = 20 S2 = 8.92 n2 = 10

t = X1 X2 S1 + S2 n1 n2
t = 26.26 20 8.67 + 8.92 10 10 t = 6.26 1.759 t = 6.26 1.33

t = 4.71

The degree of freedom:


df = n1+ n2 - 2 df = 10 + 10 2 df = 20 2 df = 18 Step 5: Reject the null hypothesis since the computed t-value of 4.71 is greater than 1.734. Conclusion: There exists a significant difference between the mean post-test performance of the two groups of students classified according to their learning styles after their exposures to simplified instructional materials in Basic Statistics.

Testing Two Proportions


Remember that the normal distribution can be used to approximate the binomial distribution in certain cases. Specifically, the approximation was considered good when np and nq were both at least 5. Now, we're talking about two proportions, so np and nq must be at least 5 for both samples.

We don't have a way to specifically test two proportions for values, what we have is the ability to test the difference between the proportions. So, much like the test for two means from independent populations, we will be looking at the difference of the proportions. We will also be computing an average proportion and calling it pbar. It is the total number of successes divided by the total number of trials. The definitions which are necessary are shown to the right.

The

test statistic used here is similar to that for a single population proportion, except the difference of proportions are used instead of a single proportion, and the value of pbar is used instead of p in the standard error portion. Since we're using the normal approximation to the binomial, the difference of proportions has a normal distribution. The test statistic is given.

Some people will be tempted to try to simplify the denominator of this test statistic incorrectly. It can be simplified, but the correct simplification is not to simply place the product of p-bar and qbar over the sum of the ns. Remember that to add fractions, you must have a common denominator, that is why this simplification is incorrect.

The correct simplification would be to factor a p-bar and q-bar out of the two expressions. This is usually the formula given, because it is easier to calculate.

Comparing Two Proportions


A commonly posed question is "Are two proportions different?" For example, is the end-of-course passing rate this year significantly different from the end-ofcourse passing rate last year. This type of question involves comparing two proportions both of which are estimates, and thus the necessary formula will be different.

In this case we will develop the theory that allows us to apply the hypothesis testing procedure to this problem. The procedure involves the use of test statistic that involves two proportions. But this statistic will still be a z-statistic and we will compare it to the normal scores, i.e. z-scores.

Theoretical Background Given two independent variables that are both normal, their sum or difference will be normal distributed. This idea can readily be proven. The important point is that the difference of two sample proportions is an example of the difference of two normally distributed variables. Thus we can standardize them and obtain a a-score.

For example, If you have two estimated proportions, 1 and 22 and you happen to know that one has a mean of 0.6 and the other a mean of 0.4, then you know their difference will have a mean of 1 2 = 0.6 0.4 = 0.2. What we now need is the standard deviation of this difference.

Assuming that each estimate is based on 300 observations you would also be able to determine the variance of the difference. Since the variance of each estimated proportion is 0.60.4 300 = 0.0008. The variance of the difference would be the sum of the two variances or 0.0016. Which means the standard deviation of the difference is 0.0016 = 0.04. All this may seem complicated but the bottom line is that we know the distribution of ( 1 2). Thus we can calculate confidence intervals and do hypothesis tests on this variable.

Distribution of

1 2

Let 1 is a proportion based on a sample size n1 and 2 is based on a sample of size n2. Assume that both sample sizes are large enough (>100) then we can assume that the estimates of p are normally distributes. If we assume that the underlying proportions from the two samples are the same, i.e. p1 = p2, then ( 1 2) will have: a normal distribution (i.e. the variable can be standardized to a z-score.) a mean = 0 an approximate variance = (1 )( 1 n1 + 1 n2) where is the estimate of the proportions.

This fact will be useful to deriving a teststatistic for proportion. In this case 95% of the time the corresponding z-score should not deviate more than 1.96 units from 0. This z-score also called the test statistics for comparing two proportions is: z=

If we do not assume that the two proportions are the same then ( 1 2) can estimate their difference. In this case this expression will have: a normal distribution. (i.e. we can use zscores to find the error margin.) a mean, = p1 p2 an approximate variance of = 1(1 1) n1 + 2(1 2) n2.

This means if we want to estimate the difference (or gap) between two proportions, p1 and p2 then the 95% confidence interval will be:
(
1

2)

1.96 p1 p2 (

2)

+ 1.96

Example: The five- step hypothesis test for two proportions.


Example: Test the assertion that the EOG Mathematics test of female fifth grade students is no different than that of the male students. (Data for Asheville schools, 2008. NC DPI ) STEP I: Set up two opposing hypotheses. Let p1 be the proportion of female students passing and p2be the proportion of male student. H0 : p1 = p2 VS Ha : p1 p2

STEP II: Get data. Even though all students in each grade are tested, you still only have a sample since your population is all students that could potentially be taught in the Asheville school system. According to NC Department of Public Instruction 89 of 126 (or 70.6%) female students passed the test and 119 of 142 (or 83.8%) male students passed the test.
# Passed Female Students Male Students All Students 89 119 208 Sample Size n1 = 126 1 = 0.706 n2 = 142 2 = 0.838 n = 268 3 = 0.776 Estimated Proportion

STEP III: Decide on a statistical test. We will use the two proportion z test given in this lesson. STEP IV: Calculate your test statistic. Every test has a formula that standardizes the estimator, in this case that estimator is . The statistic is:

Z statistic =

Z- stat = (0.706 0.838) 0.7760.224(1 126 + 1 142)


Z-stat 0.132 0.0026 2.587.

STEP V: Arrive at a conclusion and state it in clear English. Remember that the two critical values for the different levels of certainty are: z0.025 = 1.96 or z0.005 = 2.576. Since |z-stat| >z* (the critical value) we reject the Null Hypothesis. Conclusion: With 99% certainty we can state that there is a statistically significant larger proportion of boys passing the fifth grade EOC in mathematics in the Asheville school district.

Thank you

You might also like