Hello all,

I'm a new STATA user and I come to seek for some help.


I'm trying to model access to university, using Survival analysis. I have
2 cohorts of students to be compared. Two of my variables (year and semester) are related to student registration. My questions are:

1) How do I calculate (identify) the first year of entry in university (the failure event) ? I tried the following command, after creating a variable called universite (0 = No; 1= Yes) indicating if the person went to university or not:


by ident (annee session universite), sort : egen annee_acc_1 = min(annee) if universite==1

And the result is :

__000001 not found
r(111);



2) I'd like to consider only one line for each individual at risk of entering university in the first step of the analysis. In the second step, I'll consider one line for each year spent before
entering university
. How do I it ?


Sorry if the idea is not clearly stated. Struggling with both the language and the statistics.

Thank you for your help in advance

Michel