Hi forum! I have recently picked up runMLwiN for my dissertation work. I am working on an age-period-cohort (APC) analysis of the change in tolerance toward homosexuality that has occurred in recent years. As part of this paper I intend to employ the cross-classified random effects APC model developed by Yang & Land (2006, 2008), which treats individuals as nested within time periods and birth cohorts (hence the cross-classified structure of the data). In line with this, I want to model age and other (categorical) covariates as fixed effects at level 1, while I want to include period (10 surveys) and cohort (10 10-birthyear groups) as random effects at level 2.

However, I have had some problems implementing this model. In Stata I have been trying the xtmixed command:

Code: Select all

`xtmixed tolerance age || _all: R.surveyyear || _all: R.cohort`

Running this, I receive one estimator for each of the level 2 variables, instead of a random effects coefficient for each individual period k and each individual cohort group j. Individual

*predictions *for the random effects can be obtained by running:

afterwards, but it appears like Stata is unable to display the individual random effects regression coefficients that I need.

This is the reason to why I have picked up runMlwiN, but so far I have struggled in figuring out how the code should be written. The code I have been running so far is:

Code: Select all

`. runmlwin tolerance cons age, level3(cons: cohort1-cohort10, diagonal) level2(cons: period1-period10, diagonal) level1(id: cons) nosort`

Where cohort1-cohort10 and period1-period10 are generated from:

Code: Select all

```
. quietly tabulate birthyear10, generate(cohort)
. quietly tabulate survey, generate(period)
```

The output of this model is very strange, however, and not in line with results from various fixed effects models and graphical plots. I have scanned the web for guidance but found none for APC analysis, so I would really appreciate if anyone could give me a helping hand. As an end note I should add that I am well aware that the cross-classified random effects APC model has been severely questioned (Bell and Jones, 2014), but my use of the model will mostly be of supplementary nature.

Kind regards,

David Ekstam

PhD candidate

Department of Government

Uppsala University

Yang, Y., Land, K.C., 2008. Age–Period–Cohort Analysis of Repeated Cross-Section Surveys: Fixed or Random Effects? Sociological methods & research 36, 297–326.

Yang, Y., Land, K.C., 2006. A mixed models approach to the age-period-cohort analysis of repeated cross-section surveys, with an application to data on trends in verbal test scores. Sociological methodology 36, 75–97.

Bell, A., Jones, K., 2014. Another’futile quest’? A simulation study of Yang and Land’s Hierarchical Age-Period-Cohort model. Demographic Research 30, 333.