[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: egen rowmin rowmax
Thanks Quang, Michael and Philipp, for your insights.
As it turns out, egen [var] = rowsum([varlist]) is equivalent to
egen [var] = total([varlist]).
My solution turned out to be to replace all of the zeros in the seq*
cells with missings, then execute
egen byte minmath = rowmin(seq*) /*without the condition!*/
and add the following line of code:
replace minmath = 0 if minmath==.
Quang Nguyen wrote:
>Could you try this:
>egen byte minmath = rowmin(seq*) if rowsum~=0
>Please note that minmath is greater than zero iff ALL scores for this
>observation is greater than zero.
>On 11/4/06, Teresa Dale Nelson <firstname.lastname@example.org> wrote:
>> Hi Michael,
>> I believe the condition that rowsum not equal zero would take care of
>> that. Do you have a thought about this conditionality that I'm missing?
>> egen byte minmath = rowmin(mathseq*) if rowsum~=0
>> Michael Blasnik wrote:
>> >It looks like the rowmin should always be zero or missing -- at least
>> >your description of the data is accurate. How could the rowmin be
>> >than zero if all of the rows contain at least a zero?
>> >Michael Blasnik
>> >----- Original Message -----
>> >From: "Teresa Dale Nelson" <email@example.com>
>> >To: <firstname.lastname@example.org>
>> >Sent: Saturday, November 04, 2006 6:30 PM
>> >Subject: Re: st: egen rowmin rowmax
>> ><snip> Instead, the var for egen var=rowmin(varlist) is evaluated to
>> zero or
>> >missing. In fact, some of
>> > the rows have all zeroes; the rest contain some zeroes and a few
>> >between 1 and 13.
>> >* 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/
>> * 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/
>* For searches and help try:
* For searches and help try: