Longitudinal analysis of psychiatric data using a case register