1 b. the log-rate model statistical analysis of occurrence-exposure rates

23
1 B. The log-rate model Statistical analysis of occurrence-exposure rates

Upload: angela-barber

Post on 23-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

1

B. The log-rate model

Statistical analysis of occurrence-exposure rates

Page 2: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

2

Laird, N. and D. Olivier (1981) Covariance analysis of censored survival data using log-linear analysis techniques. Journal of the American Statistical Institute, 76(374):231-240

Holford, T.R. (1980) The analysis of rates and survivorship using log-linear models. Biometrics, 36:299-305

Yamaguchi, K. (1991) Event history analysis. Sage, Newbury Park, Chapter 4:’Log-rate models for piecewise constant rates’

References

Page 3: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

3

Leaving parental home, 1961 cohort, micro-dataSurvey Sept. 87 - Febr. 88

First 23 respondents. Three censored observations.ID Sex Father Month Reason Sex1 2 2 268 2 1 Female2 1 3 268 2 2 Male3 1 2 202 14 2 2 320 4 Father status5 1 1 237 1 1 Low6 1 1 295 2 2 Middle7 1 1 272 2 3 High8 2 1 231 19 2 1 312 3 Reason

10 1 2 289 2 1 Educ/work11 1 1 316 2 2 Marriage/cohabit12 2 1 321 4 3 Freedom13 2 1 260 1 4 Censored14 2 2 281 2 at interview15 2 1 273 216 1 2 251 317 2 2 212 118 2 2 320 219 1 2 221 320 2 2 322 421 2 1 221 222 2 3 308 223 1 2 233 1

Total %TWO CATEGORIES leave home early (before age 20) 209 35.85

leave home late (at or after age 20) 321 55.06Censored 53 9.09Total 583 100.00

Data: leaving parental home

Page 4: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

4

The log-rate model: the occurrence matrix and the exposure matrix

Occurrences: Number leaving home by age and sex, 1961 birth cohort: nij

Exposures: number of months living at home (includes censored observations): PMij

Age Female Male Total<20 135 74 209>=20 143 178 321Total 278 252 530Censored 13 40 53Total 291 292 583

Sex

Age Female Male Total<20 15113 16202 31315>=20 4876 9114 13990Total 19989 25316 45305

Sex

Page 5: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

5

The log-rate model

u u u u PMλln AB

ijBj

Ai

ij

ij

with A AGE [early (before age 10) = 0; late (at age 20 or later) =1] and B SEX [female = 0; male = 1]

u u u u ABij

Bj

Aiijij PMln λln

u u u u ABij

Bj

Ai

o

ijij mλln offset

exposures

countsln

exposure

soccurrenceln

The log-rate model is a log-linear model with OFFSET

(constant term)

ij = E[Nij]PMij fixed

Page 6: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

6

