SlideShare a Scribd company logo
1 of 31
Video Lectures foe B.tech 
By: 
video.edhole.com
Sociology 601 Class 8: September 24, 2009 
 6.6: Small-sample inference for a proportion 
 7.1: Large sample comparisons for two 
independent sample means. 
 7.2: Difference between two large sample 
proportions. 
video.edhole.com 
2
7.1 Large sample comparisons for two independent 
means 
 So far, we have been making estimates and 
inferences about a single sample statistic 
 Now, we will begin making estimates and 
inferences for two sample statistics at once. 
 many real-life problems involve such comparisons 
 two-group problems often serve as a starting point for 
3 
more involved statistics, as we shall see in this class. 
video.edhole.com
Independent and dependent samples 
 Two independent random samples: 
 Two subsamples, each with a mean score for some other 
4 
variable 
 example: Comparisons of work hours by race or sex 
 example: Comparison of earnings by marital status 
 Two dependent random samples: 
 Two observations are being compared for each “unit” in 
the sample 
 example: before-and-after measurements of the same 
person at two time points 
 example: earnings before and after marriage 
 husband-video.edholwe.ifceo dmifferences
Comparison of two large-sample means 
for independent groups 
Hypothesis testing as we have done it so far: 
 Test statistic: z = (Ybar - mo) / (s /SQRT(n)) 
 What can we do when we make inferences about a 
difference between population means (m2 - m1)? 
 Treat one sample mean as if it were mo ? 
 (NO: too much type I error) 
 Calculate a confidence interval for each sample mean and 
see if they overlap? 
video. (NO: edhol too em.uccohm 5 
type II error)
Figuring out a test statistic 
for a comparison of two means 
Is Y2 –Y1an appropriate way to evaluate m2 - m1? 
6 
• Answer: Yes. We can appropriately define (m2 - m1) as a 
parameter of interest and estimate it in an unbiased way 
with (Y2 – Y1) just as we would estimate m with Y. 
• This line of argument may seem trivial, but it becomes 
important when we work with variance and standard 
deviations. 
video.edhole.com
Figuring out a standard error for a comparison of two 
means 
Comparing standard errors: 
 A&F 213: formula without derivation 
 Is s2 
7 
Ybar2 - s2 
Ybar1an appropriate way to estimate s2 
(Ybar2-Ybar1)? 
 No! 
 s2 
(Ybar2-Ybar1)= s2 
(Ybar2) - 2s(Ybar2,Ybar1) + s2 
(Ybar1) 
 Where 2s(Ybar2,Ybar1) reflects how much the observations for the 
two groups are dependent. 
 For independent groups, 2s(Ybar2,Ybar1) = 0, 
so s2 
(Ybar2-Ybar1)= s2 
(Ybar2) + s2 
(Ybar1) 
video.edhole.com
Step 1: Significance test for m2 - m1 
 The parameter of interest is m2 - m1 
 Assumptions: 
 the sample is drawn from a random sample of some sort, 
 the parameter of interest is a variable with an interval 
scale, 
 the sample size is large enough that the sampling 
distribution of Ybar2 – Ybar1 is approximately normal. 
 The two samples are drawn independently 
video.edhole.com 
8
Step 2: Significance test for m2 - m1 
 The null hypothesis will be that there is no 
difference between the population means. This 
means that any difference we observe is due to 
random chance. 
 Ho: m2 - m1 = 0 
 (We can specify an alpha level now if we want) 
 Q: Would it matter if we used 
9 
Ho: m1 - m2 = 0 ? 
Ho: m1 = m2 ? 
video.edhole.com
Step 3: Significance test for m2 - m1 
 The test statistic has a standard form: 
 z = (estimate of parameter – Ho value of parameter) 
10 
standard error of parameter 
z Y Y 
= - - 
2 1 ( ) 0 
2 
2 
s 
n 
2 
2 
1 
s 
n 
1 
+ 
 Q: If the null hypothesis is that the means are the 
same, why do we estimate two different standard 
deviations? 
video.edhole.com
Step 4: Significance test for m2 - m1 
P-value of calculated z: 
• Table A 
• Stata: display 2 * (1 – normal(z) ) 
• Stata: testi (no data, just parameters) 
• Stata: ttest (if data file in memory) 
video.edhole.com 
11
Step 5: Significance test for m2 - m1 
Step 5: Conclusion. 
 Compare the p-value from step 4 to the alpha level 
in step 1. 
If p < α, reject H0 If p ≥ α, do not reject H0 
 State a conclusion about the statistical significance 
of the test. 
 Briefly discuss the substantive importance of your 
findings. 
video.edhole.com 
12
Significance test for m2 - m1: Example 
 Do women spend more time on housework than men? 
 Data from the 1988 National Survey of Families and 
Households: 
 sex sample size mean hours s.d 
 men 4252 18.1 12.9 
 women 6764 32.6 18.2 
 The parameter of interest is m2 - m1 
video.edhole.com 
13
Significance test for m2 - m1: Example 
1. Assumptions: random sample, interval-scale variable, 
14 
sample size large enough that the sampling distribution of 
m2 - m1is approximately normal, independent groups 
2. Hypothesis: Ho: m2 - m1= 0 
3. Test statistic: 
z = ((32.6 – 18.1) – 0) / SQRT((12.9)2/4252 + (18.2)2/6764) = 48.8 
1. p-value: p<.001 
2. conclusion: 
a. reject H0: these sample differences are very unlikely to occur if men 
and women do the same number of hours of housework. 
b. furthermore, the observed difference of 14.5 hours per week is a 
substantively important difference in the video.edhole.com amount of housework.
Confidence interval for m2 - m1: 
2 
2 
2 
1 
s 
c i = Y -Y ± z s + 
 housework example with 99% interval: 
 c.i…. 
