library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.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(ggplot2)
library(stats)
Training_Cleaned_Filtered<-read_csv("Training_Cleaned_Filtered.csv")
## New names:
## Rows: 1912 Columns: 6
## ── Column specification
## ──────────────────────────────────────────────────────── Delimiter: "," chr
## (2): County, Provider Name dbl (4): ...1, All Students (7/1/2018 - 6/30/2022),
## Percent Received Credent...
## ℹ 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.
## • `` -> `...1`
model <- lm(`All Students Percent Successfully Completed`~`All Students (7/1/2018 - 6/30/2022)`, data = Training_Cleaned_Filtered)

summary(model)
## 
## Call:
## lm(formula = `All Students Percent Successfully Completed` ~ 
##     `All Students (7/1/2018 - 6/30/2022)`, data = Training_Cleaned_Filtered)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1151.48   -23.75    -5.24    16.86   942.22 
## 
## Coefficients:
##                                       Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                           11.07652    2.83061   3.913 9.43e-05 ***
## `All Students (7/1/2018 - 6/30/2022)`  0.37359    0.00654  57.119  < 2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 107.8 on 1910 degrees of freedom
## Multiple R-squared:  0.6307, Adjusted R-squared:  0.6306 
## F-statistic:  3263 on 1 and 1910 DF,  p-value: < 2.2e-16
ggplot(Training_Cleaned_Filtered,aes(x=`All Students (7/1/2018 - 6/30/2022)`,y=`All Students Percent Successfully Completed`)) + geom_point() + geom_smooth(method='lm',color='blue')
## `geom_smooth()` using formula = 'y ~ x'