The log-rate model

]exp[η

PM

λ

PM

E[N] RateE

η ln(PM) λln and ηexp PM λ E[N]

Ln(PM): offset : linear predictor

The log-rate model is a log-linear model with OFFSET

(constant term)

Multiplicative form Addititive form

Page 7: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

7

The log-rate model in two steps

• Use the model to predict the counts (predict counts from marginal distribution of occurrences and from exposures): IPF

• Estimate parameters of log-rate model from predicted values using conventional log-linear modeling

• The model: uuPM

B

j

A

i

ij

ij u ln

Page 8: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

8STEP 1: ITERATIVE PROPORTIONAL FITTING

OCCURRENCES

Sex iter=2a Sex

Age Female Male Total Age Female Male Total

<20 135 74 209 <20 126.5 82.5 209.0

>=20 143 178 321 >=20 150.3 170.7 321.0

Total 278 252 530 Total 276.8 253.2 530.0

EXPOSURES iter=2b Sex

Sex Age Female Male Total

Age Female Male Total <20 127.1 82.1 209.2

<20 15113 16202 31315 >=20 150.9 169.9 320.8

>=20 4876 9114 13990 Total 278.0 252.0 530.0

Total 19989 25316 45305

iter=3a Sex

ITERATIVE PROPORTIONAL FITTING Age Female Male Total

<20 127.0 82.0 209.0

iter=1a Sex >=20 151.0 170.0 321.0

Age Female Male Total Total 278.0 252.0 530.0

<20 100.9 108.1 209.0

>=20 111.9 209.1 321.0 iter=3b Sex

Total 212.7 317.3 530.0 Age Female Male Total

<20 127.0 82.0 209.0

iter=1b Sex >=20 151.0 170.0 321.0

Age Female Male Total Total 278.0 252.0 530.0

<20 131.8 85.9 217.7

>=20 146.2 166.1 312.3 PREDICTIONS OF NUMBERS OF Total 278.0 252.0 530.0 PERSONS LEAVING HOME

liefbr\2_2\lograte\2_2.xls

Page 9: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

9

STEP 2: PARAMETERS OF LOG-RATE MODEL (method of means)Estimates/exposures * 1000 Logarithm of estimate - logarithm of exposure

Sex Sex

Age Female Male Total Age Female Male Total

<20 8.4033 5.0613 13.4646 <20 -4.7791 -5.2861 -10.0653

>=20 30.9682 18.6522 49.6204 >=20 -3.4748 -3.9818 -7.4566

Total 39.3715 23.7135 63.0850 Total -8.2539 -9.2679 -17.5218

PARAMETERS OF LOG-RATE MODEL: contrast coding

Overall effect -4.3804603 Mean of all 4 values

Row effects -0.6521677 Mean of row 1 - overall mean

0.65216769 Mean of row 2 - overall mean

Column effects 0.25349767 Mean of col. 1 - overall mean

-0.2534977 Mean of col. 2 - overall mean

Interaction effects 0 F(11) - overall mean - row mean - col. mean

-4.441E-16 F(21) - overall mean - row mean - col. mean

-8.882E-16 F(12) - overall mean - row mean - col. mean

-4.441E-16 F(22) - overall mean - row mean - col. mean

check: 127.0 15113 exp(-4.3805-0.6523+0.2535)

151.0 4876 exp(-4.3805+0.6523+0.2535)

82.0 16202 exp(-4.3805-0.6523-0.2535)

170.0 9114 exp(-4.3805+0.6523-0.2535)

] exp[ PM uuuλ

B

j

A

iijij

Page 10: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

10

The log-rate model in SPSS: unsaturated model

Model and Design Information: unsaturated model

Model: PoissonDesign: Constant + SEX + TIMING

Parameter Aliased Term

1 Constant 2 [SEX = 1] 3 x [SEX = 2] 4 [TIMING = 1] 5 x [TIMING = 2]

Parameter Estimates

Asymptotic 95% CIParameter Estimate SE Lower Upper

1 -3.9818 .0694 -4.12 -3.85 2 .5070 .0878 .33 .68 3 .0000 . . . 4 -1.3044 .0897 -1.48 -1.13 5 .0000 . . .

Page 11: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

11

The log-rate model in SPSS: unsaturated model

PM *exp[ ] = RATE

9114*exp[-3.982 ] = 170.0 0.01865

16202*exp[-3.982-1.304 ] = 82.0 0.00506

15113*exp[-3.982-1.304+0.507] = 127.0 0.00840

4876*exp[-3.982+ 0.507] = 151.0 0.03096

uuuB

j

A

i

Page 12: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

12

The log-rate model in GLIM: unsaturated modelOcc = Exp * exp[overall + sex]

DATA: Occurrence matrix and exposure matrix (2*2)[i] $fit +sex$ [o] scaled deviance = 218.48 (change = -14.80) at cycle 4 [o] d.f. = 2 (change = -1 ) [o] [i] $d e$ [o] estimate s.e. parameter [o] 1 -4.275 0.05997 1 [o] 2 -0.3344 0.08697 SEX(2) [o] scale parameter taken as 1.000 Females 278 = 19989 * exp[-4.275] RATE = exp[-4.275] = 0.0139 Males 252 = 25316 * exp [-4.275 - 0.3344] RATE = exp [-4.275 - 0.3344] = 0.0100 [i] $d r$ [o] unit observed fitted residual [o] 1 135 210.19 -5.186 [o] 2 74 161.28 -6.873 [o] 3 143 67.81 9.130 [o] 4 178 90.72 9.163

Page 13: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

13

The log-rate model in GLIM: unsaturated model

Occ = Exp * exp[overall + sex + timing]

DATA: Occurrence matrix and exposure matrix (2*2)i] $fit +timing$ ! SEX + TIMING[o] scaled deviance = 2.1044 (change = -216.4) at cycle [o] d.f. = 1 (change = -1 )[o][i] $d e$[o] estimate s.e. parameter[o] 1 -4.779 0.07727 1[o] 2 -0.5070 0.08777 SEX(2)[o] 3 1.304 0.08969 TIMI(2)[o] scale parameter taken as 1.000[o][i] $d r$[o] unit observed fitted residual[o] 1 135 127.00 0.710[o] 2 74 82.00 -0.884[o] 3 143 151.00 -0.651[o] 4 178 170.00 0.614

Page 14: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

14

The log-rate model in GLIM: unsaturated model

Parameter s.e.Overall effect -4.779 0.0773Time(1) 0Time(2) 1.304 0.0897Sex(1) 0Sex(2) -0.507 0.0878

Check: 127.0 15113 exp(-4.779)82.0 16202 exp(-4.779-0.507)

151.0 4876 exp(-4.779+1.304)170.0 9114 exp(-4.779-0.507+1.304)

Page 15: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

15

Related models

• Poisson distribution: counts have Poisson distribution (total number not fixed)

• Poisson regression

• Log-linear model: model of count data (log of counts)

• Binomial and multinomial distributions: counts follow multinomial distribution (total number is fixed)

• Logit model: model of proportions [and odds (log of odds)]

• Logistic regression

• Log-rate model: log-linear model with OFFSET (constant term)

Parameters of these models are related

Page 16: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

16

I. The unsaturated model Similarity with log-rate model

Page 17: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

17

The unsaturated log-linear model

• Assume: two-way classification; counts unknown but marginal totals given

• Predict the expected counts (cell entries)

Age Female Male Total<20 135 74 209>=20 143 178 321Total 278 252 530

Sexby age and sex: data

Number leaving parental home

Page 18: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

18

μ ln μμλB

j

A

iij

FFF

λji

ij

Age Female Male Total<20 109.6 99.4 209>=20 168.4 152.6 321Total 278 252 530

Sexby age and sex: predictions

Number leaving parental home

Page 19: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

19

------------------------------------------------------

STEP 1: ITERATIVE PROPORTIONAL FITTING ITERATIVE PROPORTIONAL FITTING

OCCURRENCES iter=1a Sex

Sex Age Female Male Total

Age Female Male Total <20 104.5 104.5 209.0

<20 135 74 209 >=20 160.5 160.5 321.0

>=20 143 178 321 Total 265.0 265.0 530.0

Total 278 252 530

iter=1b Sex

EXPOSURES Age Female Male Total

Sex <20 109.6 99.4 209.0

Age Female Male Total >=20 168.4 152.6 321.0

<20 1 1 2 Total 278.0 252.0 530.0

>=20 1 1 2

Total 2 2 4 PREDICTIONS OF NUMBERS OFPERSONS LEAVING HOME

THE LOG-RATE MODEL IN TWO STEPS:

The unsaturated log-linear model as a log-rate model

Odds ratio = 1

Page 20: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

20

] exp[ PM uuuλB

j

A

iijij

STEP 2: PARAMETERS OF LOG-RATE MODEL (method of means)Estimates/exposures Logarithm of estimate - logarithm of exp.

Sex SexAge Female Male Total Age Female Male Total <20 109.63 99.37 209.00 <20 4.70 4.60 9.30 >=20 168.37 152.63 321.00 >=20 5.13 5.03 10.15 Total 278.00 252.00 530.00 Total 9.82 9.63 19.45

PARAMETERS OF LOG-RATE MODELOverall effect 4.8625Mean of all 4 valuesRow effects -0.2146Mean of row 1 - overall mean

0.2146Mean of row 2 - overall meanColumn effects 0.0491Mean of col. 1 - overall mean

-0.0491Mean of col. 2 - overall mean

check: 109.6 1exp(-4.3805-0.6523+0.2535)168.4 1exp(-4.3805+0.6523+0.2535)99.4 1exp(-4.3805-0.6523-0.2535)

152.6 1exp(-4.3805+0.6523-0.2535)

With PMij = 1

Page 21: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

21

II. Update a tableSimilarity with log-rate model

Page 22: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

22

Updating a table: THE LOG-RATE MODEL IN TWO STEPS

Odds ratio = 2.270837

STEP 1: ITERATIVE PROPORTIONAL FITTING

OCCURRENCES

Sex iter=2a Sex

Age Female Male Total Age Female Male Total

<20 135 74 209 <20 137.2 71.8 209.0

>=20 143 178 321 >=20 146.8 174.2 321.0

Total 278 252 530 Total 284.0 246.0 530.0

INITIAL GUESS iter=2b Sex

Sex Age Female Male Total

Age Female Male Total <20 134.3 73.5 207.8

<20 18.49 2.00 20.49 >=20 143.7 178.5 322.2

>=20 31.55 7.75 39.30 Total 278.0 252.0 530.0

Total 50.04 9.75 59.79

iter=3a Sex

ITERATIVE PROPORTIONAL FITTING Age Female Male Total

<20 135.1 73.9 209.0

iter=1a Sex >=20 143.1 177.9 321.0

Age Female Male Total Total 278.2 251.8 530.0

<20 188.6 20.4 209.0

>=20 257.7 63.3 321.0 iter=3b Sex

Total 446.3 83.7 530.0 Age Female Male Total

<20 135.0 74.0 209.0

iter=1b Sex >=20 143.0 178.0 321.0

Age Female Male Total Total 278.0 252.0 530.0

<20 117.5 61.4 178.9

>=20 160.5 190.6 351.1

Total 278.0 252.0 530.0

Page 23: 1 B. The log-rate model Statistical analysis of occurrence-exposure rates

23

STEP 2: PARAMETERS OF LOG-RATE MODEL (method of means)Estimates/exposures Logarithm of estimate - logarithm of exposure

Sex SexAge Female Male Total Age Female Male Total <20 7.2999 36.9885 44.2884 <20 1.9879 3.6106 5.5985 >=20 4.5333 22.9702 27.5035 >=20 1.5114 3.1342 4.6456 Total 11.8332 59.9587 71.7919 Total 3.4993 6.7448 10.2441

PARAMETERS OF LOG-RATE MODELOverall effect 2.56102758 Mean of all 4 valuesRow effects 0.23820507 Mean of row 1 - overall mean

-0.2382051 Mean of row 2 - overall meanColumn effects -0.8113749 Mean of col. 1 - overall mean

0.81137494 Mean of col. 2 - overall meanInteraction effects 0 F(11) - overall mean - row mean - col. mean

0 F(21) - overall mean - row mean - col. mean0 F(12) - overall mean - row mean - col. mean0 F(22) - overall mean - row mean - col. mean

Updating a table: THE LOG-RATE MODEL IN TWO STEPS