Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tabfig: Visualize changes in share of children at risk #40

Open
FanWangEcon opened this issue Feb 11, 2024 · 0 comments
Open

tabfig: Visualize changes in share of children at risk #40

FanWangEcon opened this issue Feb 11, 2024 · 0 comments
Assignees
Labels

Comments

@FanWangEcon
Copy link
Member

FanWangEcon commented Feb 11, 2024

Visualize changes in share of children at risk

Show in table and figure double-threshold, share of children at risk

Outputs

Table A output, all locations joint, a table with 10 columns of temp stats, share of children from 1990 and 2020 same table, different row groups:

  • rows: temperature thresholds (more selected subset)
  • row-groups: threshold groupings
  • col 1-3: 4, 8, 12 percent of time (2 weeks, 1 months, 6 weeks), note $(2472)/(365*24)=0.03835616438$ and $100/24 = 4.16666666667$, the average of these are exactly 8 percent.
  • col 4-6: 16, 20, 24 percent of time (2 months, 10 weeks, 3 months)
  • col 7-9: 28, 32, 36 percent of time (14 weeks, 4 months, 16 weeks), note $(24744)/(36524)=0.30684931506$ $(100/24)*8 = 33.3333333333$, the average of these two numbers is exactly 32

Table B output, similar to the first table, except show in two panels changes in percentage points, and changes in percentages.

Algorithm

Step 1, Generate data structures for outputs

To implement the outputs:

  1. Merge input double-threhold files together, rows are share of time, columns are temp thresholds
  2. Filter to only consider a subst of share of time, at 0.05 intervals, 5, 10, 15, 20, 25, 30, 35, 40, 45. 9 groups.
  3. Reshape thresholds wide to long
  4. 1 - all to see 1 - CDF.
  5. Group by thres, by share of days, arrange by filder counter
    • Percentage points change: Take diff with file counter as "t" (there are only two files, so difference across time)
    • Percentage change: Take ratio with file counter as "t" (there are only two files, so difference across time)
  6. Rehsape long to wide so temp-thresholds are rows and share-of-time are columns, keep year and percent and percpoint as rows

Step 2, generate Table A

Using existing thresholds grouping structure, with new column structure. With additions that:

  1. Load in combined 1990 and 2020 information, share of children files.
  2. Generate two layers of headings, supra and sub, with alternative formatting, auto-detect. Supra centered with line, sub, left align without line.

Step 3, generate Table B

Using existing thresholds grouping structure, with new column structure and follow Table A. Differntial formatting for pp vs percent.

@FanWangEcon FanWangEcon self-assigned this Feb 11, 2024
FanWangEcon added a commit that referenced this issue Feb 12, 2024
- Step 1 at risk data aggregation from multiple files
- Step 2 and 3 generating tables A and B, levels and changes.
FanWangEcon added a commit that referenced this issue Feb 20, 2024
- Figure out connect to prior figure code
- Minor table word changes
FanWangEcon added a commit that referenced this issue Feb 26, 2024
- Share of time percentile consistency correction
- Updating results for at risk for #39 and #40.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant