Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

AW: st: AW: sort, xtlogit


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   AW: st: AW: sort, xtlogit
Date   Thu, 22 Jul 2010 17:11:34 +0200

<> 

" Even if the dataset is -xtset panelvar timevar- (whether saved or
not),  and one generates new variables by panel, say by the difference
operator, the dataset has to be -xtset- again (unchanged panelvar
timevar)"


Can you explain what you mean using my example code? I cannot see why one
would have to -xtset- anew...

*************
/*
panel with 10 time
periods for 1000 observations
each 
*/ 

clear*
set obs 1000

//id
gen id=_n
lab var id "Person ID"

//individual effect
gen alpha=rnormal()
label var alpha "Individual Effect"

//expand to # of time periods
expand 10

//get time period (after expansion!)
bys id: gen time=_n
lab var time "Time Period"
//residual per time period
gen eps=rnormal()
lab var eps "Idiosyncratic Shock"

gen x=rnormal()
gen y=1+2*x+alpha+eps

compress

//xtset the thing
xtset id time

xtreg y x


gen difftime=D.time
gen lagtime=L.time


xtreg y x difftime lagtime
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Abhimanyu Arora
Gesendet: Donnerstag, 22. Juli 2010 16:45
An: [email protected]
Betreff: Re: st: AW: sort, xtlogit

Thanks for the hint Martin, I gave some more thought and played around
with it and learnt a thing which could be useful to some statalisters.
Even if the dataset is -xtset panelvar timevar- (whether saved or
not),  and one generates new variables by panel, say by the difference
operator, the dataset has to be -xtset- again (unchanged panelvar
timevar)
In my case, -xtlogit- worked, eventually.
Best regards
Abhimanyu


On Thu, Jul 22, 2010 at 4:16 PM, Martin Weiss <[email protected]> wrote:
>
> <>
>
> Could have something to do with the lags in the independent vars
> <http://www.stata.com/statalist/archive/2006-08/msg00613.html>, even
though
> -help xtlogit- clearly does allow -tsvarlist-s.
>
> I would say you
>
> *************
> set tr on
> *************
>
> and report the area around the error.
>
> HTH
> Martin
>
> -----Ursprüngliche Nachricht-----
> Von: [email protected]
> [mailto:[email protected]] Im Auftrag von Abhimanyu
Arora
> Gesendet: Donnerstag, 22. Juli 2010 16:03
> An: [email protected]
> Betreff: st: sort, xtlogit
>
> Dear statalist
>
> I am trying to use the command -xtlogit- and I get a puzzling error
> (pls click on the link below). As you would see, I have sorted my data
> but upon running -xtlogit- I get error r(5) not sorted. What can I be
> missing?
>
> http://screencast.com/t/MDlkZjk4ZjUt
>
> Best regards
> Abhimanyu
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index