Publications by free range statistics - R
Revisiting depression incidence by county and vote for Trump by @ellis2013nz
Just before Christmas I blogged about the positive correlation between depression incidence in US counties and their vote for Trump in the 2024 presidential election. In addition to my casual interest in the topic, I used it as a case study in multilevel modelling while adjusting for spatial correlation. I explicitly said that I didn’t think it l...
15154 sym R (22174 sym/18 pcs) 14 img 1 tbl
Depression incidence by county and vote for Trump by @ellis2013nz
A skeet floated across my Bluesky feed that looked at the cross-sectional relationship between incidence of depression in 2020 and voting for Trump in the 2024 Presidential election. The data in the skeet and immediate blog post was at state level, but the hypothesis of interest in an article that sparked all this was an individual one (are depress...
10418 sym R (10355 sym/10 pcs) 14 img
Death rates by cause of death by @ellis2013nz
Overview OK, so the USA health system is very much in the news. One thing that has been getting a lot of coverage, not least because it was explicitly referred to in a written statement from the guy who seems to have murdered UnitedHealthcare CEO Brian Thompson, is the low life expectancy in the USA compared to the amount spent in that country on h...
13363 sym R (14883 sym/13 pcs) 20 img
Simulating Ponzi schemes by @ellis2013nz
I recently read John Cox’s 2018 book Fast Money Schemes: Hope and Deception in Papua New Guinea and gave it a rare (for me) five star rating. It’s fascinating research into those involved in the U-Vistract pyramid scheme. At the time of writing U-Vistract had been bankrupt and exposed for years yet many of those who had ‘invested’ in it wer...
10250 sym R (13840 sym/9 pcs) 10 img
Design effects for stratified sub-populations by @ellis2013nz
So, some months ago, I spent a few hours over a few days puzzled by something that turned out to be straighforwardly written up in the Stata manual, but not easily findable anywhere else. So I want to write it up, if only to have somewhere for future me to find it easily. It’s all about the design effect in a complex survey. The definition of a d...
12095 sym R (5466 sym/8 pcs) 2 img 1 tbl
Regressions where the coefficients are a simplex. by @ellis2013nz
I have been thinking in my spare time a bit about synthetic control methods as an approach to evaluation, and am working on a blog post. But a side issue that popped up was sufficiently interesting to treat separately. Technically, it is a question of fitting a regression where the coefficients are constrained to be non-negative and add up to one; ...
8096 sym R (5264 sym/13 pcs) 12 img
Git, peer review, tests and toil by @ellis2013nz
This week I was in Auckland New Zealand to deliver the third and final of the 2024 series of the Ihaka Lectures, named after legendary denizen of University of Auckland’s statistics department Ross Ihaka, one of the two co-founders of the statistical computing language R. I have added links to the video of the talk (it was live-streamed), my slid...
2628 sym 2 img
Prime numbers as sums of three squares. by @ellis2013nz
I was interested by a LinkedIn post about the number 397: “397 is conjectured to be the largest prime that can be represented uniquely as the sum of three positive squares” That is, 3^2 + 8^2 + 18^2 = 397 This led to some confusion in the comments as people found other prime numbers that can be created as the sum of three squares. But the wor...
2717 sym R (1714 sym/5 pcs) 6 img
Stepwise selection of variables in regression is Evil. by @ellis2013nz
I’ve recently noticed that stepwise regression is still fairly popular, despite being well and truly frowned upon by well-informed statisticians. By stepwise regression, I mean any modelling strategy that involves adding or subtracting variables from a regression model on the basis that they are “significant”, reduce the Akaike Information Cr...
9778 sym R (10385 sym/8 pcs) 10 img
Gender and sexuality in Australian surveys and census by @ellis2013nz
The 2021 ABS Standard for ‘Sex, Gender, Variations of Sex Characteristics and Sexual Orientation Variables’ Over the past two weeks there has been quite a controversy relating to questions about sexuality and gender in the next Australian Census of Population and Housing, in 2026. Things hit the news when the testing of “new questions” was ...
13782 sym R (4569 sym/1 pcs) 4 img