Yihong Ni
> I have a questions about using stata8:
> Is there any way to save the results of tabulate command in
> another .dta file?
-tabulate- does all sorts of things. If you wish to
save frequencies to a data file, check out -contract-
(having first -save-d your data).
> Or..
> why does the following code not work?
>
> . by (var1 var2): egen freq=count(var3)
>
> I want to count the number of occurences (var3) for each
> year for each
> country. how do i save this reorganized result in a .dta file?
I can see no reason why that shouldn't work,
provided that you have previously
. sort var1 var2
and that -var1 var2 var3- are variables in your
data.
As before, you can
. contract var1 var2 var3
. save freq
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/