= (32.6 – 18.1) +/- 2.58*( √((12.9)2/4252 + (18.2)2/6764)) 
= 14.5 +/- 2.58*.30 
= 14.5 +/- .8, or (13.7,15.3) 
 By this analysis, the 99% confidence interval for the 
difference in housework is 13.7 to 15.3 hours. 
15 
( ) 
2 
1 
2 1 . . 
n 
n 
video.edhole.com
Stata: Large sample significance test for 
m2 - m1 
 Immediate (no data, just parameters) 
 ttesti 4252 18.1 12.9 6764 32.6 18.2, unequal 
• Q: why ttesti with large samples? 
 For the immediate command, you need the following: 
 sample size for group 1 (n = 4252) 
 mean for group 1 
 standard deviation for group 1 
 sample size for group 2 
 mean for group 2 
 standard deviation for group 2 
video. edhole.com 16 
instructions to not assume equal variance (, unequal)
Stata: Large sample significance test for 
m2 - m1, an example 
. ttesti 4252 18.1 12.9 6764 32.6 18.2, unequal 
Two-sample t test with unequal variances 
------------------------------------------------------------------------------ 
video.edhole.com 
17 
| Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] 
---------+-------------------------------------------------------------------- 
x | 4252 18.1 .1978304 12.9 17.71215 18.48785 
y | 6764 32.6 .221294 18.2 32.16619 33.03381 
---------+-------------------------------------------------------------------- 
combined | 11016 27.00323 .1697512 17.8166 26.67049 27.33597 
---------+-------------------------------------------------------------------- 
diff | -14.5 .2968297 -15.08184 -13.91816 
------------------------------------------------------------------------------ 
Satterthwaite's degrees of freedom: 10858.6 
Ho: mean(x) - mean(y) = diff = 0 
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 
t = -48.8496 t = -48.8496 t = -48.8496 
P < t = 0.0000 P > |t| = 0.0000 P > t = 1.0000
Large sample significance test for m2 - m1: command for 
a data set (#1) 
. ttest YEARSJOB, by(nonstandard) unequal 
Two-sample t test with unequal variances 
------------------------------------------------------------------------------ 
Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] 
---------+-------------------------------------------------------------------- 
18 
0 | 980 9.430612 .2788544 8.729523 8.883391 9.977833 
1 | 379 7.907652 .3880947 7.555398 7.144557 8.670747 
---------+-------------------------------------------------------------------- 
combined | 1359 9.005887 .2290413 8.443521 8.556573 9.4552 
---------+-------------------------------------------------------------------- 
diff | 1.522961 .4778884 .5848756 2.461045 
------------------------------------------------------------------------------ 
diff = mean(0) - mean(1) t = 3.1869 
Ho: diff = 0 Satterthwaite's degrees of freedom = 787.963 
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 
v Pird(Te o< .te) d= h0.o99l9e3. c o m Pr(|T| > |t|) = 0.0015 Pr(T > t) = 0.0007
Large sample significance test for m2 - m1: command for 
a data set (#2) 
. ttest conrinc if wrkstat==1, by(wrkslf) unequal 
Two-sample t test with unequal variances 
------------------------------------------------------------------------------ 
Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] 
---------+-------------------------------------------------------------------- 
self-emp | 190 48514.62 2406.263 33168.05 43768.03 53261.2 
someone | 1263 34417.11 636.9954 22638 33167.43 35666.8 
---------+-------------------------------------------------------------------- 
combined | 1453 36260.56 648.5844 24722.9 34988.3 37532.82 
---------+-------------------------------------------------------------------- 
19 
diff | 14097.5 2489.15 9191.402 19003.6 
------------------------------------------------------------------------------ 
diff = mean(self-emp) - mean(someone) t = 5.6636 
Ho: diff = 0 Satterthwaite's degrees of freedom = 216.259 
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 
Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000 video.edhole.com
7.2: Comparisons of two independent 
population proportions 
 In 1982 and 1994, respondents in the General Social Survey 
were asked: “Do you agree or disagree with this statement? 
‘Women should take care of running their homes and leave 
running the country up to men.’” 
 Year Agree Disagree Total 
 1982 122 223 345 
 1994 268 1632 1900 
 Total 390 1855 2245 
 Do a formal test to decide whether opinions differed in the 
two years. 
video.edhole.com 
20
Step 1: Significance test for π2 - π1 
 The parameter of interest is π2 - π1 
 Assumptions: 
 the sample is drawn from a random sample of some sort, 
 the parameter of interest is a variable with an interval 
scale, 
 the sample size is large enough that the sampling 
distribution of Pihat2 – Pihat1 is approximately normal. 
 The two samples are drawn independently 
video.edhole.com 
21
Step 2: Significance test for π2 - π1 
The null hypothesis will be that there is no 
difference between the population proportions. This 
means that any difference we observe is due to 
random chance. 
Ho: π2 - π1 = 0 
(State an alpha here if you want to.) 
video.edhole.com 
22
Step 3: Significance test for π2 - π1 
The test statistic has a standard form: 
 z = (estimate of parameter – Ho value of parameter) 
23 
standard error of parameter 
ö 
( ˆ ˆ ) 
= - 
p p 
2 1 
æ 
ˆ 1 ˆ 1 1 
( ) ÷ ÷ø 
ç çè 
p p 
- + 
n n 
1 2 
z 
 Where pihat is the overall weighted average 
 This means we are assuming equal variance in the two 
