Publications by free range statistics - R

Demystifying life expectancy calculations by @ellis2013nz

30.05.2018

Life expectancy and death rates A chance comment on Twitter about historical increases in life expectancy (in the USA) with fairly constant death rates got me wondering about the exact calculations of these things so I did some Googling. Warning on what follows – I am strictly an amateur in demographics, and was deliberately working things out...

8031 sym R (6517 sym/4 pcs) 12 img

Minor updates for ggseas and Tcomp R packages by @ellis2013nz

14.06.2018

Updates I’ve made small updates to two of my R packages on CRAN: ggseas (seasonal adjustment on the fly for ggplot2 graphics) and Tcomp (tourism forecasting competition data). Neither of the packages changes in a noticeable way for most users. The ggseas update is to get it ready for the coming release of ggplot2 2.3.0 scheduled for the end o...

5270 sym R (1427 sym/4 pcs) 6 img

Demography simulations by @ellis2013nz

25.06.2018

Total fertility rate This is my second blog post while familiarising myself with the arithmetic of demography. In my earlier post I looked at how life expectancy is calculated. “Period life expectancy at birth” as estimated by national statistical offices is actually best thought of as a summary of death rates by age group in a particular ye...

7256 sym 6 img

Spend on petrol by income by @ellis2013nz

30.06.2018

Fuel tax debates So, there’s currently a vibrant debate on a small New Zealandish corner of Twitter about a petrol tax coming into effect in Auckland today, and the different impacts of such taxes on richer and poorer households. The Government has released analysis from the Stats NZ Household Expenditure Survey showing higher petrol consumptio...

7637 sym R (8595 sym/3 pcs) 16 img

Setting up RStudio Server, Shiny Server and PostgreSQL by @ellis2013nz

06.07.2018

Motivation For a variety of reasons I wanted a Linux server in the cloud with data science software on it. In no particular order: so I could access a reliable setup from anywhere with a web browser, including on networks without the software I need (which happens a lot in corporate/government environments) so I could do round-the-clock data gat...

13364 sym Python (8305 sym/8 pcs) 10 img

Business confidence and economic growth by @ellis2013nz

31.07.2018

The ANZ bank have a nice bit of publicity for themselves each month in New Zealand with the release of the results of their monthly Business Outlook Survey. This week it caused a bit of a stir, with the ANZ’s own commentary reporting New Zealand corporate sector is “in a funk” (ANZ’s words) with a net 45 percentage points of businesses p...

10560 sym R (10989 sym/1 pcs) 14 img

Leading indicators of economic growth by @ellis2013nz

09.08.2018

The debate about business confidence as a possible leading indicator of economic growth reminded me of a question that has long been on my back-burner – what data make the best leading indicators (say, a quarter of a year ahead) of economic growth? There are a number of indicators that get a lot of attention in the media and from economic pund...

13539 sym R (6481 sym/7 pcs) 14 img 3 tbl

Time series intervention analysis with fuel prices by @ellis2013nz

13.08.2018

A couple of months ago I blogged about consumer spending on vehicle fuel by income. The impetus for that post was the introduction on 1 July 2018 of an 11.5 cent per litre “regional fuel tax” in Auckland. One vehement critic of the levy, largely on the grounds of its impact on the poor, has been Sam Warburton (@Economissive on Twitter) of th...

9262 sym R (5846 sym/4 pcs) 10 img 2 tbl

Relative risk ratios and odds ratios by @ellis2013nz

16.08.2018

This post tries to explain the difference between odds ratios and relative risk ratios; and how just a few letters in the code fitting a generalized linear model mean the difference between extracting one or the other. There are plenty of other explanations available (for example, here and here), but there is also still plenty of confusion about...

9869 sym R (1790 sym/5 pcs) 2 img

Estimating relative risk in a simulated complex survey by @ellis2013nz

23.08.2018

In this post I simulate a population and a complex survey of it. The survey has stratification, two-stage sampling and post-collection calibration to marginal population totals. The original idea was to follow up on last week’s post on relative risk ratios and odds ratios and in particular to explore the use of the quasipoisson(log) family co...

16785 sym R (16787 sym/6 pcs) 12 img 1 tbl