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.2
## ✔ ggplot2   4.0.0     ✔ tibble    3.3.0
## ✔ lubridate 1.9.4     ✔ tidyr     1.3.1
## ✔ purrr     1.1.0     
## ── 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)
district <- read_excel("district.xls")
district_clean <- district |> select(DZCAMPUS,DPETALLC,DPSTURNR) |> drop_na()
alimodel <- lm(DPSTURNR~DZCAMPUS+DPETALLC,data = district_clean)
summary(alimodel)
## 
## Call:
## lm(formula = DPSTURNR ~ DZCAMPUS + DPETALLC, data = district_clean)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -21.979  -6.533  -1.668   4.394  78.095 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  2.186e+01  3.531e-01  61.902   <2e-16 ***
## DZCAMPUS     8.477e-02  7.151e-02   1.186   0.2360    
## DPETALLC    -2.188e-04  9.649e-05  -2.268   0.0235 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.89 on 1197 degrees of freedom
## Multiple R-squared:  0.01645,    Adjusted R-squared:  0.01481 
## F-statistic: 10.01 on 2 and 1197 DF,  p-value: 4.869e-05
plot(alimodel,which = 1)