Home | GLMs | Multilevel | Survival | Demography | Stata | R

Relational Logit Models

We illustrate fitting Brass's relational logit model using data from the Seychelles.

Seychelles, Males, 1971-75

Here's a small dataset with the observed survival function for Seychelles males in 1971-75. We also include Brass's standard for convenience. (Alternatively, the Brass standard is available in five and single-year forms in the datasets section, so you can merge on age, see Brassrlm1 and Brassrlm5.)

. input age lx ls

           age         lx         ls
  1.  1 .9641 .8499
  2.  5 .9409 .7691
  3. 10 .9366 .7502
  4. 15 .9343 .7362
  5. 20 .9227 .7130
  6. 25 .9108 .6826
  7. 30 .8981 .6525
  8. 35 .8843 .6223
  9. 40 .8655 .5898
 10. 45 .8424 .5534
 11. 50 .8045 .5106
 12. 55 .7584 .4590
 13. 60 .6967 .3965
 14. 65 .6028 .3221
 15. 70 .4770 .2380
 16. 75 .3451 .1521
 17. end

We generate the Brass logits and plot observed versus standard to see if the relationship is linear

. gen yx = 0.5*log( (1-lx)/lx)

. gen ys = 0.5*log( (1-ls)/ls)

. twoway (scatter yx ys) (lfit yx ys), name(a) ///
>         ytitle(observed) xtitle(standard) ///
>         title(Logit) legend(off)

The fit is not bad at all. Here are the parameter estimates, and the fitted survival, which we plot on a second panel:

. reg yx ys

      Source |       SS       df       MS              Number of obs =      16
-------------+------------------------------           F(  1,    14) = 4557.24
       Model |   4.5875726     1   4.5875726           Prob > F      =  0.0000
    Residual |  .014093195    14  .001006657           R-squared     =  0.9969
-------------+------------------------------           Adj R-squared =  0.9967
       Total |  4.60166579    15   .30677772           Root MSE      =  .03173

------------------------------------------------------------------------------
          yx |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          ys |   1.193756   .0176834    67.51   0.000     1.155829    1.231683
       _cons |  -.6851507   .0082767   -82.78   0.000    -.7029025   -.6673989
------------------------------------------------------------------------------

. predict yf
(option xb assumed; fitted values)

. gen lf = 1/(1+exp(2*yf))

. twoway (scatter lx age) (line lf age), name(b) ///
>         ytitle(lx) title(Survival) legend(off)

. graph combine a b, title(Brass's Relational Logit Model) ///
>         subtitle("Seychelles, Males, 1971-75") xsize(6) ysize(3)

. graph export seym71rlm.png, replace
(file seym71rlm.png written in PNG format)

The parameter estimates could be used, for example, to generate a single-year life table:

. drop _all

. use http://data.princeton.edu/eco572/datasets/brassrlm1

. predict yf
(option xb assumed; fitted values)

. gen lf = 1/(1+exp(2*yf))

. list age lf in 1/5

     +----------------+
     | age         lf |
     |----------------|
  1. |   1   .9689332 |
  2. |   2   .9559815 |
  3. |   3   .9495373 |
  4. |   4   .9430714 |
  5. |   5   .9430353 |
     +----------------+

The relational logit model doesn't always fit well. Typically, lack of fit is noticed at the young and old ages. Zaba(1979) proposed a 4-parameter extension that incorporates two patterns of deviations from the standard and improves the R-squared to 0.9997. Ewbank, De Leon and Stoto (1983) proposed an alternative extension that uses different power transformations at young and old ages, converging to the logit as the powers approach 0. They also propose a small revision of the standard below age 15. Both extensions are non-linear on the additional parameters and thus hard to fit, but the authors provide ingenious approximate estimation procedures.