Student’s t statistic Use Test for equality of two means

Slides:



Advertisements
Similar presentations
What is Chi-Square? Used to examine differences in the distributions of nominal data A mathematical comparison between expected frequencies and observed.
Advertisements

Hypothesis Testing Steps in Hypothesis Testing:
COMPLETE BUSINESS STATISTICS
Independent t -test Features: One Independent Variable Two Groups, or Levels of the Independent Variable Independent Samples (Between-Groups): the two.
Dealing With Statistical Uncertainty
Lecture 10 Non Parametric Testing STAT 3120 Statistical Methods I.
Comparing Two Population Means The Two-Sample T-Test and T-Interval.
Nonparametric tests and ANOVAs: What you need to know.
Dealing With Statistical Uncertainty Richard Mott Wellcome Trust Centre for Human Genetics.
Chapter 12 Chi-Square Tests and Nonparametric Tests
Chapter 14 Analysis of Categorical Data
Chapter 12 Chi-Square Tests and Nonparametric Tests
© 2002 Prentice-Hall, Inc.Chap 8-1 Statistics for Managers using Microsoft Excel 3 rd Edition Chapter 8 Two Sample Tests with Numerical Data.
Independent Samples and Paired Samples t-tests PSY440 June 24, 2008.
Test statistic: Group Comparison Jobayer Hossain Larry Holmes, Jr Research Statistics, Lecture 5 October 30,2008.
Final Review Session.
PSYC512: Research Methods PSYC512: Research Methods Lecture 19 Brian P. Dyre University of Idaho.
Analysis of Differential Expression T-test ANOVA Non-parametric methods Correlation Regression.
© 2004 Prentice-Hall, Inc.Chap 10-1 Basic Business Statistics (9 th Edition) Chapter 10 Two-Sample Tests with Numerical Data.
Nemours Biomedical Research Statistics March 26, 2009 Tim Bunnell, Ph.D. & Jobayer Hossain, Ph.D. Nemours Bioinformatics Core Facility.
Basic Business Statistics (9th Edition)
15-1 Introduction Most of the hypothesis-testing and confidence interval procedures discussed in previous chapters are based on the assumption that.
Review for Exam 2 Some important themes from Chapters 6-9 Chap. 6. Significance Tests Chap. 7: Comparing Two Groups Chap. 8: Contingency Tables (Categorical.
Chapter 12 Chi-Square Tests and Nonparametric Tests
Mann-Whitney and Wilcoxon Tests.
Nonparametrics and goodness of fit Petter Mostad
Chapter 15 Nonparametric Statistics
Chapter 12 Inferential Statistics Gay, Mills, and Airasian
Estimation and Hypothesis Testing Faculty of Information Technology King Mongkut’s University of Technology North Bangkok 1.
Inferential Statistics: SPSS
Marketing Research, 2 nd Edition Alan T. Shao Copyright © 2002 by South-Western PPT-1 CHAPTER 17 BIVARIATE STATISTICS: NONPARAMETRIC TESTS.
Lab 5 Hypothesis testing and Confidence Interval.
Jeopardy Hypothesis Testing T-test Basics T for Indep. Samples Z-scores Probability $100 $200$200 $300 $500 $400 $300 $400 $300 $400 $500 $400.
Hypothesis testing – mean differences between populations
Dealing With Statistical Uncertainty Richard Mott Wellcome Trust Centre for Human Genetics.
Chapter 9.3 (323) A Test of the Mean of a Normal Distribution: Population Variance Unknown Given a random sample of n observations from a normal population.
NONPARAMETRIC STATISTICS
Non-parametric Tests. With histograms like these, there really isn’t a need to perform the Shapiro-Wilk tests!
© 2002 Prentice-Hall, Inc.Chap 9-1 Statistics for Managers Using Microsoft Excel 3 rd Edition Chapter 9 Analysis of Variance.
Biostat 200 Lecture 7 1. Hypothesis tests so far T-test of one mean: Null hypothesis µ=µ 0 Test of one proportion: Null hypothesis p=p 0 Paired t-test:
Previous Lecture: Categorical Data Methods. Nonparametric Methods This Lecture Judy Zhong Ph.D.
Testing Multiple Means and the Analysis of Variance (§8.1, 8.2, 8.6) Situations where comparing more than two means is important. The approach to testing.
Ordinally Scale Variables
Education 793 Class Notes Presentation 10 Chi-Square Tests and One-Way ANOVA.
MGT-491 QUANTITATIVE ANALYSIS AND RESEARCH FOR MANAGEMENT OSMAN BIN SAIF Session 26.
Two Sample t test Chapter 9.
Nonparametric Statistics
Jeopardy Hypothesis Testing t-test Basics t for Indep. Samples Related Samples t— Didn’t cover— Skip for now Ancient History $100 $200$200 $300 $500 $400.
Nonparametric Tests: Chi Square   Lesson 16. Parametric vs. Nonparametric Tests n Parametric hypothesis test about population parameter (  or  2.
Copyright ©2011 Pearson Education, Inc. publishing as Prentice Hall 12-1 Chapter 12 Chi-Square Tests and Nonparametric Tests Statistics for Managers using.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 11-1 Chapter 11 Chi-Square Tests and Nonparametric Tests Statistics for.
Ch11: Comparing 2 Samples 11.1: INTRO: This chapter deals with analyzing continuous measurements. Later, some experimental design ideas will be introduced.
Week111 The t distribution Suppose that a SRS of size n is drawn from a N(μ, σ) population. Then the one sample t statistic has a t distribution with n.
Non-parametric Tests e.g., Chi-Square. When to use various statistics n Parametric n Interval or ratio data n Name parametric tests we covered Tuesday.
Copyright © 2013, 2009, and 2007, Pearson Education, Inc. Chapter 11 Analyzing the Association Between Categorical Variables Section 11.2 Testing Categorical.
Tuesday, September 24, 2013 Independent samples t-test.
Biostatistics Nonparametric Statistics Class 8 March 14, 2000.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
ENGR 610 Applied Statistics Fall Week 7 Marshall University CITE Jack Smith.
HYPOTHESIS TESTING FOR DIFFERENCES BETWEEN MEANS AND BETWEEN PROPORTIONS.
Hypothesis Tests u Structure of hypothesis tests 1. choose the appropriate test »based on: data characteristics, study objectives »parametric or nonparametric.
Two-Sample-Means-1 Two Independent Populations (Chapter 6) Develop a confidence interval for the difference in means between two independent normal populations.
Educational Research Inferential Statistics Chapter th Chapter 12- 8th Gay and Airasian.
Inferential Statistics Psych 231: Research Methods in Psychology.
Chapter 4 Selected Nonparemetric Techniques: PARAMETRIC VS. NONPARAMETRIC.
When the means of two groups are to be compared (where each group consists of subjects that are not related) then the excel two-sample t-test procedure.
Slide 1 Shakeel Nouman M.Phil Statistics Nonparametric Methods and Chi-Square Tests (1) Nonparametric Methods and Chi-Square Tests (1) By Shakeel Nouman.
I. ANOVA revisited & reviewed
Chapter 9 Hypothesis Testing.
Nonparametric Statistics
Presentation transcript:

Student’s t statistic Use Test for equality of two means E.g., compare two groups of subjects given different treatments Test for value of a single mean E.g., test to see if a single group of subjects differs from a known value Also ‘matched sample’ test where a single group is compared before and after treatment (test for zero treatment effect) Advanced Tests of significance of correlation/regression coefficients.

Student’s t statistic Assumptions Robustness Parent population is normal Sample observations (subjects) are independent. Robustness To normality: Affects Type I error and power and may lead to inappropriate interpretation. In real life, we can’t expect exactly normal data but it should not be too much skewed

Student’s t statistic Formula (single group) Let x1, x2, ….xn be a random sample from a normal population with mean µ and variance σ2, then the following statistic is distributed as Student’s t with (n-1) degrees of freedom.

Student’s t statistic Formula (two groups) Case 1: Two matched samples The following statistic follows t distribution with n-1 d.f. Where, d is the difference of two matched samples and Sd is the standard deviation of the variable d.

Student’s t statistic Formula (two groups) Case 2: Equal Population Standard Deviations: The following statistic is distributed as t distribution with (n1+n2 -2) d.f. The pooled standard deviation, n1 and n2 are the sample sizes and S1 and S2 are the sample standard deviations of two groups.

Student’s t statistic Formula (two groups) Case 3: Unequal population standard deviations The following statistic follows t distribution. The d.f. of this statistic is,

Student’s t statistic One-sided Two-sided There can only be on direction of effect The investigator is only interested in one direction of effect. Greater power to detect difference in expected direction Two-sided Difference could go in either direction More conservative

Student’s t statistic One group Two groups One sided Two sided A single mean differs from a known value in a specific direction. e.g. mean > 0 Two means differ from one another in a specific direction. e.g., mean2 < mean1 Two sided A single mean differs from a known value in either direction. e.g., mean ≠ 0 Two means are not equal. That is, mean1 ≠ mean2

Student’s t statistic SPSS One Group: Analyze>Compare Means> One-Sample T Test Two Groups (Matched Samples): Analyze>Compare Means> Paired Samples T Test Two Groups: Analyze>Compare Means> Independent Samples T Test

Student’s t statistic R The default t-test is t.test(x, y = NULL, alternative = "two.sided", mu = 0, paired = False, var.equal = FALSE, conf.level = 0.95) Where x and y are two data for two numeric variables. We need to change only default settings matching with the case we want to perform. For example, One Group: t.test(x, alternative=“greater”, mu=30) Two Groups (Matched Samples): t.test(x, y, alternative= "less", mu = 0, paired = TRUE,) Two Groups: t.test(x,y, alternative=“greater”, mu=0, var.equal = TRUE)

Student’s t-statistic MS Excel (in Tools -> Data Analysis…) One Group: Not available Two Groups (Matched Samples): t-Test: Paired two sample for mean Two Groups (Independent Samples): t-Test: Two-Sample Assuming Equal Variances t-Test: Two-Sample Assuming Unequal Variances

Example 1 Consider the heights of children 4 to 12 years old in dataset 1 of our course website (variable ‘hgt’). Suppose we want to test if the average height (µ) for this age group in the population is 50 inches, using our sample of 60 children. We will use 5% level of significance. This is a one-sample, two-sided test.

Example 1 Hypotheses: Computation in Excel: Ha: µ ≠ 50 Computation in Excel: Excel does not have a 1-sample test, but we can fool it. Create a dummy column parallel to the hgt column with an equal number of cells, all set to 0.0 Run the Matched sample test using hgt and the dummy column and 50 as the hypothesized mean difference. The p-value for two tail test is 0.0092

Example 1 Using SPSS: Using R, Analyze> Caompare Means >One Sample T Test > Select hgt > Test value: 50 > ok P-value is .009 Using R, t.test(df1$hgt, mu=50) Two-tail p-value is .0092

Example 2 Suppose we want to compare the height of two groups (hgt in each sex from dataset). H0: Mean heights are equal for the two sexes. Ha: Mean heights are not equal Using MS-Excel: Sort data by sex (data>sort>by:sex) In Data Analysis… t-test:Two-sample Assuming equal variance select the range of hgt for all sex = f as Variable 1 Range select the range of hgt for all sex = m as Variable 2 Range P-value for two-sided test = 0.205

Example 2 Using SPSS: Analyze>Compare Means>Independent-Samples T-test> Select hgt as a Test Variable Select sex as a Grouping Variable In Define Groups, type f for Group 1 and m for Group 2 Click Continue then OK It gives us the p-value 0.205. We can assume equal variance as the p-value of F statistic for testing equality of variances is 0.845.

Sign Test (Nonparametric) Use: (1) Compare the median of a single group with a specified value (instead of single sample t-test). (2) Compare medians of two matched groups (instead of Two matched samples t-test) Test Statistic: Number of positive difference of (median-c). The number of positive difference follows a Binomial distribution.

Sign Test (Nonparametric) SPSS: Analyze> Nonparametric Tests> Binomial R: sign.test(x, y = NULL, md = 0, alternative = "two.sided", conf.level = 0.95) For testing the median (md) of a single sample, use data only for one variable. To compare paired data, use two paired variables. NB: This test requires the BSDA package

Wilcoxon Signed-Rank Test: USE: Compares medians of two paired samples. Test Statistic: Consider n pairs of data of two variables x and Y, then the following statistic is known as Wilcoxon signed rank statistic. WS = Sum of the rank of positive differences after assigning ranks to the absolute value of differences.

Wilcoxon Rank-Sum Test Use: Compares medians of two independent groups. Test Statistic: Let, X and Y be two samples of sizes m and n. Suppose N=m+n. Compute the rank of all N observations. Then, the statistic, Wm= Sum of the ranks of all observations of variable X.

Wilcoxon Signed-Rank Test & Wilcoxon Rank-Sum Test SPSS: Two Matched Groups: Analyze> Nonparametric Tests> 2 Related Samples Two Groups: Analyze> Nonparametric Tests> 2 Independent Samples

Wilcoxon Signed-Rank Test: /Wilcoxon Rank-Sum Test The default test is wilcox.test(x, y, alternative = "two.sided", mu = 0, paired = FALSE, exact = FALSE, conf.int = FALSE, conf.level = 0.95) Two matched Groups: wilcox.test(x, y, alternative = “less", paired = TRUE) Two Groups: wilcox.test(x, y, alternative = “greater“)

Example 3 (two matched samples) Subject Hours of Sleep Difference Rank Ignoring Sign Drug Placebo 1 6.1 5.2 0.9 3.5 2 7.0 7.9 -0.9 3 8.2 3.9 4.3 10 4 7.6 4.7 2.9 7 5 6.5 5.3 1.2 6 8.4 5.4 3.0 8 6.9 4.2 2.7 6.7 0.6 9 7.4 3.8 3.6 5.8 6.3 -0.5 3rd & 4th ranks are tied hence averaged. P-value of this test is 0.02. Hence the test is significant at any level more than 2%, indicating the drug is more effective than placebo.

Proportion Tests Use Test for equality of two Proportions E.g. proportions of subjects in two treatment groups who benefited from treatment. Test for the value of a single proportion E.g., to test if the proportion of smokers in a population is some specified value (less than 1)

Proportion Tests Formula One Group: Two Groups:

Proportion Test SPSS: R: The default tests are: One Group: Analyze> Nonparametric Tests> Binomial Two Groups? R: The default tests are: One Group: binom.test(x, n, p = 0.5, alternative = "two.sided", conf.level = 0.95) Two Groups: prop.test(c(x,y), c(m,n), p = NULL, alternative = "two.sided", conf.level = 0.95, correct = TRUE) X, Y are the number of successes and m and n are the sample sizes

Example 4: Proportion of males in Dataset 1 n=60 and there are 30 males binom.test(30,60) returns a p-value of 1.0. SPSS: recode sex as numeric - Transform> Recode>Into Different Variables> Make all selections there and click on Change after recoding character variable into numeric. Analyze> Nonparametric test> Binomial> select Test variable> Test proportion Set null hypothesis = 0.5 The p-value = 1.0

Chi-square statistic USE Assumptions Testing the population variance σ2= σ02. Testing the goodness of fit. Testing the independence/ association of attributes Assumptions Sample observations should be independent. Cell frequencies should be >= 5. Total observed and expected frequencies are equal

Chi-square statistic Formula: If xi (i=1,2,…n) are independent and normally distributed with mean µ and standard deviation σ, then, If we don’t know µ, then we estimate it using a sample mean and then,

Chi-square statistic For a contingency table we use the following chi- square test statistic,

Chi-square statistic SPSS: Analyze> Descriptive stat> Crosstabs> statistics> Chi-square Select variables. Click on Cell button to select items you want in cells, rows, and columns.

Example 5 (class demonstration) Make a contingency table using two variables sex and grp from our dataset. Analyze> Descriptive statistics> crosstabs> select variables for rows and columns Statistics> Chi-square> Continue> Cells> selection> ok. It will give us a contingency table and p-value of Pearson Chi-square Tests. For this particular case, the p-value of Pearson-Chi-square test is 0.549 and d.f. is 2.

F-statistic Use: Testing the equality of population variances. Testing the significance of difference of several means in analysis of variance.

F-statistic Let X and Y be two independent Chi-square variables with n1 and n2 d.f. respectively, then the following statistic follows a F distribution with n1 and n2 d.f. Let, X and Y are two independent normal variables with sample sizes n1 and n2. Then the following statistic follows a F distribution with n1 and n2 d.f. Where, sx2 and sy2 are sample variances of X and Y.

F-statistic Hypotheses: H0: µ1= µ2=…. =µn Ha: µ1≠ µ2 ≠ …. ≠µn Comparison will be done using analysis of variance (ANOVA) technique. ANOVA uses F statistic for this comparison. The ANOVA technique will be covered in another class session.