# COURSE: JUST 3900 INTRODUCTORY STATISTICS FOR CRIMINAL JUSTICE Instructor: Dr. John J. Kerbs, Associate Professor Joint Ph.D. in Social Work and Sociology.

## Presentation on theme: "COURSE: JUST 3900 INTRODUCTORY STATISTICS FOR CRIMINAL JUSTICE Instructor: Dr. John J. Kerbs, Associate Professor Joint Ph.D. in Social Work and Sociology."— Presentation transcript:

COURSE: JUST 3900 INTRODUCTORY STATISTICS FOR CRIMINAL JUSTICE Instructor: Dr. John J. Kerbs, Associate Professor Joint Ph.D. in Social Work and Sociology Chapter 17: The Chi-Square Statistic © 2013 - - DO NOT CITE, QUOTE, REPRODUCE, OR DISSEMINATE WITHOUT WRITTEN PERMISSION FROM THE AUTHOR: Dr. John J. Kerbs can be emailed for permission at kerbsj@ecu.edu

Parametric & Nonparametric Tests Chapter 17 introduces two non-parametric hypothesis tests using the chi-square statistic: Chapter 17 introduces two non-parametric hypothesis tests using the chi-square statistic: the chi-square test for goodness of fit the chi-square test for goodness of fit the chi-square test for independence. the chi-square test for independence. Chapter 17 also describes two ways of evaluating effect sizes for non-parametric tests Chapter 17 also describes two ways of evaluating effect sizes for non-parametric tests Phi-Coefficients ( ɸ ) Phi-Coefficients ( ɸ ) Cramer’s V (V) Cramer’s V (V)

The term "non-parametric" refers to the fact that the chi ‑ square tests do not The term "non-parametric" refers to the fact that the chi ‑ square tests do not 1. require assumptions about population parameters, or 1. require assumptions about population parameters, or 2. test hypotheses about population parameters. 2. test hypotheses about population parameters. Previous examples of hypothesis tests, such as the t tests and analysis of variance, are parametric tests and they do include assumptions about parameters and hypotheses about parameters. Previous examples of hypothesis tests, such as the t tests and analysis of variance, are parametric tests and they do include assumptions about parameters and hypotheses about parameters. Parametric & Nonparametric Tests

The most obvious difference between the chi ‑ square tests and the other hypothesis tests we have considered (t and ANOVA) is the nature of the data. The most obvious difference between the chi ‑ square tests and the other hypothesis tests we have considered (t and ANOVA) is the nature of the data. For chi ‑ square tests, the data are frequencies for nominal- or ordinal-level data For chi ‑ square tests, the data are frequencies for nominal- or ordinal-level data T-tests and ANOVA examine numerical scores for interval- or ratio-level data T-tests and ANOVA examine numerical scores for interval- or ratio-level data Chi-Square tests have few (if any) assumptions Chi-Square tests have few (if any) assumptions Thus, often called “distribution-free tests” Thus, often called “distribution-free tests” Parametric & Nonparametric Tests

The Chi-Square Test for Goodness-of-Fit TEST #1: chi-square test for goodness-of-fit uses frequency data from a sample to test hypotheses about the shape or proportions of a population. TEST #1: chi-square test for goodness-of-fit uses frequency data from a sample to test hypotheses about the shape or proportions of a population. Each individual in the sample is classified into one category on the scale of measurement Each individual in the sample is classified into one category on the scale of measurement Nominal- or ordinal-level data Nominal- or ordinal-level data The data, called observed frequencies, simply count how many individuals from the sample are in each category. The data, called observed frequencies, simply count how many individuals from the sample are in each category.

