Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: tabstatmat question

From   Austin Nichols <>
Subject   Re: st: tabstatmat question
Date   Fri, 2 Sep 2011 12:08:31 -0400

Sergio <> :
Now I have no idea what you are trying to do. For the mean by group,
egen mby=mean(num_typ3), by(zone wave)
but you are referring to (probably) nonexistent row and column numbers
of a matrix in your example.

On Fri, Sep 2, 2011 at 10:42 AM, Alvarez,Sergio <> wrote:
> Thanks Austin and Nick for your help.  I used what Austin suggested (which
> is what Nick also suggested) and it worked. However, when I try to create
> the variable that contains the mean by group it works for some observations,
> but missing values are created for most of them.  I tried both:
> gen meancatch = TABLE[zone,wave]
> and
> gen meancatch = TABLE[byv,num_typ3]
> For the first line of code, it creates the correct value for all
> observations where wave = 1, but not for any others.  The second line
> creates missing values at random (as far as I can tell).
> I'd appreciate any tips.

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index