library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.2.1     ✔ readr     2.2.0
## ✔ forcats   1.0.1     ✔ stringr   1.6.0
## ✔ ggplot2   4.0.3     ✔ tibble    3.3.1
## ✔ lubridate 1.9.5     ✔ tidyr     1.3.2
## ✔ purrr     1.2.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
dfps_data <- read_csv("dfps_data.csv")
## Rows: 3121 Columns: 6
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (4): Program, County, Region, Confirmed Victims
## dbl (1): Fiscal Year
## num (1): # of Victims
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
head(dfps_data)
## # A tibble: 6 × 6
##   `Fiscal Year` Program County     Region    `Confirmed Victims` `# of Victims`
##           <dbl> <chr>   <chr>      <chr>     <chr>                        <dbl>
## 1          2025 DCI     Hutchinson 1-Lubbock Not Confirmed                    1
## 2          2025 DCI     Lubbock    1-Lubbock Not Confirmed                   36
## 3          2025 DCI     Lubbock    1-Lubbock Confirmed Victim                 4
## 4          2025 DCI     Ochiltree  1-Lubbock Not Confirmed                    1
## 5          2025 DCI     Potter     1-Lubbock Not Confirmed                   13
## 6          2025 DCI     Potter     1-Lubbock Confirmed Victim                 1
names(dfps_data)
## [1] "Fiscal Year"       "Program"           "County"           
## [4] "Region"            "Confirmed Victims" "# of Victims"
bexar_data <- dfps_data %>%
  filter(County == "Bexar")
head(bexar_data)
## # A tibble: 6 × 6
##   `Fiscal Year` Program County Region        `Confirmed Victims` `# of Victims`
##           <dbl> <chr>   <chr>  <chr>         <chr>                        <dbl>
## 1          2025 DCI     Bexar  8-San Antonio Not Confirmed                  115
## 2          2025 DCI     Bexar  8-San Antonio Confirmed Victim                16
## 3          2025 RCI     Bexar  8-San Antonio Not Confirmed                  283
## 4          2025 RCI     Bexar  8-San Antonio Confirmed Victim                11
## 5          2024 DCI     Bexar  8-San Antonio Not Confirmed                  129
## 6          2024 DCI     Bexar  8-San Antonio Confirmed Victim                31
nrow(bexar_data)
## [1] 40
bexar_data
## # A tibble: 40 × 6
##    `Fiscal Year` Program County Region        `Confirmed Victims` `# of Victims`
##            <dbl> <chr>   <chr>  <chr>         <chr>                        <dbl>
##  1          2025 DCI     Bexar  8-San Antonio Not Confirmed                  115
##  2          2025 DCI     Bexar  8-San Antonio Confirmed Victim                16
##  3          2025 RCI     Bexar  8-San Antonio Not Confirmed                  283
##  4          2025 RCI     Bexar  8-San Antonio Confirmed Victim                11
##  5          2024 DCI     Bexar  8-San Antonio Not Confirmed                  129
##  6          2024 DCI     Bexar  8-San Antonio Confirmed Victim                31
##  7          2024 RCI     Bexar  8-San Antonio Not Confirmed                  264
##  8          2024 RCI     Bexar  8-San Antonio Confirmed Victim                20
##  9          2023 DCI     Bexar  8-San Antonio Not Confirmed                   85
## 10          2023 DCI     Bexar  8-San Antonio Confirmed Victim                16
## # ℹ 30 more rows
bexar_data <- bexar_data %>% mutate(`# of Victims` = as.numeric(`# of Victims`))
class(bexar_data$`# of Victims`)
## [1] "numeric"
bexar_wide <- bexar_data %>% select(`Fiscal Year`, Program, `Confirmed Victims`, `# of Victims`) %>% pivot_wider(names_from = `Confirmed Victims`, values_from = `# of Victims`) 
head(bexar_wide)
## # A tibble: 6 × 4
##   `Fiscal Year` Program `Not Confirmed` `Confirmed Victim`
##           <dbl> <chr>             <dbl>              <dbl>
## 1          2025 DCI                 115                 16
## 2          2025 RCI                 283                 11
## 3          2024 DCI                 129                 31
## 4          2024 RCI                 264                 20
## 5          2023 DCI                  85                 16
## 6          2023 RCI                 254                 11
bexar_wide <- bexar_wide %>% rename(Not.Confirmed = `Not Confirmed`, Confirmed = `Confirmed Victim`)
names(bexar_wide)
## [1] "Fiscal Year"   "Program"       "Not.Confirmed" "Confirmed"
nrow(bexar_wide)
## [1] 20
summary(bexar_wide)
##   Fiscal Year        Program   Not.Confirmed     Confirmed    
##  Min.   :2016   Length   :20   Min.   : 77.0   Min.   : 7.00  
##  1st Qu.:2018   N.unique : 2   1st Qu.:102.5   1st Qu.:14.25  
##  Median :2020   N.blank  : 0   Median :191.5   Median :17.00  
##  Mean   :2020   Min.nchar: 3   Mean   :249.8   Mean   :21.20  
##  3rd Qu.:2023   Max.nchar: 3   3rd Qu.:351.5   3rd Qu.:24.75  
##  Max.   :2025                  Max.   :756.0   Max.   :74.00

Testable Hypothesis

This analysis examines whether the number of not-confirmed victims is associated with the number of confirmed victims in Bexar County child abuse and neglect investigations. The data include observations from fiscal years 2016 through 2025 for the DCI and RCI programs. The purpose of this analysis is to determine whether differences in not-confirmed victim counts are associated with differences in confirmed victim counts.

Dependent Variable

The dependent variable is the number of confirmed victims reported in completed child abuse and neglect investigations. This is the outcome of interest because the analysis is examining whether the number of not-confirmed victims is associated with the number of confirmed victims.

Dependent variable (x): Confirmed victim count

Independent Variable

The independent variable is the number of not-confirmed victims reported in completed child abuse and neglect investigations. This variable is used to examine whether differences in not-confirmed victim counts are associated with differences in confirmed victim counts.

Independent variable (y): Not-confirmed victim count

Null Hypothesis

H0: There is no association between the number of not-confirmed victims and the number of confirmed victims in Bexar County program-year observations.

Alternative Hypothesis

H1: There is an association between the number of not-confirmed victims and the number of confirmed victims in Bexar County program-year observations.

Explanation of the Hypothesis

This hypothesis was chosen to examine whether there is a relationship between the number of not-confirmed victims and confirmed victims in Bexar County. The data include both types of victim counts for each year and for both the DCI and RCI programs. This makes it possible to compare the two variables and see if they tend to change together.

The dependent variable in this analysis is the number of confirmed victims, and the independent variable is the number of not-confirmed victims. The hypothesis can be tested because both variables are numerical and there are 20 observations covering the two programs from 2016 through 2025.

The earlier analysis found a correlation of 0.3725 between the two variables. This shows a positive relationship, although it is not a very strong relationship. This does not mean that one variable causes the other. It only shows that the two variables are related in the observations included in this dataset.