Situations for Transforming Scores into Categories Appropriate times for transforming interval- or ratio-level data into nominal- or ordinal-level data for Chi-Square analyses Appropriate times for transforming interval- or ratio-level data into nominal- or ordinal-level data for Chi-Square analyses 1. When it is easier to obtain categorical measurements 1. When it is easier to obtain categorical measurements 2. Original interval- or ratio-level variables violate assumptions for t-tests and ANOVA 2. Original interval- or ratio-level variables violate assumptions for t-tests and ANOVA 3. Original interval- or ratio-level scores have high variance, which can be removed by collapsing interval- or ratio-level scores into nominal or ordinal categories. 3. Original interval- or ratio-level scores have high variance, which can be removed by collapsing interval- or ratio-level scores into nominal or ordinal categories.

The Chi-Square Test for Goodness-of-Fit The null hypothesis specifies the proportion of the population that should be in each category. Examples: The null hypothesis specifies the proportion of the population that should be in each category. Examples: H 0 : No preference among different categories, equal proportions H 0 : No preference among different categories, equal proportions H 1 : Preference among different categories with the population not divided into equal proportions H 1 : Preference among different categories with the population not divided into equal proportions H 0 : No difference in between the proportions for one population and the known proportions for another population H 0 : No difference in between the proportions for one population and the known proportions for another population H 1 : Population proportions are not equal to the values specified by the null hypothesis H 1 : Population proportions are not equal to the values specified by the null hypothesis The proportions from the null hypothesis are used to compute expected frequencies (f e ) that describe how the sample would appear if it were in perfect agreement with the null hypothesis. The proportions from the null hypothesis are used to compute expected frequencies (f e ) that describe how the sample would appear if it were in perfect agreement with the null hypothesis.

Three Ways of Depicting Frequency Distributions NOTE: Boxed Frequencies Approach NOTE: Frequency Table Approach NOTE: Bar-Graph Approach

Chi-Square Test for Independence TEST #2: chi-square test for independence, can be used and interpreted in two different ways: TEST #2: chi-square test for independence, can be used and interpreted in two different ways: 1. Testing hypotheses about the relationship between two variables in a population, or 2. Testing hypotheses about differences between proportions for two or more populations.

Chi-Square Test for Independence Although these two versions of the test for independence appear to be different, they are equivalent and they are interchangeable. Although these two versions of the test for independence appear to be different, they are equivalent and they are interchangeable. The first version of the test emphasizes the relationship between chi-square and a correlation, because both procedures examine the relationship between two variables. The first version of the test emphasizes the relationship between chi-square and a correlation, because both procedures examine the relationship between two variables. The second version of the test emphasizes the relationship between chi-square and an independent-measures t test (or ANOVA) because both tests use data from two (or more) samples to test hypotheses about the difference between two (or more) populations. The second version of the test emphasizes the relationship between chi-square and an independent-measures t test (or ANOVA) because both tests use data from two (or more) samples to test hypotheses about the difference between two (or more) populations.

Chi-Square Test for Independence The first version of the chi-square test for independence views the data as one sample in which each individual is classified on two different variables. The first version of the chi-square test for independence views the data as one sample in which each individual is classified on two different variables. The data are usually presented in a matrix with the categories for one variable defining the rows and the categories of the second variable defining the columns. The data are usually presented in a matrix with the categories for one variable defining the rows and the categories of the second variable defining the columns.

Chi-Square Test for Independence The data, called observed frequencies, simply show how many individuals from the sample are in each cell of the matrix. The data, called observed frequencies, simply show how many individuals from the sample are in each cell of the matrix. The null hypothesis for this test states that there is no relationship (or no association) between the two variables; that is, the two variables are independent. The null hypothesis for this test states that there is no relationship (or no association) between the two variables; that is, the two variables are independent.

The second version of the test for independence views the data as two (or more) separate samples representing the different populations being compared. The second version of the test for independence views the data as two (or more) separate samples representing the different populations being compared. The same variable is measured for each sample by classifying individual subjects into categories of the variable. The same variable is measured for each sample by classifying individual subjects into categories of the variable. The data are presented in a matrix with the different samples defining the rows and the categories of the variable defining the columns. The data are presented in a matrix with the different samples defining the rows and the categories of the variable defining the columns. Chi-Square Test for Independence

