Add endowment spending distribution, move planning docs to private
- Add IPEDS F2H03C (spending distribution for current use) to endowment schema, loader, queries, and dashboard - Endowment tab now shows spend rate alongside investment return rate - Move planning docs to planning/ directory (gitignored) - Update data dictionary Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
13fb4b8418
commit
a766f6ff0d
8 changed files with 22 additions and 344 deletions
|
|
@ -109,9 +109,14 @@ def layout(conn: duckdb.DuckDBPyConnection):
|
|||
))
|
||||
components_fig.add_trace(go.Bar(
|
||||
x=pd["year"], y=pd["new_gifts"] / 1e6,
|
||||
name="New Gifts to Endowment",
|
||||
name="New Gifts",
|
||||
marker_color="#00539F",
|
||||
))
|
||||
components_fig.add_trace(go.Bar(
|
||||
x=pd["year"], y=pd["spending_distribution"] / 1e6,
|
||||
name="Spending Distribution",
|
||||
marker_color="#E07A5F",
|
||||
))
|
||||
if "other_changes" in pd.columns:
|
||||
components_fig.add_trace(go.Bar(
|
||||
x=pd["year"], y=pd["other_changes"] / 1e6,
|
||||
|
|
@ -125,18 +130,24 @@ def layout(conn: duckdb.DuckDBPyConnection):
|
|||
template="plotly_white", height=400,
|
||||
)
|
||||
|
||||
# Investment return rate
|
||||
# Investment return rate and spend rate
|
||||
rate_fig = go.Figure()
|
||||
rates = pd.copy()
|
||||
rates["return_pct"] = rates["net_investment_return"] * 100 / rates["endowment_boy"]
|
||||
rates["spend_pct"] = rates["spending_distribution"].abs() * 100 / rates["endowment_boy"]
|
||||
rate_fig.add_trace(go.Scatter(
|
||||
x=rates["year"], y=rates["return_pct"],
|
||||
mode="lines+markers", name="Return %",
|
||||
mode="lines+markers", name="Investment Return %",
|
||||
line={"color": "#00539F"},
|
||||
))
|
||||
rate_fig.add_trace(go.Scatter(
|
||||
x=rates["year"], y=rates["spend_pct"],
|
||||
mode="lines+markers", name="Spend Rate %",
|
||||
line={"color": "#E07A5F"},
|
||||
))
|
||||
rate_fig.add_hline(y=0, line_dash="dot", line_color="#ccc")
|
||||
rate_fig.update_layout(
|
||||
title="Endowment Net Investment Return Rate (%)",
|
||||
title="Endowment Investment Return vs Spend Rate (%)",
|
||||
xaxis_title="Year", yaxis_title="%",
|
||||
template="plotly_white", height=380,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -379,7 +379,8 @@ def query_endowment(conn: duckdb.DuckDBPyConnection) -> pl.DataFrame:
|
|||
"""Endowment performance over time."""
|
||||
return conn.execute("""
|
||||
SELECT year, endowment_boy, endowment_eoy, new_gifts,
|
||||
net_investment_return, other_changes, long_term_investments
|
||||
net_investment_return, spending_distribution, other_changes,
|
||||
long_term_investments
|
||||
FROM raw_ipeds_endowment
|
||||
WHERE unitid = ?
|
||||
ORDER BY year
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue