Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see...

37
Diane Stockton Trend analysis

Transcript of Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see...

Page 1: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Diane Stockton

Trend analysis

Page 2: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Introduction

• Why do we want to look at trends over time?– To see how things have changed

• What is the information used for?– Needs assessment– Programme planning– Programme evaluation– Policy development– To set targets for improving services or outcomes– To monitor progress against targets– To make predictions about the future

Page 3: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

– The overall pattern of change in an indicator over time

– Comparing one time period to another time period (interrupted time series data)

– Comparing one geographic area to another

– Comparing one population to another

– Making future projections

Analysis of time trends can focus on:

Page 4: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Important issues

• Sample size

• Presence of extreme observations

• Availability of numerator and denominator data

• Confounding

Page 5: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Statistical procedures

• Linear regression

• Log-linear regression

• Logistic regression

• Poisson regression

• Time series (seasonal or otherwise)

• Specialised models

Page 6: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

What is a linear trend?

• “Linear” means that the function we are looking for is a straight line

• Change by 1 unit in one direction results in a change by some constant (m) amount.

Page 7: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

When should we fit a regression line?

• When looking back over the past to see how an observed indicator has changed over time

• When the plotted values appear to be increasing or decreasing:– a) over the whole period– b) in a linear way, i.e. by the same value each year (e.g. a rate

reducing by 100 per year)

• If we want to calculate the rate of change, or assess whether the increase or decrease is significant

• Although this is not a recommended method of forecasting future events, it may be used as a rough indicator of likely future changes

Page 8: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Is the change linear?Mortality rate per 100,000 population-years at risk

0

10

20

30

40

50

60

70

80

90

100

1990 1995 2000 2005 2010

Year

Rat

e

Mortality rate per 100,000 population-years at risk

0

10

20

30

40

50

60

70

80

90

100

1990 1995 2000 2005 2010

Year

Rat

e

Yes No

Page 9: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Fitting a linear regression line - Example

y = 100 – 2x

Mortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Year, t

Rate

, y

Intercept, a = 100

Gradient, b = –20/10 = –2

–20

10

Page 10: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Fitting a linear regression line

• The ‘least squares’ method finds the straight line which fits the points most closely

• Specifically, it finds the line which minimises the squared distances between the points and the line

• Excel’s LINEST function calculates the intercept and the gradient

• The chi-squared test assesses the significance of the trend

Page 11: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

• BUT…

• The data we most commonly deal with in public health are not usually linear

Fitting a linear regression line

30

34

38

42

46

50

1990

1992

1994

1996

1998

2000

2002

2004

2006

2008

Year

Rat

e

Page 12: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

What about non-linear trends?• In public health we are most commonly dealing with counts, rates

or proportions: we routinely transform the data in order to make the transformed data linear and constrain them to be no less than zero

• We can use a log-transformation for counts or rates, fitting an exponential curve which assumes a constant rate of change, rather than a constant numerical increase or decrease

• We can use a logit-transformation for proportions (or percentages), which constrains the variable to be between 0 and 1 (or 0% and 100%)

• Excel’s LOGEST function calculates the intercept and gradient1

10

100

1990

1992

1994

1996

1998

2000

2002

2004

2006

2008

Year

Rat

e

Page 13: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

When you need more complicated models

• Fractional polynomials - fits curvi-linear line through a set of data points

• Restricted cubic splines – similar to Fractional polynomials but you can choose number of “knots” (forces the line to be linear in the tails)

Page 14: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Assessing change in trend

• Segmented regression – fit linear regression line before and after change point; test for step change and/or change in trend

• Joinpoint regression – lets the model find where the trend changes – each change is called a joinpoint. Free software available to do joinpoint regression http://surveillance.cancer.gov/joinpoint/download.html

Page 15: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Other considerations

• Other independent variables to be included in regression models

• Achieving stability by combining data (eg. years or geographical areas)

• Assessing goodness of fit

Page 16: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Examples of time trends

Page 17: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

A decreasing trendMortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Year

Rate

Page 18: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

A decreasing trendMortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Year

Rate

Page 19: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

A decreasing trend

Mortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Year

Rate

Page 20: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

A decreasing trend?Mortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Year

Rate

Page 21: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

No apparent change

Mortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Year

Rate

Page 22: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

No apparent change

Mortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Year

Rate

Page 23: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

An increasing trendMortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Year

Rate

