Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: (Moving Maximum in Unbalanced panel) Max of a variable in thelast 12 months?


From   Winfred Avogo <[email protected]>
To   [email protected]
Subject   st: RE: RE: (Moving Maximum in Unbalanced panel) Max of a variable in thelast 12 months?
Date   Tue, 05 Jul 2005 18:38:30 -0700

Dear All

I am getting an error message I thought someone might help me to fix. I
am fitting a linear model on survey data and have issued the following
commands and got the following error message:

 
svyset [pweight= gswgt3_2], strata (region) psu ( psuscid)

      pweight: gswgt3_2
          VCE: linearized
     Strata 1: region
         SU 1: psuscid
        FPC 1: <zero>

svy: regress distress llight lmed ldark lblack aalight aamed aadark
aablack 
(running regress on estimation sample)

<istmt>:  3499  _robust2() not found
Mata run-time error
r(3499);

end of do-file
r(3499);

I don't have a variable called _robust2 () in my data.

Thanks so much for your assistance.

Winfred


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nick Cox
Sent: Tuesday, July 05, 2005 6:26 PM
To: [email protected]
Subject: st: RE: (Moving Maximum in Unbalanced panel) Max of a variable
in the last 12 months?

. ssc desc mvsumm 

Nick 
[email protected] 

Sergio Correia
 
> I'm trying to generate a variable "Y" that is the maximum value of
> another one (lets call it "X") in the last 12 months.
> 
> Now, I'm using an unbalanced panel, so I think I need to use 
> a "by id:" command.
> I have already set the time series and the panel identifiers ("date"
> and "id"), so I can use the lag and difference operators to take
> account of the nature of the panel.
> 
> My problem is that I need the maximum value with respect to every
> month and every id.
> Previously, I needed to calculate the maximum value in the last 12
> months, with respect to the last date of the panel (2004m12). So I
> just did a drop "if date<2004m1"
> 
> But now I need to calculate the max. for every month.. that is, the
> **moving maximum, for each ID, taking into account the unbalancedness
> of the panel**.
> 
> Any ideas? I'm kinda stuck here =) Thanks a lot!
> 
> PS: I'm using StataSE 8

*
*   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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index