The data, again called observed frequencies, show how many individuals are in each cell of the matrix. The data, again called observed frequencies, show how many individuals are in each cell of the matrix. The null hypothesis for this test states that the proportions (the distribution across categories) are the same for all of the populations The null hypothesis for this test states that the proportions (the distribution across categories) are the same for all of the populations Chi-Square Test for Independence

Both chi-square tests use the same statistic. The calculation of the chi-square statistic requires two steps: Both chi-square tests use the same statistic. The calculation of the chi-square statistic requires two steps: 1. The null hypothesis is used to construct an idealized sample distribution of expected frequencies that describes how the sample would look if the data were in perfect agreement with the null hypothesis. Chi-Square Test Statistic

For the goodness of fit test, the expected frequency for each category is obtained by expected frequency = f e = pn (p is the proportion from the null hypothesis and n is the size of the sample) For the test for independence, the expected frequency for each cell in the matrix is obtained by (row total)(column total) (row total)(column total) expected frequency = f e = ──────────────── n Chi-Square Test Statistics NOTE: This n represents the total n for the entire sample in the matrix

2. A chi-square statistic is computed to measure the amount of discrepancy between the ideal sample (expected frequencies from H 0 ) and the actual sample data (the observed frequencies = f o ). A large discrepancy results in a large value for chi-square and indicates that the data do not fit the null hypothesis and the hypothesis should be rejected. A large discrepancy results in a large value for chi-square and indicates that the data do not fit the null hypothesis and the hypothesis should be rejected. Chi-Square Test Statistics

The calculation of chi-square is the same for all chi-square tests: (f o – f e ) 2 (f o – f e ) 2 chi-square = χ 2 = Σ ───── f e f e The fact that chi ‑ square tests do not require scores from an interval or ratio scale makes these tests a valuable alternative to the t tests, ANOVA, or correlation, because they can be used with data measured on a nominal or an ordinal scale. Chi-Square Test Statistic

4-Step Chi-Square Test Goodness of Fit Question: It has long been known that offenders often commit crimes under the influence of drugs. A criminologist wants to examine the drug of choice for drug-involved offenders who committed crimes for which they were arrested while under the influence. A total of 50 drug-using arrestees are sampled and each was asked to indicate which drug was in their system at the time of their offense/arrest. The following data indicate how many arrestees were using any given category of drugs: Question: It has long been known that offenders often commit crimes under the influence of drugs. A criminologist wants to examine the drug of choice for drug-involved offenders who committed crimes for which they were arrested while under the influence. A total of 50 drug-using arrestees are sampled and each was asked to indicate which drug was in their system at the time of their offense/arrest. The following data indicate how many arrestees were using any given category of drugs: The question for this hypothesis test is whether there are any preferences among the four possible choices. Are any of the drugs reported more or less often than would be expected simply by chance? The question for this hypothesis test is whether there are any preferences among the four possible choices. Are any of the drugs reported more or less often than would be expected simply by chance? AlcoholMarijuanaOpiatesOther 181778

4-Step Chi-Square Test Goodness of Fit Step 1: Step 1: State the hypotheses and select the α level. For the chi- square test for goodness of fit, State the hypotheses and select the α level. For the chi- square test for goodness of fit, H 0 : In the general population of drug-using arrestees, there is no difference for the drug of choice at the time of arrest. H 0 : In the general population of drug-using arrestees, there is no difference for the drug of choice at the time of arrest. H 1 : In the general population of drug-using arrestees, one or more of the drugs is preferred as evidenced by their use at the time of arrest. H 1 : In the general population of drug-using arrestees, one or more of the drugs is preferred as evidenced by their use at the time of arrest. Alpha Level (α) = 0.05 Alpha Level (α) = 0.05 AlcoholMarijuanaOpiatesOther 25%

