data=data.frame("id"=c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4),
"grade"=c(11,11,12,13,11,12,12,11,13,14,NA,NA,12,11,13,14),
"age"=c(20,21,22,23,26,27,28,29,19,20,NA,NA,22,23,24,25))
We have data on when student go from one grade to another and want to estimate age-based transition probability from grades using longitudinal data. This is a puzzle to me. It is like markov but we want to use as much base R as can be done using multinomial models. The output ideal is transition matrix shown by age.