Lucas

sanjacinto
Mt. San Jacinto
  1. Cappuccino Index Claim Significance

    James Hoffmann's new video on the cappuccino index surveys his audience for the country they live in, the price of a cappuccino, and their hourly wage, then uses the number of cappuccinos a worker could buy with an hour's wage to rank countries. By his numbers, Italy comes in second overall, just behind Australia. The problem is the survey is small and self-selected, so I wanted to know whether that gap between countries is real or just noise.

    I focused on Italy and Australia since James called them out directly. So I bootstrapped the samples and plotted the mean and 95% confidence interval for every country, shown below.

    all significant comparisons

    Italy stands out immediately. It has the widest confidence interval of any country, and its true mean ratio could plausibly sit anywhere from about 3.6 to 8.4. That's too wide to take the second highest ranking at face value, so I tested it directly. I bootstrapped a pairwise comparison, sampling the difference in ratio between Italy and each of the other 45 countries, and applied a Bonferroni correction for testing that many pairs at once. If a country's 95% interval of differences spans zero, it isn't significantly different from Italy in this two tailed test.

    paired with italy significance

    The grey x's mark the countries that aren't significantly different from Italy, shown in black: eleven in total, including Australia itself. Even the number one and number two spots in Hoffmann's ranking can't be reliably told apart with this data.

    Given that, I don't think you can confidently claim Italy has the second highest index. Part of the problem is sample size: this was an opt in survey of Hoffmann's YouTube audience, not a random sample, so the number of responses per country tracks how many viewers from that country happened to answer, not anything about the country itself. Italy has about 15 responses. The USA and UK have roughly 600 each. That's nowhere near enough to pin down a precise ranking.

    Number of samples per country

  2. Modelling Irish Hospital Trolley Counts

    Ireland's Health Service Executive (HSE) publishes a daily count of patients on hospital trolleys, people admitted through emergency departments who don't have a bed and end up being treated in a corridor or overflow ward instead. It's the number Irish news uses to talk about overcrowding. The problem is it's always reported as a raw count, and a raw count is just correlated with the region's population. We wanted to know whether, once you control for population, some parts of the country are actually under more strain than others, or whether the differences you see in the news are just noise.

    We scraped the HSE's daily report every day from January 2023 to April 2026, and aggregated counts up to weekly totals for each of Ireland's six health regions. The raw weekly series below already shows a lot going on.

    Weekly trolley counts by HSE region, 2023 to 2026
    In the plot above, every region has a sharp dip right around New Year, marked in light blue, that lines up with hospitals discharging people over Christmas to clear beds for the January respiratory surge. And there's one dip that only shows up in a single region, HSE Mid West, in light red, in August 2024. That one turned out to be real. Mid West had paused scheduled care that month to deal with an overcrowding crisis, and it shows up cleanly in the data as an isolated drop no other region has. We call this the Mid West reset.

    To compare regions properly, we built a Bayesian time series model in JAGS, with a region specific level, a region specific annual cycle, a shared New Year effect, that one off Mid West reset term, and an AR(2) term to soak up week to week persistence. Everything is scaled per 10,000 population so a region isn't penalized just for being big.

    The annual cycle term is the most interesting result of all this for me. Research on Irish hospital admissions has found about a 40% increase in respiratory admissions in winter compared to summer. To investigate this in our own data, we modeled the timing of that peak for each region. Most regions do peak in winter, matching that pattern. Mid West is the exception, where the timing is uncertain. Below is the modeled peak timing by region, with winter, December through February, shaded in blue.

    Annual cycle peak timing by region, weeks from New Year

    Another key result is what the regional levels look like once you do that, mapped below.

    Map of regional trolley levels per 10,000 population
    There's a west to east pattern in the map above that holds up statistically too. HSE Mid West runs at 8.13 trolleys per 10,000 population, more than three times HSE Dublin and North East's 2.27, and fourteen of the fifteen pairwise regional comparisons are statistically significant. The three western regions all sit above the three Dublin regions. None of this is visible in the raw totals, where a big population can make a region look worse than it actually is. This is only clear once you standardize on population, which is exactly the point of doing this properly instead of trusting the headline number.

    Another interesting part was watching the model recover the shape and size of the Mid West reset. We told it which weeks were affected, since that's public record, but the size of the drop and its recovery came entirely from the data.

    Mid West operational reset effect, August 2024
    In the plot above, the effect bottoms out the week of August 19th at 7.29 fewer trolleys per 10,000 than the regional level, with a 95% interval that excludes zero, then rebounds back to the regional level by early September. That's a specific, dated hospital management intervention, with its magnitude inferred purely from how one region's data diverged from the rest.

    As a sensitivity analysis, we checked the whole ranking against three other ways of scaling the data (per available bed, per euro of regional budget, per over 65 resident), and the top and bottom of the ranking hold up every time. Only the two middle regions swap places depending on scaling, which is a pretty reassuring sign the west to east story isn't an artifact of the specific denominator we picked.

    Code and data pipeline are on GitHub, and there's an interactive version of the results at hsereport.ie.

  3. Gene Expression Level site

    A microservice useful for comparing gene expression across various tissues.

    Here is a link to the website

    Mosaic microservice front page
    Mosaic microservice app graph

    It queries Open Targets to get the normalized TPS values for your gene, sums them, then divides them by sum total of all TPS values for the gene.

    I used Vue.js and Java (SpringBoot/Webflux).

  4. Pomodoro Timer App

    Picture of my Pomodoro timer app

    I have a problem at work. When I get locked in, I forget to take breaks. Breaks are great for the body and the mind because they help prevent repetitive stress injuries and increase creativity. To fix this, I created a Pomodoro timer for IOS (and soon to be web). I wanted something very simple, without ads, that would not track me. I could not find anything that satisfied these requirements so I built my own!

  5. Personal Text Analysis

    At the beginning of the year I went through a breakup and did an exploratory data analysis (EDA) of my text messages with this person.

    I was interested in exploring the following questions:

    What illustrative trends can we see to validate that this is normal data?
    Are there observable trends in our messages leading up to the breakup?

    To answer 1. I plotted the time in day that the texts take place, binned by hour. It shows what you would expect, texts drop in the middle of the night. One interesting trend is that I (orange) text a little more in the morning, and my ex (blue) is more active in the evening. Which is cool to see because I was more of a morning person.
    Picture of texts binned per hour of day.
    This illustrative plot shows that my data is relatively normal, which is good because this analysis may be able to be applied to future data.

    To answer 2. I applied a sentiment analysis algorithm to each text to get the table of positive or negative values for our data. I binned these values by day for each of us, and plotted them. I noticed an increased variability leading up to the breakup (which took place at the far right of the plot).
    Plot of sentiment.
    The next plot is of the variance, binned by week this time, to capture the day to day variability seen in the prior plot.
    Plot of sentiment variance.

    As my ex and I were working through our issues, we would have days where we feel like we are going to make it, followed up by days where we both feel like it's over. The intense switching of positive and negative emotions can be seen in this data! This was so cool for me to see and is one of the reasons I love data analysis of contemporary issues. You can observe trends that you feel!

    I do have one lingering question. Do these trends express themselves in other breakups? I scoured the internet and unfortunately could not find any ethical data.

    This was a cool project for me and I hope someone could get some value out of it too. :)

  6. organize.monster

    A chat alongside a collaborative live document. Useful for times when group chats need extra permanence, like during trip planning. Planned tech stack uses: Vue.js, node.js, mongodb.

    Link to prototype

    Drawing of what it would look like

  7. Thebe

    Thebe is an alternative to jupyter that can be run with any code editor such as vim or vscode. The tech stack is vue.js and flask. Github

    Thebe example gif

  8. IOTA Bet

    My partner and I built a web application to facilitate betting online. It would allow users to propose two sided bets, and then users could bet on one side or the other. We did not release it due to the complex regulatory nature of cryptocurrency and betting.

    Screenshot of the finalized product

  9. This Agora

    My partner and I built This Agora to be a bridge between a wikipedia and reddit, but the idea began as a polling site. Link to semi functional site

    Picture of this agora in a semi functioning state

  10. Rat Bird

    This is one of my first programming projects after learning to code. It was so fun making the art for it because it was scanned cut-outs of doodles I made on my math homework. The tech stack is Android Java and the GDX game library.
    Github

    Picture of my old game ratbird