[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: RE: basic commands question
Nick is correct. I overlooked this crucial
detail! The parentheses only make sense
in some context like
. by <varlist> ( <varlist2> ) : ...
. by (<varlist2>) : ...
is meaningless to Stata, irrespective
of sort order.
I think it remains true that something
like -contract- is your best approach
to produce another dataset of frequencies.
Thanks to those who refrained from referring
me to the tutorial on -by:- in SJ 2(1) 2002.
> > > 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?
> You need to omit the parentheses:
> . by var1 var2: egen freq=count(var3)
> (And be sure you've previously sorted on var1 var2).
* For searches and help try: