pgx
AI 에이전트를 위한 경량 Postgres, Rust로 구현, 하나의 런타임에서 수천 개의 격리된 데이터베이스 제공
Webster(1970) 방법을 이용해 코호트 생존·학년 진급 비율로 학교 등록을 예측하고, 행렬 투영으로 구현합니다
Projects school enrollment using the cohort survival / grade progression ratio method described in Webster (1970) <doi:10.1080/00220973.1970.11011238>, implemented as a matrix projection. Works at any
데이터RGitHub @localopen온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Projects school enrollment using the cohort survival / grade progression ratio method described in Webster (1970) <doi:10.1080/00220973.1970.11011238>, implemented as a matrix projection. Works at any level of aggregation and any number of grades. Provides functions to compute progression ratios from historical grade-level enrollment and to project future enrollment forward an arbitrary horizon.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗enrollcast projects school enrollment with the cohort survival / grade
progression ratio method, implemented as a matrix projection. It works
on one grade-by-year enrollment series at a time, so you can use it at
any level (school, district, local education agency, or city) and with
any number of grades.
Awesome hex logo provided by Adam Higerd.
install.packages("enrollcast")
Install the development version from GitHub:
# install.packages("pak")
pak::pak("localopen/enrollcast")
library(enrollcast)
# Historical grade-level enrollment (long format).
history <- data.frame(
year = rep(2021:2023, each = 3),
grade = factor(rep(c("K", "1", "2"), 3), levels = c("K", "1", "2")),
enrollment = c(100, 90, 80, 110, 95, 88, 120, 99, 91)
)
# 1. Calculate progression ratios.
ratios <- progression_ratios(history, method = "mean")
ratios
#> grade_from grade_to ratio
#> 1 K 1 0.9250000
#> 2 1 2 0.9678363
# 2. Project forward. The entry grade (K) is supplied exogenously.
base <- history[history$year == 2023, c("grade", "enrollment")]
projection <- project_enrollment(
base = base,
ratios = ratios,
horizon = 3,
entry = c(125, 130, 128),
start_year = 2023
)
projection
#> year grade enrollment
#> 1 2024 K 125.00000
#> 2 2024 1 111.00000
#> 3 2024 2 95.81579
#> 4 2025 K 130.00000
#> 5 2025 1 115.62500
#> 6 2025 2 107.42982
#> 7 2026 K 128.00000
#> 8 2026 1 120.25000
#> 9 2026 2 111.90607
Inspect the underlying projection matrix at any time:
progression_matrix(ratios)
#> K 1 2
#> K 0.000 0.0000000 0
#> 1 0.925 0.0000000 0
#> 2 0.000 0.9678363 0
enrollcast projects one series per call. To project several schools or
local education agencies, split the data and map over the pieces:
# fmt: skip
school_history <- data.frame(
school = rep(c("North", "South"), each = 9),
year = rep(2021:2023, each = 3, times = 2),
grade = factor(rep(c("K", "1", "2"), times = 6), levels = c("K", "1", "2")),
enrollment = c(100, 90, 80, 110, 95, 88, 120, 99, 91, 120,
110, 100, 130, 115, 108, 140, 119, 111)
)
projections <- lapply(
split(school_history, school_history$school),
function(df) {
ratios <- progression_ratios(df)
base <- df[df$year == max(df$year), c("year", "grade", "enrollment")]
project_enrollment(base, ratios, horizon = 3, entry = rep(100, 3))
}
)
projections$North
#> year grade enrollment
#> 1 2024 K 100.00000
#> 2 2024 1 111.00000
#> 3 2024 2 95.81579
#> 4 2025 K 100.00000
#> 5 2025 1 92.50000
#> 6 2025 2 107.42982
#> 7 2026 K 100.00000
#> 8 2026 1 92.50000
#> 9 2026 2 89.52485