populations. 
 Q: why do we use an assumption of equal variance to 
estimate the standard error for the t-test? 
video.edhole.com
Step 4: Significance test for π2 - π1 
P-value of calculated z: 
• Table A, or 
• Stata: display 2 * (1 – normal(z) ), or 
• Stata: testi (no data, just parameters) 
• Stata: ttest (if data file in memory) 
video.edhole.com 
24
Step 5: Significance test for π2 - π1 
Conclusion: 
 Compare the p-value from step 4 to the alpha level 
in step 1. 
If p < α, reject H0 If p ≥ α, do not reject H0 
 State a conclusion about the statistical significance 
of the test. 
 Briefly discuss the substantive importance of your 
findings. 
video.edhole.com 
25
Significance test for π2 - π1: Example 
1. Assumptions: random sample, interval-scale variable, 
26 
sample size large enough that the sampling distribution of 
m2 - m1is approximately normal, independent groups 
2. Hypothesis: Ho: π2 - π1= 0 
3. Test statistic: 
z = (122/345 – 268/1900) / 
SQRT[(390/2245)*(1 - 390/2245)*(1/345 + 1/1900)] 
= 9.59 
1. p-value: p<<.001 
2. conclusion: 
a. reject H0: attitudes were clearly different in 1994 than in 1982. 
b. furthermore, the observed difference of .21 is a substantively 
important change video.edhole.com in attitudes.
Comparisons of two independent population proportions: 
Confidence Interval 
 confidence interval: 
c i = P - P ± z P - P + - 
P P 
. . (1 ) (1 ) 
1 1 
2 2 
 Notice that there is no overall weighted average Pihat, 
as there is in a significance test for proportions. 
 Instead, we estimate two separate variances from the 
separate proportions. 
 Why? 
27 
( ) 
2 
1 
2 1 
n 
n 
video.edhole.com
STATA: Significance test for π2 - π1: 
immediate command 
. prtesti 345 .3536 1900 .1411 
 STATA needs the following information: 
 sample size for group 1 (n = 345) 
 proportion for group 1 (p = 122/345) 
 sample size for group 2 (n = 1900) 
 proportion for group 2 (p = 268/1900) 
