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, **statalist.org** is already up and running.

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

From |
Abhimanyu Arora <abhimanyu.arora1987@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: AW: sort, xtlogit |

Date |
Thu, 22 Jul 2010 22:39:06 +0200 |

I see. Now I get it, in my actual file, I had generated new variables using -bys actual_panel_variable=....- (actual panel variable is string), The panel variable for xtset has to be numeric, so if equivalently I use -bys panel_variable_id=...- , no error is reported. Thanks very much indeed, Martin for helping me learn by -do-ing! On Thu, Jul 22, 2010 at 9:51 PM, Martin Weiss <martin.weiss1@gmx.de> wrote: > > <> > > I do not quite see your point. In your amendment of the code, you change the > "time" and "id" variables which you previously used to -xtset-. How can > Stata be sure that you did not change its -sort- order? Of course, it needs > to check by re-sort-ing... Comment out the lines re "time" and "id", and the > error no longer happens... > > > > HTH > Martin > > > -----Ursprüngliche Nachricht----- > Von: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Abhimanyu Arora > Gesendet: Donnerstag, 22. Juli 2010 18:00 > An: statalist@hsphsun2.harvard.edu > Betreff: Re: st: AW: sort, xtlogit > > Hi Martin > After you run the above do file, please -do- the following. Could it > have to do with unbalanced panel/missing data? > > > > ******************************* > set obs 10003 > replace id=1001 in 10001 > replace id=1001 in 10002 > replace id=1001 in 10003 > replace time=2 in 10001 > replace y=.6 in 10001 > replace x=.3 in 10002 > replace y=.3 in 10002 > replace x=.4 in 10003 > > gen temp=x[_n]-x[_n-1] > > capture noisily xtreg y x L.x temp > > xtset id time > > xtreg y x L.x temp > ********************************************** > > > > > > > On Thu, Jul 22, 2010 at 5:11 PM, Martin Weiss <martin.weiss1@gmx.de> wrote: >> >> <> >> >> " 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: owner-statalist@hsphsun2.harvard.edu >> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Abhimanyu > Arora >> Gesendet: Donnerstag, 22. Juli 2010 16:45 >> An: statalist@hsphsun2.harvard.edu >> 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 <martin.weiss1@gmx.de> > 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: owner-statalist@hsphsun2.harvard.edu >>> [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Abhimanyu >> Arora >>> Gesendet: Donnerstag, 22. Juli 2010 16:03 >>> An: statalist@hsphsun2.harvard.edu >>> 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/ >> > > * > * 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/

**Follow-Ups**:**Re: st: AW: sort, xtlogit***From:*Abhimanyu Arora <abhimanyu.arora1987@gmail.com>

**References**:**st: sort, xtlogit***From:*Abhimanyu Arora <abhimanyu.arora1987@gmail.com>

**Re: st: AW: sort, xtlogit***From:*Abhimanyu Arora <abhimanyu.arora1987@gmail.com>

**Re: st: AW: sort, xtlogit***From:*Abhimanyu Arora <abhimanyu.arora1987@gmail.com>

- Prev by Date:
**st: interprating orthogonal polynomial regression** - Next by Date:
**Re: st: RE: AW: RE: AW: Polychoric PCA module** - Previous by thread:
**AW: st: AW: sort, xtlogit** - Next by thread:
**Re: st: AW: sort, xtlogit** - Index(es):