Page 24: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Seasonal pattern (plus rising trend)

Mortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

Jun-90 Feb-93 Nov-95 Aug-98 May-01 Feb-04 Nov-06 Jul-09

Year

Rate

Page 25: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Change in trendMortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Year

Rate

Page 26: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Outlier

Mortality rate per 100,000 population-years at risk

0

20

40

60

80

100

120

140

1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010

Year

Rate

Page 27: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Projections / Forecasting

Page 28: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Projections / forecasting

• How do we set and monitor progress against targets?– Plot historic data on a graph– We need to forecast or predict future data– In some circumstances we can extrapolate from a regression

line or curve– There are much better forecasting methods

• However…– Forecasts are usually wrong!– Accuracy erodes as we go further into the future– A good forecast is more than just a number

• Includes an accuracy range0

200

400

600

800

1000

1200

1400

1600

1800

2003

2004

2005

2006

2007

2008

2009

2010

2011

2012

2013

2014

DSR

per 1

00,0

00 p

opul

atio

n

Year

Bassetlaw Alcohol Admission Rate

Observed Forecast 95% Confidence Interval

Page 29: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Population Projections

• Population projections for Scotland are available from GROS

http://www.gro-scotland.gov.uk/statistics/theme/population/projections/index.html

They are available by NHS Board and Council area.

• The projections look forward 25 years, providing an estimate of the number of males and females in each five-year age group, assuming the continuation of established trends

Page 30: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Prevalence ratio method

• If we are trying to predict the total number of people with a particular need, this will depend partly on the rate of incidence or prevalence of the issue in question, and partly on the changing size and shape of the population

• If we already have a population projection we can estimate future numbers by multiplying the extrapolated rate (or current rate if assuming no change) with the population projection

Page 31: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Prevalence ratio method example

• An RNIB study found that 20% of people aged 75 or over were registered blind or partially sighted

• If we assume that this rate remains fixed, projections can be obtained by multiplying the population projection for the 75+ age-group by 20%

e.g. 2010 2015 2020 2025

75+ population 7,200 8,700 10,100 10,700Projection in area X

Rate of visual impairment 20% 20% 20% 20%in 75+ age-group (RNIB)

Projected number with 1,440 1,620 1,740 2,020visual impairment in 75+age-group in area X

Page 32: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Prevalence ratio method - comments

• Has modest data requirements: even if you only have a single estimate of the rate, you can make a simple projection on the assumption that the rate is fixed

• Extrapolating trends are OK for a short time into the future as long as the historic data are stable

• But:• The regression line is fitted across the whole of the

historic data, and gives equal weight to all points: e.g. the value for last year is given the same weight as one from 20 years ago – it doesn’t give the best estimate of ‘current trends’

• We cannot give realistic confidence intervals for future values (‘prediction intervals’ or ‘forecast intervals’)

Page 33: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Age-period-cohort modelling

• Used widely in cancer epidemiology where cohort effects are important

• Estimates the underlying age-, period- and cohort-specific trends and models them into the future using a Poisson regression model

• Programmes available:– “R” open source (free) software – NORDPRED

programme available (http://www.kreftregisteret.no/en/Research/Projects/Nordpred/Nordpred-software/)

– Stata – programmes available from http://www.encr.com.fr/stata-macros.htm

Page 34: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Other forecasting methods

• There are a range of methods which are intended for forecasting, eg moving average (ARIMA) methods, autocorrelation methods, Box-Jenkins methods

• These methods take into account fluctuations from year to year, trends (ie gradual changes over time) and seasonal variations

• They tend to give greater weight to more recent values• They give confidence intervals for forecasts, which tend

to get wider as we move further into the future

• Holt’s Method (which includes a trend component) and Holt-Winters (which adds a seasonal component)

Page 35: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Holt’s method

• Holt’s exponential smoothing (aka double exponential smoothing) is a moving average method

• Several statistical packages will do this:– ForecastPro – expensive but very easy to use– Stata –requires code– R – open source (free) software which requires

code– Excel – complicated to do

• If you use Stata, R or Excel, you need to put some effort into optimising the parameters, which requires some expertise and time

Page 36: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Which method to use

• APC models and Holt method appear to give similar results

• Holt method has advantage of producing prediction intervals

Page 37: Diane Stockton Trend analysis. Introduction Why do we want to look at trends over time? –To see how things have changed What is the information used for?

Further information

[email protected] 0131 275 6817