Bookmark and Share

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

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

Re: st: RE: xtlogit - alternative set and identifier variable - question

From   Clive Nicholas <>
Subject   Re: st: RE: xtlogit - alternative set and identifier variable - question
Date   Thu, 30 Aug 2012 00:05:54 +0100

Gigi Perry wrote:

> Hi everyone,
> I'm a Quantitative Marketing PhD student from UC Berkeley. This is my first email to statalist - I'm very excited to join!

Welcome. If only one could bottle your unbridled enthusiasm for
something like this by the truckload, perhaps one could make a fortune
selling it as a new brand of absinthe for statisticians. Or perhaps
not. Anyway, to your questions:

> I would like to run xtlogit on a panel data, the fixed effects are for UserID, which repeat for a few WeekYear.
> I tried to learn from the example -
> . webuse union
> . xtlogit union age grade i.not_smsa south##c.year, fe
> 1. Can you please explain me how Stata knows which variable is the identifier variable for the user from this data (in this case it is idcode)?

By using the -xtset- command, -xtlogit- will automatically pick up
your data's panel unit identifier, thus:

. xtset [ivar] [tvar]

so, in your case

. xtset idcode year

Having -xtset- your data means you can run -xtlogit- without the -i()-
option, as you indeed show in your example.

> 2. For a multinomial xtlogit, how does Stata know what the alternative set is?

I'm behind the times on version 9, so others may wish to step in, but
have you consulted the help file for -xtlogit- (or, indeed,
-asclogit-) on how to set up the data and specifiying the
alternative-specific constants for your model? Consulting Long and
Freese's latest tome for Stata Press (the reference I give below is
the edition I have to hand; chapter 7 is the one to consult) should
give you plenty of useful tips and tricks.

Clive Nicholas

[Please DO NOT mail me personally here, but at
<>. Please respond to contributions I make in
a list thread here. Thanks!]

Long S and Freese J (2006) Regression Models for Categorical Dependent
Variables Using Stata (2nd ed), College Station, TX: Stata Press
*   For searches and help try:

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