Chapter 8 – Age-Period-Cohort Analysis: New Models, Methods, and Empirical Applications

Main   Chapter 5   Chapter 6   Chapter 7   Chapter 8   Chapter 9

Table 8.1 The Ordinal Logit CCREM Estimates of Happiness: GSS 1972 – 2004

SAS codes:

********** Creating regressors ---------------------------;
AGE_C = (AGE - 44.8)/10;
AGE_C2 = AGE_C**2;
AGE_CSEX = AGE_C * SEX;
AGE_CRACE = AGE_C * RACE;
AGE_CEDUC1 = AGE_C * EDUC1;
AGE_CEDUC2 = AGE_C * EDUC2;

********** Model A ---------------------------;
proc glimmix data=GSS_happy noitprint;
      class PERIOD COHORT;
      model HAPPY = AGE_C AGE_C2 SEX RACE EDUC1 EDUC2
                  AGE_CSEX AGE_CRACE AGE_CEDUC1 AGE_CEDUC2
       / solution CL
      dist = mult link = clogit;
      random intercept SEX RACE /sub=PERIOD solution;
      random intercept /sub=COHORT solution;
      covtest GLM / WALD;
      NLOPTIONS TECHNIQUE=NRRIDG;
      title "Model A";
run;

********** Model B ---------------------------;
proc glimmix data=GSS_happy noitprint;
      class PERIOD COHORT;
      model HAPPY = AGE_C AGE_C2 SEX RACE EDUC1 EDUC2
                  AGE_CSEX AGE_CRACE AGE_CEDUC1 AGE_CEDUC2
                  INCOME_LOW INCOME_HIGH DIVORCED WIDOWED NEVERMARRIED
                  EXCELLENT FAIR POOR PARTTIME UNEMPLOYED RETIRED NOCHILD RELIGION / solution CL
                  dist = mult link = clogit;
      random intercept SEX RACE /sub=PERIOD solution;
      random intercept /sub=COHORT solution;
      covtest GLM / WALD;
      NLOPTIONS TECHNIQUE=NRRIDG;
      title "Model B";
run;

Table 8.2 CCREM of Happiness: Period- and Cohort-Level Covariates

SAS codes:

********** Creating additional regressors ---------------------------;
SEXGDP = SEX * delta_GDP;
SEXUNEMP = SEX * UNEMPLOY;
RACEGDP = RACE * delta_GDP;
RACEUNEMP = RACE * UNEMPLOY;

********** Model with level-2 covariates---------------------------;
proc glimmix data=GSS_happy noitprint;
      class PERIOD COHORT;
      model HAPPY = delta_GDP UNEMPLOY RCS
                  AGE_C AGE_C2 SEX RACE EDUC1 EDUC2
                  AGE_CSEX AGE_CRACE AGE_CEDUC1 AGE_CEDUC2
                  SEXGDP SEXUNEMP RACEGDP RACEUNEMP
                  INCOME_LOW INCOME_HIGH DIVORCED WIDOWED NEVERMARRIED
                  EXCELLENT FAIR POOR PARTTIME UNEMPLOYED RETIRED NOCHILD RELIGION / solution CL
                  dist = mult link = clogit;
      random intercept SEX RACE /sub=PERIOD solution;
      random intercept /sub=COHORT solution;
      covtest GLM / WALD;
      NLOPTIONS TECHNIQUE=NRRIDG;
      title "Model with level-2 covariates";
run;

Table 8.3 The Poisson CCREM Estimates of Lung Cancer Incidence and Mortality Rates

SAS codes for Incidence models:

********** Creating regressors ---------------------------;
AGE_C = AGE – 57.5;
AGE_C2 = AGE_C**2;
logexp = log(exp);
COHORT_SMOKE_C = COHORT_SMOKE – 11.8;
PERIOD_SMOKE_C = PERIOD_SMOKE – 33.5;

********** Model A---------------------------;
proc glimmix data = lung_Ix maxopt = 25000 ;
      class PERIOD COHORT;
      model incidence = AGE_C AGE_C2 SEX RACE SEX*RACE AGE_C*SEX 
                    AGE_C2*SEX AGE_C*RACE AGE_C2*RACE / solution CL
                  dist = poisson link = log offset = logexp;
      random intercept SEX RACE /sub=COHORT solution;
      random intercept SEX RACE/sub=PERIOD solution;
      covtest GLM / WALD;
      NLOPTIONS TECHNIQUE=NRRIDG;
title 'Model A’;
run; 

********** Model B---------------------------;
proc glimmix data = lung_Ix maxopt = 25000 ;
      class PERIOD COHORT;
      model incidence = COHORT_SMOKE_C PERIOD_SMOKE_C
                  AGE_C AGE_C2 SEX RACE SEX*RACE AGE_C*SEX 
                  AGE_C2*SEX COHORT_SMOKE_C*SEX PERIOD_SMOKE_C*SEX
                  AGE_C*RACE AGE_C2*RACE COHORT_SMOKE_C*RACE PERIOD_SMOKE_C*RACE
                  / solution CL
                  dist = poisson link = log offset = logexp;
      random intercept SEX RACE /sub=COHORT solution;
      random intercept SEX RACE/sub=PERIOD solution;
      covtest GLM / WALD;
      NLOPTIONS TECHNIQUE=NRRIDG;