video.edhole.com 
28
STATA: Significance test for π2 - π1: 
immediate command 
. prtesti 345 .3536 1900 .1411 
Two-sample test of proportion x: Number of obs = 345 
29 
y: Number of obs = 1900 
------------------------------------------------------------------------------ 
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval] 
-------------+---------------------------------------------------------------- 
x | .3536 .0257393 .3031518 .4040482 
y | .1411 .0079865 .1254467 .1567533 
-------------+---------------------------------------------------------------- 
diff | .2125 .0269499 .1596791 .2653209 
| under Ho: .0221741 9.58 0.000 
------------------------------------------------------------------------------ 
Ho: proportion(x) - proportion(y) = diff = 0 
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 
z = 9.583 z = 9.583 z = 9.583 
P < z = 1.0000 P > |z| = 0.0000 P > z = 0.0000 
Note the use of one standard error (unequal variance) for the 
confidence interval, and another (equal variance) for the 
vidsiegoni.fiecdanhcoel tee.sct.om
STATA command for a data set (#1) 
. prtest nonstandard if (RACECEN1==1 | RACECEN1==2), by(RACECEN1) 
Two-sample test of proportion 1: Number of obs = 1389 
30 
2: Number of obs = 260 
------------------------------------------------------------------------------ 
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval] 
-------------+---------------------------------------------------------------- 
1 | .2800576 .0120482 .2564436 .3036716 
2 | .3538462 .0296544 .2957247 .4119676 
-------------+---------------------------------------------------------------- 
diff | -.0737886 .0320084 -.1365239 -.0110532 
| under Ho: .0307147 -2.40 0.016 
------------------------------------------------------------------------------ 
diff = prop(1) - prop(2) z = -2.4024 
Ho: diff = 0 
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 
v Pird(Ze o< .ze) d= h0.o00l8e1. c o m Pr(|Z| < |z|) = 0.0163 Pr(Z > z) = 0.9919
STATA command for a data set (#1) 
. gen byte wrkslf0=wrkslf-1 
(152 missing values generated) 
. prtest wrkslf0 if wrkstat==1, by(sex) 
Two-sample test of proportion male: Number of obs = 874 
31 
female: Number of obs = 743 
------------------------------------------------------------------------------ 
Variable | Mean Std. Err. z P>|z| [95% Conf. Interval] 
-------------+---------------------------------------------------------------- 
male | .8272311 .0127876 .8021678 .8522944 
female | .9044415 .0107853 .8833027 .9255802 
-------------+---------------------------------------------------------------- 
diff | -.0772103 .0167286 -.1099978 -.0444229 
| under Ho: .0171735 -4.50 0.000 
------------------------------------------------------------------------------ 
diff = prop(male) - prop(female) z = -4.4959 
Ho: diff = 0 
Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 
v Pird(Ze o< .ze) d= h0.o00l0e0. c o m Pr(|Z| < |z|) = 0.0000 Pr(Z > z) = 1.0000

More Related Content

What's hot

Development of a test statistic for testing equality of two means under unequ...
Development of a test statistic for testing equality of two means under unequ...Development of a test statistic for testing equality of two means under unequ...
Development of a test statistic for testing equality of two means under unequ...Alexander Decker
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidelCesar Mendoza
 
Comparison of Bayesian and non-Bayesian estimations for Type-II censored Gen...
Comparison of Bayesian and non-Bayesian estimations for  Type-II censored Gen...Comparison of Bayesian and non-Bayesian estimations for  Type-II censored Gen...
Comparison of Bayesian and non-Bayesian estimations for Type-II censored Gen...IqraHussain31
 
Optimization of positive linear systems via geometric programming
Optimization of positive linear systems via geometric programmingOptimization of positive linear systems via geometric programming
Optimization of positive linear systems via geometric programmingMasaki Ogura
 
Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Rai University
 
IRJET- On the Pellian Like Equation 5x2-7y2=-8
IRJET- On the Pellian Like Equation 5x2-7y2=-8IRJET- On the Pellian Like Equation 5x2-7y2=-8
IRJET- On the Pellian Like Equation 5x2-7y2=-8IRJET Journal
 
Basic concepts of curve fittings
Basic concepts of curve fittingsBasic concepts of curve fittings
Basic concepts of curve fittingsTarun Gehlot
 
Statistics assignment 8
Statistics assignment 8Statistics assignment 8
Statistics assignment 8Ishaq Ahmed
 
Numerical analysis kuhn tucker eqn
Numerical analysis  kuhn tucker eqnNumerical analysis  kuhn tucker eqn
Numerical analysis kuhn tucker eqnSHAMJITH KM
 
Statistics assignment 2.2
Statistics assignment 2.2Statistics assignment 2.2
Statistics assignment 2.2Ishaq Ahmed
 

What's hot (12)

Development of a test statistic for testing equality of two means under unequ...
Development of a test statistic for testing equality of two means under unequ...Development of a test statistic for testing equality of two means under unequ...
Development of a test statistic for testing equality of two means under unequ...
 
Metodos jacobi y gauss seidel
Metodos jacobi y gauss seidelMetodos jacobi y gauss seidel
Metodos jacobi y gauss seidel
 
Stats
StatsStats
Stats
 
Comparison of Bayesian and non-Bayesian estimations for Type-II censored Gen...
Comparison of Bayesian and non-Bayesian estimations for  Type-II censored Gen...Comparison of Bayesian and non-Bayesian estimations for  Type-II censored Gen...
Comparison of Bayesian and non-Bayesian estimations for Type-II censored Gen...
 
Optimization of positive linear systems via geometric programming
Optimization of positive linear systems via geometric programmingOptimization of positive linear systems via geometric programming
Optimization of positive linear systems via geometric programming
 
Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3Btech_II_ engineering mathematics_unit3
Btech_II_ engineering mathematics_unit3
 
IRJET- On the Pellian Like Equation 5x2-7y2=-8
IRJET- On the Pellian Like Equation 5x2-7y2=-8IRJET- On the Pellian Like Equation 5x2-7y2=-8
IRJET- On the Pellian Like Equation 5x2-7y2=-8
 
Seattle.Slides.7
Seattle.Slides.7Seattle.Slides.7
Seattle.Slides.7
 
Basic concepts of curve fittings
Basic concepts of curve fittingsBasic concepts of curve fittings
Basic concepts of curve fittings
 
Statistics assignment 8
Statistics assignment 8Statistics assignment 8
Statistics assignment 8
 
Numerical analysis kuhn tucker eqn
Numerical analysis  kuhn tucker eqnNumerical analysis  kuhn tucker eqn
Numerical analysis kuhn tucker eqn
 
Statistics assignment 2.2
Statistics assignment 2.2Statistics assignment 2.2
Statistics assignment 2.2
 

Similar to Video lectures for b.tech

Admission in India
Admission in IndiaAdmission in India
Admission in IndiaEdhole.com
 
ACMS TV Ratings Midterm Angelini
ACMS TV Ratings Midterm AngeliniACMS TV Ratings Midterm Angelini
ACMS TV Ratings Midterm AngeliniBrandon Angelini
 
Statistics project2
Statistics project2Statistics project2
Statistics project2shri1984
 
Data-Driven Recommender Systems
Data-Driven Recommender SystemsData-Driven Recommender Systems
Data-Driven Recommender Systemsrecsysfr
 
Econometric (Indonesia's Economy).pptx
Econometric (Indonesia's Economy).pptxEconometric (Indonesia's Economy).pptx
Econometric (Indonesia's Economy).pptxIndraYu2
 
Engineering Data Analysis-ProfCharlton
Engineering Data  Analysis-ProfCharltonEngineering Data  Analysis-ProfCharlton
Engineering Data Analysis-ProfCharltonCharltonInao1
 
Hybrid Optimization Approaches to Economic Load Dispatch Problems – A Compara...
Hybrid Optimization Approaches to Economic Load Dispatch Problems – A Compara...Hybrid Optimization Approaches to Economic Load Dispatch Problems – A Compara...
Hybrid Optimization Approaches to Economic Load Dispatch Problems – A Compara...IRJET Journal
 
Time series analysis use E-views programer
Time series analysis use E-views programerTime series analysis use E-views programer
Time series analysis use E-views programerAl-Qadisiya University
 
Control Strategy of Flow Properties of Waxy Crude oil from Hegleig to Khartou...
Control Strategy of Flow Properties of Waxy Crude oil from Hegleig to Khartou...Control Strategy of Flow Properties of Waxy Crude oil from Hegleig to Khartou...
Control Strategy of Flow Properties of Waxy Crude oil from Hegleig to Khartou...IRJET Journal
 
IRJET- Analysis of Chi-Square Independence Test for Naïve Bayes Feature Selec...
IRJET- Analysis of Chi-Square Independence Test for Naïve Bayes Feature Selec...IRJET- Analysis of Chi-Square Independence Test for Naïve Bayes Feature Selec...
IRJET- Analysis of Chi-Square Independence Test for Naïve Bayes Feature Selec...IRJET Journal
 
Constraints on labour productivity-a case study
Constraints on labour productivity-a case studyConstraints on labour productivity-a case study
Constraints on labour productivity-a case studytheijes
 
onstraints on labour productivity-a case study
onstraints on labour productivity-a case studyonstraints on labour productivity-a case study
onstraints on labour productivity-a case studytheijes
 
Extended Analysis of Cauchy’s Inequality
Extended Analysis of Cauchy’s InequalityExtended Analysis of Cauchy’s Inequality
Extended Analysis of Cauchy’s InequalityIRJET Journal
 
Multivariate Analysis of Cauchy’s Inequality
Multivariate Analysis of Cauchy’s InequalityMultivariate Analysis of Cauchy’s Inequality
Multivariate Analysis of Cauchy’s InequalityIRJET Journal
 
22_RepeatedMeasuresDesign_Complete.pptx
22_RepeatedMeasuresDesign_Complete.pptx22_RepeatedMeasuresDesign_Complete.pptx
22_RepeatedMeasuresDesign_Complete.pptxMarceloHenriques20
 
Regression vs Neural Net
Regression vs Neural NetRegression vs Neural Net
Regression vs Neural NetRatul Alahy
 
Efficient Similarity Computation for Collaborative Filtering in Dynamic Envir...
Efficient Similarity Computation for Collaborative Filtering in Dynamic Envir...Efficient Similarity Computation for Collaborative Filtering in Dynamic Envir...
Efficient Similarity Computation for Collaborative Filtering in Dynamic Envir...Olivier Jeunen
 

Similar to Video lectures for b.tech (20)

Admission in India
Admission in IndiaAdmission in India
Admission in India
 
ACMS TV Ratings Midterm Angelini
ACMS TV Ratings Midterm AngeliniACMS TV Ratings Midterm Angelini
ACMS TV Ratings Midterm Angelini
 
Statistics project2
Statistics project2Statistics project2
Statistics project2
 
Data-Driven Recommender Systems
Data-Driven Recommender SystemsData-Driven Recommender Systems
Data-Driven Recommender Systems
 
Econometric (Indonesia's Economy).pptx
Econometric (Indonesia's Economy).pptxEconometric (Indonesia's Economy).pptx
Econometric (Indonesia's Economy).pptx
 
Engineering Data Analysis-ProfCharlton
Engineering Data  Analysis-ProfCharltonEngineering Data  Analysis-ProfCharlton
Engineering Data Analysis-ProfCharlton
 
Hybrid Optimization Approaches to Economic Load Dispatch Problems – A Compara...
Hybrid Optimization Approaches to Economic Load Dispatch Problems – A Compara...Hybrid Optimization Approaches to Economic Load Dispatch Problems – A Compara...
Hybrid Optimization Approaches to Economic Load Dispatch Problems – A Compara...
 
Time series analysis use E-views programer
Time series analysis use E-views programerTime series analysis use E-views programer
Time series analysis use E-views programer
 
Control Strategy of Flow Properties of Waxy Crude oil from Hegleig to Khartou...
Control Strategy of Flow Properties of Waxy Crude oil from Hegleig to Khartou...Control Strategy of Flow Properties of Waxy Crude oil from Hegleig to Khartou...
Control Strategy of Flow Properties of Waxy Crude oil from Hegleig to Khartou...
 
report
reportreport
report
 
IRJET- Analysis of Chi-Square Independence Test for Naïve Bayes Feature Selec...
IRJET- Analysis of Chi-Square Independence Test for Naïve Bayes Feature Selec...IRJET- Analysis of Chi-Square Independence Test for Naïve Bayes Feature Selec...
IRJET- Analysis of Chi-Square Independence Test for Naïve Bayes Feature Selec...
 
Constraints on labour productivity-a case study
Constraints on labour productivity-a case studyConstraints on labour productivity-a case study
Constraints on labour productivity-a case study
 
onstraints on labour productivity-a case study
onstraints on labour productivity-a case studyonstraints on labour productivity-a case study
onstraints on labour productivity-a case study
 
Extended Analysis of Cauchy’s Inequality
Extended Analysis of Cauchy’s InequalityExtended Analysis of Cauchy’s Inequality
Extended Analysis of Cauchy’s Inequality
 
AIRS2016
AIRS2016AIRS2016
AIRS2016
 
Multivariate Analysis of Cauchy’s Inequality
Multivariate Analysis of Cauchy’s InequalityMultivariate Analysis of Cauchy’s Inequality
Multivariate Analysis of Cauchy’s Inequality
 
22_RepeatedMeasuresDesign_Complete.pptx
22_RepeatedMeasuresDesign_Complete.pptx22_RepeatedMeasuresDesign_Complete.pptx
22_RepeatedMeasuresDesign_Complete.pptx
 
panel data.ppt
panel data.pptpanel data.ppt
panel data.ppt
 
Regression vs Neural Net
Regression vs Neural NetRegression vs Neural Net
Regression vs Neural Net
 
Efficient Similarity Computation for Collaborative Filtering in Dynamic Envir...
Efficient Similarity Computation for Collaborative Filtering in Dynamic Envir...Efficient Similarity Computation for Collaborative Filtering in Dynamic Envir...
Efficient Similarity Computation for Collaborative Filtering in Dynamic Envir...
 

More from Edhole.com

Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarkaEdhole.com
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarkaEdhole.com
 
Website development company surat
Website development company suratWebsite development company surat
Website development company suratEdhole.com
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in suratEdhole.com
 
Website dsigning company in india
Website dsigning company in indiaWebsite dsigning company in india
Website dsigning company in indiaEdhole.com
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhiEdhole.com
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarkaEdhole.com
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarkaEdhole.com
 
Website development company surat
Website development company suratWebsite development company surat
Website development company suratEdhole.com
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in suratEdhole.com
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in indiaEdhole.com
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhiEdhole.com
 
Website designing company in mumbai
Website designing company in mumbaiWebsite designing company in mumbai
Website designing company in mumbaiEdhole.com
 
Website development company surat
Website development company suratWebsite development company surat
Website development company suratEdhole.com
 
Website desinging company in surat
Website desinging company in suratWebsite desinging company in surat
Website desinging company in suratEdhole.com
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in indiaEdhole.com
 

More from Edhole.com (20)

Ca in patna
Ca in patnaCa in patna
Ca in patna
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarka
 
Ca in dwarka
Ca in dwarkaCa in dwarka
Ca in dwarka
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarka
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in surat
 
Website dsigning company in india
Website dsigning company in indiaWebsite dsigning company in india
Website dsigning company in india
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 
Ca in patna
Ca in patnaCa in patna
Ca in patna
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarka
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarka
 
Ca in dwarka
Ca in dwarkaCa in dwarka
Ca in dwarka
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in surat
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in india
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 
Website designing company in mumbai
Website designing company in mumbaiWebsite designing company in mumbai
Website designing company in mumbai
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website desinging company in surat
Website desinging company in suratWebsite desinging company in surat
Website desinging company in surat
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in india
 

Recently uploaded

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Recently uploaded (20)

9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Video lectures for b.tech

  • 1. Video Lectures foe B.tech By: video.edhole.com
  • 2. Sociology 601 Class 8: September 24, 2009  6.6: Small-sample inference for a proportion  7.1: Large sample comparisons for two independent sample means.  7.2: Difference between two large sample proportions. video.edhole.com 2
  • 3. 7.1 Large sample comparisons for two independent means  So far, we have been making estimates and inferences about a single sample statistic  Now, we will begin making estimates and inferences for two sample statistics at once.  many real-life problems involve such comparisons  two-group problems often serve as a starting point for 3 more involved statistics, as we shall see in this class. video.edhole.com
  • 4. Independent and dependent samples  Two independent random samples:  Two subsamples, each with a mean score for some other 4 variable  example: Comparisons of work hours by race or sex  example: Comparison of earnings by marital status  Two dependent random samples:  Two observations are being compared for each “unit” in the sample  example: before-and-after measurements of the same person at two time points  example: earnings before and after marriage  husband-video.edholwe.ifceo dmifferences
  • 5. Comparison of two large-sample means for independent groups Hypothesis testing as we have done it so far:  Test statistic: z = (Ybar - mo) / (s /SQRT(n))  What can we do when we make inferences about a difference between population means (m2 - m1)?  Treat one sample mean as if it were mo ?  (NO: too much type I error)  Calculate a confidence interval for each sample mean and see if they overlap? video. (NO: edhol too em.uccohm 5 type II error)
  • 6. Figuring out a test statistic for a comparison of two means Is Y2 –Y1an appropriate way to evaluate m2 - m1? 6 • Answer: Yes. We can appropriately define (m2 - m1) as a parameter of interest and estimate it in an unbiased way with (Y2 – Y1) just as we would estimate m with Y. • This line of argument may seem trivial, but it becomes important when we work with variance and standard deviations. video.edhole.com
  • 7. Figuring out a standard error for a comparison of two means Comparing standard errors:  A&F 213: formula without derivation  Is s2 7 Ybar2 - s2 Ybar1an appropriate way to estimate s2 (Ybar2-Ybar1)?  No!  s2 (Ybar2-Ybar1)= s2 (Ybar2) - 2s(Ybar2,Ybar1) + s2 (Ybar1)  Where 2s(Ybar2,Ybar1) reflects how much the observations for the two groups are dependent.  For independent groups, 2s(Ybar2,Ybar1) = 0, so s2 (Ybar2-Ybar1)= s2 (Ybar2) + s2 (Ybar1) video.edhole.com
  • 8. Step 1: Significance test for m2 - m1  The parameter of interest is m2 - m1  Assumptions:  the sample is drawn from a random sample of some sort,  the parameter of interest is a variable with an interval scale,  the sample size is large enough that the sampling distribution of Ybar2 – Ybar1 is approximately normal.  The two samples are drawn independently video.edhole.com 8
  • 9. Step 2: Significance test for m2 - m1  The null hypothesis will be that there is no difference between the population means. This means that any difference we observe is due to random chance.  Ho: m2 - m1 = 0  (We can specify an alpha level now if we want)  Q: Would it matter if we used 9 Ho: m1 - m2 = 0 ? Ho: m1 = m2 ? video.edhole.com
  • 10. Step 3: Significance test for m2 - m1  The test statistic has a standard form:  z = (estimate of parameter – Ho value of parameter) 10 standard error of parameter z Y Y = - - 2 1 ( ) 0 2 2 s n 2 2 1 s n 1 +  Q: If the null hypothesis is that the means are the same, why do we estimate two different standard deviations? video.edhole.com
  • 11. Step 4: Significance test for m2 - m1 P-value of calculated z: • Table A • Stata: display 2 * (1 – normal(z) ) • Stata: testi (no data, just parameters) • Stata: ttest (if data file in memory) video.edhole.com 11
  • 12. Step 5: Significance test for m2 - m1 Step 5: Conclusion.  Compare the p-value from step 4 to the alpha level in step 1. If p < α, reject H0 If p ≥ α, do not reject H0  State a conclusion about the statistical significance of the test.  Briefly discuss the substantive importance of your findings. video.edhole.com 12
  • 13. Significance test for m2 - m1: Example  Do women spend more time on housework than men?  Data from the 1988 National Survey of Families and Households:  sex sample size mean hours s.d  men 4252 18.1 12.9  women 6764 32.6 18.2  The parameter of interest is m2 - m1 video.edhole.com 13
  • 14. Significance test for m2 - m1: Example 1. Assumptions: random sample, interval-scale variable, 14 sample size large enough that the sampling distribution of m2 - m1is approximately normal, independent groups 2. Hypothesis: Ho: m2 - m1= 0 3. Test statistic: z = ((32.6 – 18.1) – 0) / SQRT((12.9)2/4252 + (18.2)2/6764) = 48.8 1. p-value: p<.001 2. conclusion: a. reject H0: these sample differences are very unlikely to occur if men and women do the same number of hours of housework. b. furthermore, the observed difference of 14.5 hours per week is a substantively important difference in the video.edhole.com amount of housework.
  • 15. Confidence interval for m2 - m1: 2 2 2 1 s c i = Y -Y ± z s +  housework example with 99% interval:  c.i…. = (32.6 – 18.1) +/- 2.58*( √((12.9)2/4252 + (18.2)2/6764)) = 14.5 +/- 2.58*.30 = 14.5 +/- .8, or (13.7,15.3)  By this analysis, the 99% confidence interval for the difference in housework is 13.7 to 15.3 hours. 15 ( ) 2 1 2 1 . . n n video.edhole.com
  • 16. Stata: Large sample significance test for m2 - m1  Immediate (no data, just parameters)  ttesti 4252 18.1 12.9 6764 32.6 18.2, unequal • Q: why ttesti with large samples?  For the immediate command, you need the following:  sample size for group 1 (n = 4252)  mean for group 1  standard deviation for group 1  sample size for group 2  mean for group 2  standard deviation for group 2 video. edhole.com 16 instructions to not assume equal variance (, unequal)
  • 17. Stata: Large sample significance test for m2 - m1, an example . ttesti 4252 18.1 12.9 6764 32.6 18.2, unequal Two-sample t test with unequal variances ------------------------------------------------------------------------------ video.edhole.com 17 | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- x | 4252 18.1 .1978304 12.9 17.71215 18.48785 y | 6764 32.6 .221294 18.2 32.16619 33.03381 ---------+-------------------------------------------------------------------- combined | 11016 27.00323 .1697512 17.8166 26.67049 27.33597 ---------+-------------------------------------------------------------------- diff | -14.5 .2968297 -15.08184 -13.91816 ------------------------------------------------------------------------------ Satterthwaite's degrees of freedom: 10858.6 Ho: mean(x) - mean(y) = diff = 0 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 t = -48.8496 t = -48.8496 t = -48.8496 P < t = 0.0000 P > |t| = 0.0000 P > t = 1.0000
  • 18. Large sample significance test for m2 - m1: command for a data set (#1) . ttest YEARSJOB, by(nonstandard) unequal Two-sample t test with unequal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- 18 0 | 980 9.430612 .2788544 8.729523 8.883391 9.977833 1 | 379 7.907652 .3880947 7.555398 7.144557 8.670747 ---------+-------------------------------------------------------------------- combined | 1359 9.005887 .2290413 8.443521 8.556573 9.4552 ---------+-------------------------------------------------------------------- diff | 1.522961 .4778884 .5848756 2.461045 ------------------------------------------------------------------------------ diff = mean(0) - mean(1) t = 3.1869 Ho: diff = 0 Satterthwaite's degrees of freedom = 787.963 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 v Pird(Te o< .te) d= h0.o99l9e3. c o m Pr(|T| > |t|) = 0.0015 Pr(T > t) = 0.0007
  • 19. Large sample significance test for m2 - m1: command for a data set (#2) . ttest conrinc if wrkstat==1, by(wrkslf) unequal Two-sample t test with unequal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- self-emp | 190 48514.62 2406.263 33168.05 43768.03 53261.2 someone | 1263 34417.11 636.9954 22638 33167.43 35666.8 ---------+-------------------------------------------------------------------- combined | 1453 36260.56 648.5844 24722.9 34988.3 37532.82 ---------+-------------------------------------------------------------------- 19 diff | 14097.5 2489.15 9191.402 19003.6 ------------------------------------------------------------------------------ diff = mean(self-emp) - mean(someone) t = 5.6636 Ho: diff = 0 Satterthwaite's degrees of freedom = 216.259 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 1.0000 Pr(|T| > |t|) = 0.0000 Pr(T > t) = 0.0000 video.edhole.com
  • 20. 7.2: Comparisons of two independent population proportions  In 1982 and 1994, respondents in the General Social Survey were asked: “Do you agree or disagree with this statement? ‘Women should take care of running their homes and leave running the country up to men.’”  Year Agree Disagree Total  1982 122 223 345  1994 268 1632 1900  Total 390 1855 2245  Do a formal test to decide whether opinions differed in the two years. video.edhole.com 20
  • 21. Step 1: Significance test for π2 - π1  The parameter of interest is π2 - π1  Assumptions:  the sample is drawn from a random sample of some sort,  the parameter of interest is a variable with an interval scale,  the sample size is large enough that the sampling distribution of Pihat2 – Pihat1 is approximately normal.  The two samples are drawn independently video.edhole.com 21
  • 22. Step 2: Significance test for π2 - π1 The null hypothesis will be that there is no difference between the population proportions. This means that any difference we observe is due to random chance. Ho: π2 - π1 = 0 (State an alpha here if you want to.) video.edhole.com 22
  • 23. Step 3: Significance test for π2 - π1 The test statistic has a standard form:  z = (estimate of parameter – Ho value of parameter) 23 standard error of parameter ö ( ˆ ˆ ) = - p p 2 1 æ ˆ 1 ˆ 1 1 ( ) ÷ ÷ø ç çè p p - + n n 1 2 z  Where pihat is the overall weighted average  This means we are assuming equal variance in the two populations.  Q: why do we use an assumption of equal variance to estimate the standard error for the t-test? video.edhole.com
  • 24. Step 4: Significance test for π2 - π1 P-value of calculated z: • Table A, or • Stata: display 2 * (1 – normal(z) ), or • Stata: testi (no data, just parameters) • Stata: ttest (if data file in memory) video.edhole.com 24
  • 25. Step 5: Significance test for π2 - π1 Conclusion:  Compare the p-value from step 4 to the alpha level in step 1. If p < α, reject H0 If p ≥ α, do not reject H0  State a conclusion about the statistical significance of the test.  Briefly discuss the substantive importance of your findings. video.edhole.com 25
  • 26. Significance test for π2 - π1: Example 1. Assumptions: random sample, interval-scale variable, 26 sample size large enough that the sampling distribution of m2 - m1is approximately normal, independent groups 2. Hypothesis: Ho: π2 - π1= 0 3. Test statistic: z = (122/345 – 268/1900) / SQRT[(390/2245)*(1 - 390/2245)*(1/345 + 1/1900)] = 9.59 1. p-value: p<<.001 2. conclusion: a. reject H0: attitudes were clearly different in 1994 than in 1982. b. furthermore, the observed difference of .21 is a substantively important change video.edhole.com in attitudes.
  • 27. Comparisons of two independent population proportions: Confidence Interval  confidence interval: c i = P - P ± z P - P + - P P . . (1 ) (1 ) 1 1 2 2  Notice that there is no overall weighted average Pihat, as there is in a significance test for proportions.  Instead, we estimate two separate variances from the separate proportions.  Why? 27 ( ) 2 1 2 1 n n video.edhole.com
  • 28. STATA: Significance test for π2 - π1: immediate command . prtesti 345 .3536 1900 .1411  STATA needs the following information:  sample size for group 1 (n = 345)  proportion for group 1 (p = 122/345)  sample size for group 2 (n = 1900)  proportion for group 2 (p = 268/1900) video.edhole.com 28
  • 29. STATA: Significance test for π2 - π1: immediate command . prtesti 345 .3536 1900 .1411 Two-sample test of proportion x: Number of obs = 345 29 y: Number of obs = 1900 ------------------------------------------------------------------------------ Variable | Mean Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- x | .3536 .0257393 .3031518 .4040482 y | .1411 .0079865 .1254467 .1567533 -------------+---------------------------------------------------------------- diff | .2125 .0269499 .1596791 .2653209 | under Ho: .0221741 9.58 0.000 ------------------------------------------------------------------------------ Ho: proportion(x) - proportion(y) = diff = 0 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 z = 9.583 z = 9.583 z = 9.583 P < z = 1.0000 P > |z| = 0.0000 P > z = 0.0000 Note the use of one standard error (unequal variance) for the confidence interval, and another (equal variance) for the vidsiegoni.fiecdanhcoel tee.sct.om
  • 30. STATA command for a data set (#1) . prtest nonstandard if (RACECEN1==1 | RACECEN1==2), by(RACECEN1) Two-sample test of proportion 1: Number of obs = 1389 30 2: Number of obs = 260 ------------------------------------------------------------------------------ Variable | Mean Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1 | .2800576 .0120482 .2564436 .3036716 2 | .3538462 .0296544 .2957247 .4119676 -------------+---------------------------------------------------------------- diff | -.0737886 .0320084 -.1365239 -.0110532 | under Ho: .0307147 -2.40 0.016 ------------------------------------------------------------------------------ diff = prop(1) - prop(2) z = -2.4024 Ho: diff = 0 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 v Pird(Ze o< .ze) d= h0.o00l8e1. c o m Pr(|Z| < |z|) = 0.0163 Pr(Z > z) = 0.9919
  • 31. STATA command for a data set (#1) . gen byte wrkslf0=wrkslf-1 (152 missing values generated) . prtest wrkslf0 if wrkstat==1, by(sex) Two-sample test of proportion male: Number of obs = 874 31 female: Number of obs = 743 ------------------------------------------------------------------------------ Variable | Mean Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- male | .8272311 .0127876 .8021678 .8522944 female | .9044415 .0107853 .8833027 .9255802 -------------+---------------------------------------------------------------- diff | -.0772103 .0167286 -.1099978 -.0444229 | under Ho: .0171735 -4.50 0.000 ------------------------------------------------------------------------------ diff = prop(male) - prop(female) z = -4.4959 Ho: diff = 0 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 v Pird(Ze o< .ze) d= h0.o00l0e0. c o m Pr(|Z| < |z|) = 0.0000 Pr(Z > z) = 1.0000