4-Step Chi-Square Test Goodness of Fit

Step 3: Step 3: Calculate the Chi-Square Statistic Calculate the Chi-Square Statistic Step 3a: Compute expected frequencies (f e ) Step 3a: Compute expected frequencies (f e ) Null Hypothesis (H 0 ) specifies proportions for each cell Null Hypothesis (H 0 ) specifies proportions for each cell With a sample of 50 arrestees, the expected frequencies With a sample of 50 arrestees, the expected frequencies for each category of drugs is equal in proportion (25%) for each category of drugs is equal in proportion (25%) for all categories for all categories Step 3b: f e = pn =.25(50) = 12.5 Step 3b: f e = pn =.25(50) = 12.5 Note: p = proportion from null hypothesis (.25) and Note: p = proportion from null hypothesis (.25) and n = total number in sample (i.e., 50) n = total number in sample (i.e., 50)

4-Step Chi-Square Test Goodness of Fit AlcoholMarijuanaOpiatesOther Observed181778 Expected12.5

4-Step Chi-Square Test Goodness of Fit

4-Step Chi-Square Test for Independence Purpose for test: Purpose for test: Use frequency data from the sample to evaluate the relationship between two variables in the population. Each individual in the sample is classified on both of the two variables, which creates a two-dimensional frequency-distribution matrix. The frequency distribution for the sample is then used to test hypotheses about the corresponding frequency distribution for the population.

4-Step Chi-Square Test for Independence Question: It has long been known that offenders who commit misdemeanors and felonies often commit crimes under the influence of drugs. A criminologist wants to examine the drug of choice for drug- involved offenders who committed crimes for which they were arrested while under the influence. A total of 140 offenders (some were arrested for felonies while others were arrested for misdemeanors) are sampled and each was asked to indicate the nature of their arrest and which drug was in their system at the time of their offense/arrest. The following data indicate how many arrestees were using any given category of drugs: Question: It has long been known that offenders who commit misdemeanors and felonies often commit crimes under the influence of drugs. A criminologist wants to examine the drug of choice for drug- involved offenders who committed crimes for which they were arrested while under the influence. A total of 140 offenders (some were arrested for felonies while others were arrested for misdemeanors) are sampled and each was asked to indicate the nature of their arrest and which drug was in their system at the time of their offense/arrest. The following data indicate how many arrestees were using any given category of drugs: The question for this hypothesis test is whether there are any preferences among the four possible choices for these two groups. Are any of the drugs reported more or less often than would be expected simply by chance? The question for this hypothesis test is whether there are any preferences among the four possible choices for these two groups. Are any of the drugs reported more or less often than would be expected simply by chance? AlcoholMarijuanaOpiatesOther Misdemeanors292518880 Felons1115221260 40 20140

4-Step Chi-Square Test for Independence Step 1: Step 1: State the hypotheses and select the α level (α = 0.05). For the chi-square test for independence, State the hypotheses and select the α level (α = 0.05). For the chi-square test for independence, H 0 : There is no relationship between the two variables H 0 : There is no relationship between the two variables H 1 : There is a relationship between the two variables H 1 : There is a relationship between the two variables H 0 : For the general population of arrestees, there is no relationship between offense type (misdemeanor versus felony) and the type of drugs that were reported as being used at the time of arrest H 0 : For the general population of arrestees, there is no relationship between offense type (misdemeanor versus felony) and the type of drugs that were reported as being used at the time of arrest H 1 : For the general population of arrestees, there is a relationship between offense type (misdemeanor versus felony) and the type of drugs that were reported as being used at the time of arrest H 1 : For the general population of arrestees, there is a relationship between offense type (misdemeanor versus felony) and the type of drugs that were reported as being used at the time of arrest H 0 : In the population of arrestees, the proportions in the distribution of drugs reported as being used at the time of arrest for misdemeanors are not different from the proportions in the distribution of drugs reported as being used by arrestees at the time of arrest for felonies. H 0 : In the population of arrestees, the proportions in the distribution of drugs reported as being used at the time of arrest for misdemeanors are not different from the proportions in the distribution of drugs reported as being used by arrestees at the time of arrest for felonies.