title 'Model B’;
run;

Table 8.7 Alternative Estimates of Coefficients and Summary Statistics: REML vs. Bayes Via Gibbs Under Diffuse-Normal-Gamma Priors

WinBUGS code for Bayes:

model
      {
# Level 1 model
      for (i in 1:N) {
            wordsum[i] ~ dnorm(mu[i], tau.e)
            mu[i] <- gamma0 + gamma[1]*newsdjc[i] + gamma[2]*tvjc[i]
                         + beta[1]*age1c[i] + beta[2]*age2c[i] + beta[3]* educc[i] + beta[4]*female[i] + beta[5]*black[i] + u0[cohort[i]-1] + v0[period[i]]
        }

# Higher level models
      for (j in 1:19) {
            u0[j] ~ dnorm(0, p.tau.u)
            }
      for (k in 1:15) {
            v0[k] ~ dnorm(0, p.tau.v)
            }

# Prior for fixed effect     
      gamma0 ~ dnorm(0, 1.0E-6)
      for (p in 1:2) {gamma[p] ~ dnorm(0, 1.0E-6)}
      for (q in 1:5) {beta[q] ~ dnorm(0, 1.0E-6)}

# Priors for variance components
      p.tau.u ~ dgamma(0.001, 0.001)
      tau.u <- 1/p.tau.u
      p.tau.v ~ dgamma(0.001, 0.001)
      tau.v <- 1/p.tau.v
      tau.e ~ dgamma(0.001, 0.001)
      sigma2 <- 1/tau.e

   }

Table 8.8 Estimated HAPC-VFR Models of Self-Rated Health, NHIS, 1984-2007

SAS codes:

********** Model for the Mean (Beta) ---------------------------;
proc mixed data=NHIS_Health covtest CL;
      class PERIOD COHORT;
      model HEALTH = AGE_C AGE_C2 MALE WHITE MARRIED EDUC_C
                  EMPLOY INCOME_C REDESIGN REDESIGN*MALE /solution outpred=a;
      random PERIOD COHORT / solution;
      title "Table 6.14 HAPC-CCREM: Beta – conditional mean";
run;

********** Model for the Variance (Gamma) ---------------------------;
data temp;
set a;
sigma2=resid*resid;
run;

proc glimmix data=temp noitprint;
      class PERIOD COHORT;
      model sigma2 = AGE_C AGE_C2 MALE WHITE MARRIED EDUC_C
                  EMPLOY INCOME_C REDESIGN REDESIGN*MALE /solution
                  dist=gamma link=log;
      random PERIOD COHORT / solution;
      NLOPTIONS TECHNIQUE=NMSIMP;
      output out=out1 pred=pred1;
      title "HAPC-CCREM: gamma - residuals";
run;
data temp1;
set out1;
weight1= 1/exp(pred1);
run;

/*iteration 1*/
proc mixed data=temp1 covtest CL;
      class PERIOD COHORT;
      weight weight1;
      model HEALTH = AGE_C AGE_C2 MALE WHITE MARRIED EDUC_C
                  EMPLOY INCOME_C REDESIGN REDESIGN*MALE /solution outpred=b;
      random PERIOD COHORT / solution;
run;
data temp2;
set b;
sigma2=resid*resid;
run;
proc glimmix data=temp2 noitprint;
      class PERIOD COHORT;
      model sigma2 = AGE_C AGE_C2 MALE WHITE MARRIED EDUC_C
                  EMPLOY INCOME_C REDESIGN REDESIGN*MALE /solution
                  dist=gamma link=log;
      random PERIOD COHORT / solution;
      NLOPTIONS TECHNIQUE=NMSIMP;
      output out=out2 pred=pred2;
run;
data temp3;
set out2;
weight2= 1/exp(pred2);
run;

/*iteration 2*/
proc mixed data=temp3 covtest CL;
      class PERIOD COHORT;
      weight weight2;
      model HEALTH = AGE_C AGE_C2 MALE WHITE MARRIED EDUC_C
                  EMPLOY INCOME_C REDESIGN REDESIGN*MALE /solution outpred=c;
      random PERIOD COHORT / solution;
run;
data temp4;
set c;
sigma2=resid*resid;
run;
proc glimmix data=temp4 noitprint;
      class PERIOD COHORT;
      model sigma2 = AGE_C AGE_C2 MALE WHITE MARRIED EDUC_C
                  EMPLOY INCOME_C REDESIGN REDESIGN*MALE /solution
                  dist=gamma link=log;
      random PERIOD COHORT / solution;
      NLOPTIONS TECHNIQUE=NMSIMP;
      output out=out3 pred=pred3;
run;
data temp5;
set out3;
weight3= 1/exp(pred3);
run;

/*repeat until convergence: it took 5 iterations for this example*/