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
library(readxl)

hotline_data <- read_csv("hotline_data.csv")
## Rows: 2184 Columns: 11
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (5): State, Timeframe, Call Average Time to Answer, Text Average Time to...
## dbl (6): Number of Routed Calls, Call Answer Rate, Number of Routed Texts, T...
## 
## ℹ 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.
hotline_clean <- na.omit(hotline_data)
answer_model <- lm(`Call Answer Rate`~`Number of Routed Calls`+`Number of Routed Texts`+`Number of Routed Chats`,data=hotline_clean)

summary(answer_model)
## 
## Call:
## lm(formula = `Call Answer Rate` ~ `Number of Routed Calls` + 
##     `Number of Routed Texts` + `Number of Routed Chats`, data = hotline_clean)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.47692 -0.03536  0.01960  0.04880  0.13873 
## 
## Coefficients:
##                            Estimate Std. Error t value Pr(>|t|)    
## (Intercept)               8.575e-01  2.726e-03 314.557  < 2e-16 ***
## `Number of Routed Calls` -3.578e-06  5.928e-07  -6.035 2.04e-09 ***
## `Number of Routed Texts`  1.075e-05  2.668e-06   4.028 5.94e-05 ***
## `Number of Routed Chats`  7.090e-06  3.827e-06   1.853   0.0641 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.07785 on 1381 degrees of freedom
## Multiple R-squared:  0.03037,    Adjusted R-squared:  0.02826 
## F-statistic: 14.42 on 3 and 1381 DF,  p-value: 2.993e-09

The P-value of the whole model is very small. Adjusted R-squared is 0.03, which means that the model accounts for 3% of the variance in weight. The significant variables are Number of Routed Calls and Number of Routed Texts. The insignificant variable is the Number of Routed Chats.

As the Number of Routed Calls goes up by one, the Answer Rate decreases by -0.000003578 seconds. As the Number of Routed Texts goes up by one, the Answer Rate increases by 0.00001075 seconds.

plot(answer_model,which=1)

The model may violate the assumption of linearity because the red line shows a slight curve.