library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr 1.2.0 ✔ readr 2.1.6
## ✔ forcats 1.0.1 ✔ stringr 1.6.0
## ✔ ggplot2 4.0.2 ✔ tibble 3.3.1
## ✔ lubridate 1.9.4 ✔ tidyr 1.3.2
## ✔ purrr 1.2.1
## ── 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)
TEA_Data<-read_excel("district.xls")
Distric_model<-lm(DZRVLOCP~DPETALLC+COMMTYPE,data =TEA_Data)
summary(Distric_model)
##
## Call:
## lm(formula = DZRVLOCP ~ DPETALLC + COMMTYPE, data = TEA_Data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -49.798 -13.695 -3.468 11.452 54.019
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 4.724e+00 1.452e+00 3.254 0.00117 **
## DPETALLC 1.332e-04 6.959e-05 1.914 0.05586 .
## COMMTYPEIndependent Town 3.528e+01 3.091e+00 11.414 < 2e-16 ***
## COMMTYPEMajor Suburban 4.332e+01 3.030e+00 14.295 < 2e-16 ***
## COMMTYPEMajor Urban 3.702e+01 8.124e+00 4.556 5.74e-06 ***
## COMMTYPENon-metropolitan Fast Growing 3.945e+01 4.020e+00 9.815 < 2e-16 ***
## COMMTYPENon-metropolitan Stable 3.651e+01 2.035e+00 17.940 < 2e-16 ***
## COMMTYPEOther Central City 3.719e+01 3.898e+00 9.540 < 2e-16 ***
## COMMTYPEOther Central City Suburban 3.827e+01 2.112e+00 18.117 < 2e-16 ***
## COMMTYPERural 3.885e+01 1.704e+00 22.799 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 19.49 on 1192 degrees of freedom
## (5 observations deleted due to missingness)
## Multiple R-squared: 0.3465, Adjusted R-squared: 0.3416
## F-statistic: 70.24 on 9 and 1192 DF, p-value: < 2.2e-16
plot(Distric_model,which=1)

The r square shows that the community type and population explain
34% of the state and local tax received by a school district.
the pvalue is showing that there is propably a high chance that that
rural school district revenue are being effected by their community type
and their total population of children that attend school.