Limited access to subscription-based statistical software poses obstacles when students want to apply the skills they acquired in college. Although students may learn programs like SPSS or Stata while at the university, they often find themselves unable to continue using these programs after graduation, making their acquired skills obsolete. As an open-source software program, R offers a solution to this challenge. It is freely accessible to anyone, including students, after they graduate. Therefore, I decided to write a freely available book for those interested in becoming crime analysts, focusing on learning statistics without delving too deeply into mathematics. Moreover, this book emphasizes practical applications by utilizing R for data analysis, ensuring students can develop relevant skills beyond the university. I hope that students can easily follow the instructions in this book and replicate the same outcomes using the provided data. This practical experience will demonstrate the value of statistics and R, ideally inspiring students to further their learning in these areas.
Conditions of Use
This book is licensed under a Creative Commons License (CC BY-NC-SA). You can download the ebook Basic Statistics Using R for Crime Analysis for free.
- Title
- Basic Statistics Using R for Crime Analysis
- Publisher
- PA-ADOPT
- Author(s)
- Jaeyong Choi
- Published
- 2024-06-11
- Edition
- 1
- Format
- eBook (pdf, epub, mobi)
- Pages
- 72
- Language
- English
- License
- CC BY-NC-SA
- Book Homepage
- Free eBook, Errata, Code, Solutions, etc.
About PA-ADOPT About OER About the Author Table of Contents Preface Chapter 1. Introduction to Crime Data Analysis, R and RStudio Data Analysis in the Criminal Justice System Importance of Statistics and Statistical Software Programs for Crime Analysts What Is R and RStudio? Setting Up R and RStudio Calculating Using R Step 1. Launch RStudio Step 2. Choose Script or Console Step 3. Type R Code R Packages (How To Install and Load Packages) Conclusion Chapter 2. Introduction to Data Formations and Graphics The 2012 General Social Survey Importing the Data Using the Haven Package View Function Summary Function Categorical vs Numerical Variables Dplyr Package Ggplot2 Package Chapter 3. Creating a New Variable and Producing Summary Statistics Uniform Crime Report Readxl Package Rename Function Crime Rates Mutate Function Select Function Arrange Function Cut Function Group_By Function Geom_Histogram() Chapter 4. Central Tendency and Variability Central Tendency Variability Gapminder Data Package ? And Data Subset Function Mean and Median Mode Variance and Standard Deviation Conclusion References Chapter 5. Reliability of a Scale Reliability vs Validity National Crime Victimization Survey Test-Retest and Internal Consistency Methods Cronbach’s Alpha Coefficient Importing the Data in Stata Format Guardianship Psych Package Alpha Function Reporting the Results Regarding the Internal Consistency Conclusion References Chapter 6. Chi-Squared Test Hypothesis Testing NHST Steps Chi-Squared Test NHST Steps for Chi-Squared Test Step 1: Formulate the Null and Alternative Hypotheses. Step 2: Calculate the Test Statistic. Step 3: Determine the Probability (P-Value) of Obtaining a Test Statistic at Least as Extreme as the Observed Value, Assuming no Relationship Exists. Step 4: If the P-Value Is very small, Typically Less Than 5%, Reject the Null Hypothesis. Step 5: If the P-Value is not small, Typically 5% or Greater, Retain the Null Hypothesis. Reporting the Results Conclusion References Chapter 7. T-Test Introduction to T-Test Cognitive Behavioral Therapy Independent-Samples T-Test NHST Steps for Independent-Samples T-Test Step 1: Formulate the null and alternative hypotheses. Step 2: Calculate the test statistic. Step 3: Determine the probability (P-Value) of Obtaining a Test Statistic at Least as Extreme as the Observed Value, Assuming no Relationship Exists. Steps 4 & 5: If the p-value is Very Small, Typically Less Than 5%, Reject the Null Hypothesis, but if the P-Value is Not Small, Typically 5% or Greater, Retain the Null Hypothesis. Reporting the Results of an Independent-Samples T-Test Density Plot Paired-Samples T-Test NHST Steps for Paired-Samples T-Test Step 1: Formulate the Null and Alternative Hypotheses. Step 2: Calculate the Test Statistic. Step 3: Determine the Probability (P-Value) of Obtaining a Test Statistic at Least as Extreme as the Observed Value, Assuming no Relationship Exists. Steps 4 & 5: If the P-Value is Very Small, Typically Less Than 5%, Reject the Null Hypothesis, but if the P-Value is Not Small, Typically 5% or Greater, Retain the Null Hypothesis. Reporting the Results of a Paired-Samples T-Test Conclusion References Chapter 8. Analysis of Variance Introduction to ANOVA Media Exposure and Perceptions of the Police One-Way Analysis of Variance NHST Steps for One-Way ANOVA Step 1: Formulate the Null and Alternative Hypotheses. Step 2: Calculate the Test Statistic. Step 3: Determine the Probability (P-Value) of Obtaining a Test Statistic at Least as Extreme as the Observed Value, Assuming no Relationship Exists. Steps 4 & 5: If the P-Value is Very Small, Typically Less Than 5%, Reject the Null Hypothesis, but if the P-Value is Not Small, Typically 5% or Greater, Retain the Null Hypothesis. Reporting the Results From One-Way ANOVA Post-Hoc Test Conclusion References Chapter 9. Correlation Introduction to Correlation Pearson Product-Moment Correlation Coefficient Computing Correlation Using the USArrests Dataset NHST Steps for Pearson’s R Correlation Coefficient Step 1: Formulate the Null and Alternative Hypotheses. Step 2: Calculate the Test Statistic. Step 3: Determine the Probability (P-Value) of Obtaining a Test Statistic at Least as Extreme as the Observed Value, Assuming no Relationship Exists. Steps 4 & 5: If the P-Value is Very Small, Typically Less Than 5%, Reject the Null Hypothesis, but if the P-Value is Not Small, Typically 5% or Greater, Retain the Null Hypothesis. Reporting the Results for Pearson’s Product-Moment Correlation Coefficient Assumptions That Need To Be Met To Perform Correlation Analysis Scatter Plot Conclusion References Chapter 10. Linear Regression Introduction to Regression Simple Linear Regression Vs. Multiple Linear Regression Ordinary Least Squares (OLS) Model Inmate Self-Reported Survey Assumptions of Linear Regression A Scatterplot of Low Self-Control and Risky Lifestyles Checking a Correlation Coefficient Conducting Simple Linear Regression Analysis NHST Steps for Simple Linear Regression Model Step 1: Formulate the Null and Alternative Hypotheses. Step 2: Calculate the Test Statistic. Step 3: Determine the Probability (P-Value) of Obtaining a Test Statistic at Least as Extreme as the Observed Value, Assuming no Relationship Exists. Steps 4 & 5: If the P-value is Very Small, Typically Less Than 5%, Reject the Null Hypothesis, but if the P-Value is Not Small, Typically 5% or Greater, Retain the Null Hypothesis. Reporting the Results From the Simple Linear Regression Model Model Significance for Simple Linear Regression Step 1: Formulate the Null and Alternative Hypotheses. Step 2: Calculate the Test Statistic. Step 3: Determine the Probability (P-Value) of Obtaining a Test Statistic at Least as Extreme as the Observed Value, Assuming no Relationship Exists. Steps 4 & 5: If the P-Value is Very Small, Typically Less Than 5%, Reject the Null Hypothesis, but if the P-Value is Not Small, Typically 5% or Greater, Retain the null Hypothesis. Reporting the Model Significance for the Simple Linear Regression Model Conducting Multiple Linear Regression Model Fit for Linear Regression Conclusion References