curve fitting session 2. method background disability rates are strongly linked to age however hse...

23
Curve fitting Session 2

Upload: anna-foster

Post on 28-Mar-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Curve fitting

Session 2

Page 2: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Method background

• Disability rates are strongly linked to age

• However HSE disability rates for single years of age are unstable

• We can fit a curve to the disability schedule to smooth the fluctuations

• Model rates (national or regional)*local population totals

Page 3: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

0.2

.4.6

Pre

vale

nce

rat

e

10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90Age

Source: HSE 2001

Mobility disability – England (Males)

Page 4: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Personal care disability – England (males)

0.1

.2.3

Pre

vale

nce

rate

10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90Age

Source: HSE 2001

Page 5: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Dealing with sampling variability0

.2.4

.6P

rop

ortio

n

0 20 40 60 80Age

HSE 2000/01Mobility disability schedule

Rates are unreliable particularly where sample sizes are small

Smooth fluctuations by fitting a curve

Page 6: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Dealing with sampling variability

0.2

.4.6

We

ight

0 20 40 60 80Age

Observed survey rates Modelled rates

Source: Health Survey for England 2000/01

Mobility schedules - observed and modelled

Page 7: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

What function?

• Lots of choices• Quadratic (y=b0+b1x+b2x3+b3x3

• Exponential functions

• Estimation of mortality schedules

• Statistics Canada use an exponential curve to model disability schedules in Canadian territories

Page 8: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Exponential curve

bxaexD )(

Where: D(x)= the proportion of people with a disability at age x

Page 9: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Practical structure

• Task 3 – Fit an exponential curve to (England) mobility schedules (with and without weights). Uses saved data from task 2

• Task 4 – Fit curves to regional mobility schedules

• Task 5 – Use your model rates to calculate the number of people with a mobility disability in six districts. (Data provided)

Page 10: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Fitting a curve in stata

nl (MO_OBS_RT=exp({a}+{b}*age))

predict pred_MO_UK

bxaexD )(

Page 11: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Exponential curve – parameter estimates (males)

Confidence interval

a -4.4 -4.79 -4.09

b 0.04 0.04 0.05

Page 12: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Mobility disability schedules – observed and modelled

0.2

.4.6

We

ight

0 20 40 60 80Age

Observed survey rates Modelled rates

Source: Health Survey for England 2000/01

Mobility proportions - observed and modelled

Page 13: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Analytic weights

• Stata treats the rates at each age as being equally reliable.

• Can use weights to relax this assumption• If we assume our rates stem from a

binomial process then:

Where px = proportion with a disability at age x and Nx equals the number of people sampled at age x.

)1()(

xx

xx pp

Npw

Page 14: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Calculating weights (task 3)

• Re-open the HSE data• Re-calculate age specific rates (MO_OBS_RT) (as

in task 2)

egen mobilitycount=count(MO_OBS_RT), by (age sex)

gen mobilityweight=mobilitycount/(MO_OBS_RT*(1*MO_OBS_RT))

)1()(

xx

xx pp

Npw

Page 15: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Model weights – mobility disability

010

000

2000

030

000

We

ight

0 20 40 60 80Age

Source: Health Survey for England 2000/01

Weights associated with locomotor proportions

Page 16: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Fitting a curve in stata

nl (MO_OBS_RT=exp({a}+{b}*age)) [aweight=mobilityweight]

predict pred_MO_UK

bxaexD )(

Page 17: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Mobility schedules – observed and modelled (with weights)

0.2

.4.6

We

ight

0 20 40 60 80Age

Observed survey rates Modelled rates

Source: Health Survey for England 2000/01

Mobility schedules - observed and modelled

Better fit at youngest ages

Page 18: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Task 4 – regional curves

• Open HSE data

• Drop institutional residents (no gora)

• Are differences in regional rates of mobility disability significant? (1.4.2-1.4.3)

Page 19: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Task 4 - regional curves

• Calculate regional schedules of mobility disability rates

by sex age gora: egen MO_num=total(mobility_w)

by sex age gora: egen MO_denom=total(count_w)

gen MO_OBS_RT=MO_num/MO_denom

Page 20: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Task 4 – regional curves

• Weights are the same as used for national data (task 3)

• Regional age patterns of weight very unstable

• After calculating regional rates and weights:

• Duplicates drop age sex gora, force

Page 21: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Task 4 –regional curves

nl (MO_OBS_RT=exp({a}+{b}*age)) ifsex==1&gora==1 [aweight=mobilityweight]

predict pred_MO1_M

nl (MO_OBS_RT=exp({a}+{b}*age)) ifsex==1&gora==2 [aweight=mobilityweight]

predict pred_MO2_M

Fit curves for each region (males and females)

Page 22: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

0.2

.4.6

.8P

ropo

rtio

n

0 20 40 60 80Age

North East South East

Source: Health Survey for England

MalesRegional mobility disability schedules

Page 23: Curve fitting Session 2. Method background Disability rates are strongly linked to age However HSE disability rates for single years of age are unstable

Task 5

• Aim - generate district estimates of the numbers of people with mobility disabilities

• Practical 1 task 5 dataset.dta

• a row for each single year of age (10, 11,….84,88) for males and females in each of the six districts

• Contains the national and regional model rates from tasks 3 and 4

• Population counts