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)
library(ggplot2)
district<-read_excel("district.xls")
district_variables<-lm(DDA00A001222R~DPSTKIDR+DPFEAINSK+DPFEAOPFK+DPETALLC,data=district)

summary(district_variables)
## 
## Call:
## lm(formula = DDA00A001222R ~ DPSTKIDR + DPFEAINSK + DPFEAOPFK + 
##     DPETALLC, data = district)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -52.297  -8.997  -0.259   8.501  48.170 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  5.421e+01  3.322e+00  16.319   <2e-16 ***
## DPSTKIDR    -4.028e-01  1.649e-01  -2.442   0.0147 *  
## DPFEAINSK   -6.763e-04  4.423e-04  -1.529   0.1265    
## DPFEAOPFK    1.326e-04  1.479e-04   0.897   0.3701    
## DPETALLC     5.973e-05  3.207e-05   1.862   0.0628 .  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 13.35 on 1193 degrees of freedom
##   (9 observations deleted due to missingness)
## Multiple R-squared:  0.006683,   Adjusted R-squared:  0.003353 
## F-statistic: 2.007 on 4 and 1193 DF,  p-value: 0.09134

Adjusted R-squared is .0033 which means the model accounts for .3% of the variance in teacher to student ratio.

plot(district_variables,which=1)

Visual review shows that this data is not linear.