Using _n and _N in conjunction with the by command can produce some very useful results. Let’s see how _n and _N work.Īs you can see, the variable id contains observation number running from 1 to 7 and nt is the total number of observations, which is 7. _N is Stata notation for the total number of observations. _n is 1 in the first observation, 2 in the second, 3 in the third, and so on. _n is Stata notation for the current observation number. Stata has two built-in variables called _n and _N.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |