I'm using a ADMB for nonlinear modelling based on C++ language
Say I have this matrix :
index# age indicator
1 0 0
2 0 0
3 1 0
4 1 0
5 2 0
6 2 1
I want to get it into
age positives(=sum of indicator values for each age class) total(=count of indivivuals in each age class)
0 0 2
1 0 2
2 1 2
I have not been able to get a loop to work. any suggestion appreciated. thanks.