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(pastecs)
##
## Attaching package: 'pastecs'
##
## The following objects are masked from 'package:dplyr':
##
## first, last
##
## The following object is masked from 'package:tidyr':
##
## extract
district<-read_excel("district.xls")
pastecs::stat.desc(district$DPSTURNR)
## nbr.val nbr.null nbr.na min max range
## 1.200000e+03 1.200000e+01 7.000000e+00 0.000000e+00 1.000000e+02 1.000000e+02
## sum median mean SE.mean CI.mean.0.95 var
## 2.580620e+04 1.950000e+01 2.150517e+01 3.166699e-01 6.212887e-01 1.203358e+02
## std.dev coef.var
## 1.096977e+01 5.100991e-01
Variable is teacher turnover. We have the median, mean, standard deviation and variance.
district_clean<-district |> drop_na(DPSTURNR) %>%filter(DPSTURNR>0)
hist(district_clean$DPSTURNR)
district_clean<-district_clean %>% mutate(DPSTURNR_SQRT=sqrt(DPSTURNR))
hist(district_clean$DPSTURNR_SQRT)