4-Step Chi-Square Test for Independence

AlcoholMarijuanaOpiatesOther Misdemeanors(40*80)/140 (20*80)/14080 Felons(40*60)/140 (20*60)/14060 40 20140 AlcoholMarijuanaOpiatesOther Misdemeanors22.9 11.480 Felons17.1 8.660 40 20140

4-Step Chi-Square Test for Independence AlcoholMarijuanaOpiatesOther Misdemeanors22.9 (29)22.9 (25)22.9 (18)11.4 (8)80 Felons17.1 (11)17.1 (15)17.1 (22)8.6 (12)60 40 20140

4-Step Chi-Square Test for Independence

Measuring Effect Size for the Chi- Square Test for Independence When both variables in the chi-square test for independence consist of exactly two categories (the data form a 2 x 2 matrix), it is possible to re-code the categories as 0 and 1 for each variable and then compute a correlation known as a phi-coefficient ( ɸ ) that measures the strength of the relationship. When both variables in the chi-square test for independence consist of exactly two categories (the data form a 2 x 2 matrix), it is possible to re-code the categories as 0 and 1 for each variable and then compute a correlation known as a phi-coefficient ( ɸ ) that measures the strength of the relationship.

The value of the phi-coefficient, or the squared value which is equivalent to an r 2, is used to measure the effect size. The value of the phi-coefficient, or the squared value which is equivalent to an r 2, is used to measure the effect size. When there are more than two categories for one (or both) of the variables, then you can measure effect size using a modified version of the phi-coefficient known as Cramér’s V. When there are more than two categories for one (or both) of the variables, then you can measure effect size using a modified version of the phi-coefficient known as Cramér’s V. The value of V is evaluated much the same as a correlation. The value of V is evaluated much the same as a correlation. Measuring Effect Size for the Chi- Square Test for Independence

NOTE: If you square the phi-coefficient ( ɸ 2 ), you get the percentage of variance accounted for in the association between the two variables (gender and crime type). Percent of Variance Explained as Measured by r 2 Evaluation of Effect Size r 2 = 0.01 (0.01*100 = 1%)Small effect r 2 = 0.09 (0.09*100 = 9%)Medium effect r 2 = 0.25 (0.25*100 = 25%)Large effect

Measuring Effect Size for the Chi- Square Test for Independence: Cramer’s V (Cohen, 1988) NOTE: if df* = 1, then interpret the same as a 2X2 matrix for phi- coefficient effect-size cutoffs

Assumptions and Restrictions for Chi-Square Tests Failure to meet the assumptions of a statistical test can increase the possibility of Type I error and/or cause other problems. Failure to meet the assumptions of a statistical test can increase the possibility of Type I error and/or cause other problems. Important Assumptions/Restrictions for Chi-Square Tests Important Assumptions/Restrictions for Chi-Square Tests 1. Independence of Observations: Each observed frequency is generated by a different individual. Each person can only produce a response that is categorized into one category. 1. Independence of Observations: Each observed frequency is generated by a different individual. Each person can only produce a response that is categorized into one category. 2. Size of Expected Frequencies: Do not perform chi-square tests on a matrix if one or more expected frequencies in any cell(s) is less than 5. 2. Size of Expected Frequencies: Do not perform chi-square tests on a matrix if one or more expected frequencies in any cell(s) is less than 5.

Download ppt "COURSE: JUST 3900 INTRODUCTORY STATISTICS FOR CRIMINAL JUSTICE Instructor: Dr. John J. Kerbs, Associate Professor Joint Ph.D. in Social Work and Sociology."

Similar presentations