소스 정보
- 저장소
- tools-only/X-Skills
- 최근 소스 활동
- 2026년 3월 1일 00:38
- 감지된 SKILL.md 언어
- 영어
- 스타
- 7
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tools-only/X-Skills --skill policyengine-uk-data명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Index of Build Systems Skills
Coordination patterns for distributed dataflow systems including barriers, epochs, and distributed snapshots
Windowing, sessionization, time-series aggregation, and late data handling for streaming systems
SOC 직업 분류 기준
SKILL.md 표시 중
| name | policyengine-uk-data |
| description | UK survey data enhancement - FRS with WAS imputation patterns |
PolicyEngine UK Data provides enhanced Family Resources Survey (FRS) datasets with imputed variables from the Wealth and Assets Survey (WAS).
PolicyEngine UK uses the Family Resources Survey (FRS) as its primary microdata source. The FRS contains household demographics, income, and benefits but lacks detailed wealth information. The Wealth and Assets Survey (WAS) provides comprehensive wealth data but has a smaller sample. This package imputes wealth variables from WAS to FRS.
Key datasets:
Location: PolicyEngine/policyengine-uk-data
Clone:
git clone https://github.com/PolicyEngine/policyengine-uk-data
cd policyengine-uk-data
policyengine_uk_data/
├── datasets/ # Dataset definitions
│ └── frs/ # FRS enhancement
│ ├── raw_frs.py # Raw FRS loader
│ ├── calibration.py # Weight calibration
│ └── imputations/ # Variable imputation
│ ├── wealth.py # WAS wealth imputation
│ ├── student_loans.py # Student loan balances
│ └── ...
└── storage/ # Data storage utilities
From PyPI:
pip install policyengine-uk-data
Development:
pip install -e .
The standard pattern for adding WAS-to-FRS imputations:
1. Identify the variables:
2. Follow the wealth.py pattern:
# In policyengine_uk_data/datasets/frs/imputations/my_variable.py
from policyengine_uk_data.datasets.frs.imputations.imputation_utils import (
impute_from_was
)
def add_my_variable(frs, was):
"""
Impute my_variable from WAS to FRS.
Args:
frs: Enhanced FRS DataFrame
was: WAS DataFrame with target variable
Returns:
Enhanced FRS with imputed variable
"""
return impute_from_was(
donor=was,
recipient=frs,
target_variable='my_variable',
common_variables=[
'age',
'region',
'employment_status',
# Add relevant predictors
],
method='quantile_forest' # Or other microimpute method
)
3. Update the RENAMES dictionary:
If the variable has different names in WAS vs FRS:
# In the relevant module
RENAMES = {
"was_variable_name": "standardized_name",
"frs_variable_name": "standardized_name",
}
4. Add to the pipeline:
Register the imputation in the FRS enhancement pipeline so it runs automatically.
The recent PR #252 added student loan balance imputation:
# policyengine_uk_data/datasets/frs/imputations/student_loans.py
def add_student_loan_balance(frs, was):
"""
Impute student loan balances from WAS to FRS.
WAS contains:
- total_loans: All loan balances
- total_loans_exc_slc: Loans excluding student loans
Derived variable:
- student_loan_balance = total_loans - total_loans_exc_slc
"""
return impute_from_was(
donor=was,
recipient=frs,
target_variable='student_loan_balance',
common_variables=[
'age',
'highest_qualification',
'region',
'employment_status',
'income'
],
method='quantile_forest'
)
Demographics (always available):
Economic status:
Household:
Education:
Run tests:
make test
# Or pytest directly
pytest policyengine_uk_data/tests/ -v
Test structure:
# Check if imputation was added
pytest policyengine_uk_data/tests/test_imputations.py::test_student_loan_imputation
After adding an imputation, validate:
1. Distribution check:
# Compare imputed FRS distribution to WAS source
import matplotlib.pyplot as plt
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.hist(was['my_variable'], bins=50)
ax1.set_title('WAS (source)')
ax2.hist(frs_imputed['my_variable'], bins=50)
ax2.set_title('FRS (imputed)')
2. Aggregate totals:
# Check population-weighted totals match administrative data
weighted_total = (frs_imputed['my_variable'] * frs_imputed['weight']).sum()
print(f"Imputed total: {weighted_total:,.0f}")
# Compare to known UK aggregate
3. Conditional relationships:
# Verify relationships are preserved
# E.g., student loan balance by age and qualification
frs_imputed.groupby(['age_band', 'qualification'])['student_loan_balance'].mean()
# Most common: direct variable imputation
def add_variable(frs, was):
return impute_from_was(
donor=was,
recipient=frs,
target_variable='my_var',
common_variables=['age', 'income', 'region']
)
# When WAS has components but not the exact variable
def add_derived_variable(frs, was):
# First derive the variable in WAS
was['net_wealth'] = was['total_assets'] - was['total_debts']
# Then impute
return impute_from_was(
donor=was,
recipient=frs,
target_variable='net_wealth',
common_variables=['age', 'income', 'region']
)
# Impute several related variables together
def add_wealth_components(frs, was):
variables = [
'property_wealth',
'financial_wealth',
'pension_wealth',
'debt'
]
for var in variables:
frs = impute_from_was(
donor=was,
recipient=frs,
target_variable=var,
common_variables=['age', 'income', 'region']
)
return frs
Usage flow:
1. Load raw FRS
↓
2. Add WAS imputations (wealth, student loans, etc.)
↓
3. Calibrate weights to administrative benchmarks
↓
4. Validate against known UK totals
↓
5. Package for policyengine-uk
↓
6. Use for UK policy simulations
In policyengine-uk:
from policyengine_uk import Microsimulation
# Uses enhanced FRS under the hood
sim = Microsimulation()
sim.calculate('student_loan_repayment', period='2026')
# Uses imputed student_loan_balance variable
Repository: https://github.com/PolicyEngine/policyengine-uk-data Dependencies: policyengine-uk, policyengine-core, microdf, microimpute Data sources: