# Quantitative Data Analysis I: Hypotheses, Probability, Chi-Square and

21 Slides201.60 KB

Quantitative Data Analysis I: Hypotheses, Probability, Chi-Square and T-Tests SI0030 Social Research Methods Week 5 Luke Sloan

Introduction Formulating Hypotheses Selecting Statistical Tests Understanding Probability (‘p’ values) Chi-Square Test for Independence Independent Samples t-Test Paired Samples t-Test

Formulating Hypotheses I In Social Science we use the ‘Scientific Method’: – Formulate hypotheses – Collect data – Test hypotheses – Interpret results To formulate a hypothesis: – Reasonable justification for relationship – Past research or observation – Must be disprovable (Popper’s Falsification Theory) Dependent variable (x) can be predicted through independent variable (y)

Formulating Hypotheses II H0 The Null Hypothesis – No relationship exists between dependent and independent variables – e.g. there is no relationship between income and age H1 The Alternative Hypothesis – Some relationship exists between dependent and independent variables – e.g. there is a relationship between income and age How do we test hypotheses?

Selecting Statistical Tests Remember the levels of measurement (week 1)! Dependent Variable (y) Nominal or Ordinal Independen t Variable (x) Nominal or Ordinal Interval Nominal or Ordinal Interval Interval Test to Use Example Notes Chi-square test for independence t-test (paired or independent samples) Correlation Regression Skateboard ownership (y) and Sex (x) Income (y) and Sex (x) Expected frequency must not be lower than 5 in any cell Ideally you need 50 in each of the groups that you are comparing Income (y) and Age (x) Relationship must be linear Note the relationship between dependent and independent

Understanding Probability I Where does probability come into this? We use statistical tests to assess whether the hypothesised differences exist and whether they are ‘genuine’ or due to ‘random chance’ e.g. how confident can we be that any difference between male and female salaries is not simply a coincidence? Remember last week – samples and populations!

Understanding Probability II Probability is the mathematical likelihood of a given event occurring What is the probability that I will – Roll and six on a dice? – Toss a coin and get heads? – Have a birthday in the next 12 months? – Win the lottery?

Understanding Probability III In statistical tests we measure probabilities using ‘p’ values P-Value 0.001 0.01 0.05 0.50 0.99 % 0.1% 1.0% 5.0% 50% 99% A p-value refers to how likely something is to have happened by random chance For the alternative hypothesis to be accepted, the p-value must be equal to or less than 0.05 This is referred to as the level of STATISTICAL SIGNIFICANCE

Understanding Probability IV For example: – H0 There is no relationship between income and sex – H1 There is a relationship between income and sex If we get a p-value of 0.04, what does this mean? It means that we are 96% confident that any difference in income between men and women is not due to random chance We therefore reject the null hypothesis and accept the alternative hypothesis

Chi-Square Test for Independence I Can be used to establish whether there are statistically significant relationships between two categorical variables (nominal/ordinal) e.g. Is there a statistically significant relationship between skateboard ownership and sex? In other words, is skateboard ownership INDEPENDENT of sex?

Chi-Square Test for Independence II The chi-square test is effectively a crosstabulation in which differences between the expected and actual values are measured Expected the distribution of responses if there was no relationship Actual how the responses are actually distributed A large discrepancy between the two measures may indicate disproportionality i.e. a statistically significant relationship

Chi-Square Test for Independence III H0 There is no relationship between Sex and Political Party Candidature H1 There is a relationship between Sex and Political Party Candidature gender * party Crosstabulation party gender Male Count Expected Count % within party, 5cat (derived) Female Count Expected Count % within party, 5cat (derived) Total Count Expected Count % within party, 5cat (derived) Con 933 903.3 Lab 736 748.5 LD 692 709.2 Total 2361 2361.0 70.1% 66.7% 66.2% 67.9% 398 367 353 1118 427.7 354.5 335.8 1118.0 29.9% 33.3% 33.8% 32.1% 1331 1103 1045 3479 1331.0 1103.0 1045.0 3479.0 100.0% 100.0% 100.0% 100.0% Look at the observed and expected counts – what do you think?

Chi-Square Test for Independence IV Chi-Square Tests Pearson Chi-Square Value 4.994a 2 Asymp. Sig. (2sided) .082 df Likelihood Ratio 5.017 2 .081 Linear-by-Linear Association 4.288 1 .038 N of Valid Cases 3479 a. 0 cells (.0%) have expected count less than 5. The minimum expected count is 335.82. The p-value (Asymp. Sig. 2-sided) is 0.082. This means that we can only be just under 92% sure that any relationship is not due to chance or error – this is not enough! The relationship between sex and political party candidature is not significant (x2 4.99, 2 df., p 0.08), therefore we accept the null hypothesis.

Independent Samples t-Test I Can be used to establish whether there are statistically significant relationships between one categorical variable (nominal/ordinal) and one interval variable e.g. Is there a statistically significant relationship between sex and income? Uses the mean from each group to establish whether differences are significant at the 0.05 level (do 95% confidence intervals overlap)

Independent Samples t-Test II The term ‘INDEPENDENT’ refers to the fact that the groups within the categorical variable are independent of each other i.e. it is not possible for any respondent to be in both groups (samples) at the same time Think about the height of male and female students in this class – an independent sample t-test would establish whether there is a true (real) difference in height that can be explained by sex

Independent Samples t-Test III Data must be ‘normally distributed’ Run a histogram to check (normal curve) Consult Bryman (2004:96) Samples must have equal (or very similar) variance SPSS tests for this using Levene’s Test for Equality of Variances We want this test to be not significant (p 0.05)

Independent Samples t-Test IV H0 There is no difference in the mean age of UKIP and Green candidates H1 There is difference in the mean age of UKIP and Green candidates A somewhat subjective judgment of normality

Independent Samples t-Test V Notably higher mean age for UKIP candidates Very similar standard deviations – indicative of similar variance? Group Statistics Parties coded N What was your age last birthday Green UKIP 358 162 Mean 49.57 59.51 Levene’s Test is NOT SIGNIFICANT (p 0.05) indicating equal variances Std. Deviation 13.816 13.676 Std. Error Mean .730 1.074 The t-test is significant, indicating that the difference in mean age is significant (p 0.05) Independent Samples Test Levene's Test for Equality of Variances t-test for Equality of Means F What was your age last birthday Equal variances assumed Equal variances not assumed Sig. .953 t Sig. (2tailed) df Mean Std. Error Difference Difference 95% Confidence Interval of the Difference Lower Upper .329 -7.624 518 .000 -9.943 1.304 -12.505 -7.380 -7.653 313.867 .000 -9.943 1.299 -12.499 -7.386

Independent Samples t-Test VI If Levene’s test is significant (p 0.05) then use the t-test results reported in the second row (‘equal variances not assumed’) An independent sample t-test was conducted to compare the ages of local government candidates from the Green Party and UKIP. Levene’s test for equality of variance was not significant (f 0.95, p 0.33) and there was a significant difference (t -7.62, 518 d.f., p 0.05) in the mean age of candidates [explore the relationship and link to hypotheses]

Paired Samples t-Test Very similar to an independent samples t-test, but both samples consist of the same respondents (aka repeated measures) e.g. comparing income at t1 and t2 – is there a significant difference? See Pallant (2005:209) for further detail

Summary Importance of hypotheses Applicability of statistical tests and probability Chi-square test for categorical data t-test for interval and categorical data Note: p never equals 0 – Generally only p 0.05 or p 0.05 NEXT WEEK: tests for interval data – correlation and simple linear regression