Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: Lag Variable in Panel Data


From   "Salvati, Jean" <[email protected]>
To   <[email protected]>
Subject   RE: st: Lag Variable in Panel Data
Date   Wed, 15 Feb 2006 15:11:45 -0500

tsset cid tid 
gen l1var = l.var

The variable cid must be numerical. If it is not:

egen cid_num = group(cid)

Jean Salvati

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> Reka Sundaram-Stukel
> Sent: Wednesday, February 15, 2006 3:04 PM
> To: [email protected]
> Subject: Re: st: Lag Variable in Panel Data
> 
> Dear Abhijit,
> 
> bysort cid (tid): g variablet_1=variable[_n-1]
> 
> hope this helps.
> 
> Reka
> 
> 
> 
> On Feb 15, 2006, at 12:35 PM, Abhijit Sen Gupta wrote:
> 
> > Hi!
> >   Could anybody please tell me how to generate lagged values of a 
> > variable in panel data. My panel id is cid and time id is tid.
> > Thanks
> > Cheers
> > Abhijit
> >
> > --- Richard Williams <[email protected]>
> > wrote:
> >
> >> Thanks to Kit Baum, yet another update to -gologit2- is 
> now available 
> >> from SSC - and unlike most previous updates, this one 
> actually offers 
> >> some added functionality and not just bug fixes!
> >>
> >> * While gologit2 continues to work in Stata 8.2, if you are using 
> >> Stata 9, the by, nestreg, stepwise, xi, and possibly other prefix 
> >> commands are allowed.  That is, Stata 9 users get added 
> functionality 
> >> but everything else still works ok if you have 8.2.
> >> (I'm not sure
> >> how much longer I will try to keep new versions running 
> under 8.2 but 
> >> for now at least it was surprisingly easy to do.)
> >>
> >> * If the user considers them more appropriate for their 
> data, probit, 
> >> complementary log-log, and log-log links can be used instead of 
> >> logit. The link() function specifies the link function to 
> be used.  
> >> The legal values are link(logit), link(probit), link(cloglog) and 
> >> link(loglog) which can abbreviated as link(l), link(p), 
> link(c) and 
> >> link(ll). link(logit) is the default if the option is omitted.
> >>
> >> * The ancillary file gologit2.pdf contains many examples 
> and has been 
> >> updated to document the new features.  However, ancillary files do 
> >> not automatically get updated when you update the program. 
>  Therefore 
> >> you may wish to download it directly from
> >>
> >> http://www.nd.edu/~rwilliam/gologit2/gologit2.pdf
> >>
> >> * For more info, there is a gologit2 general info page at
> >>
> >> http://www.nd.edu/~rwilliam/gologit2/index.html
> >>
> >> and a troubleshooting FAQ at
> >>
> >> http://www.nd.edu/~rwilliam/gologit2/tsfaq.html
> >>
> >> Here is the overall description of the program:
> >>
> >> gologit2 estimates generalized ordered logit models for ordinal 
> >> dependent variables. A major strength of gologit2 is that 
> it can also 
> >> estimate three special cases of the generalized
> >> model: the
> >> proportional odds/parallel lines model, the partial 
> proportional odds 
> >> model, and the logistic regression model. Hence,
> >> gologit2 can
> >> estimate models that are less restrictive than the 
> proportional odds 
> >> /parallel lines models estimated by ologit (whose assumptions are 
> >> often violated) but more parsimonious and interpretable than those 
> >> estimated by a non-ordinal method, such as multinomial logistic 
> >> regression (i.e. mlogit). Other key strengths of gologit2 include 
> >> options for linear constraints, alternative model 
> parameterizations, 
> >> automated model fitting, survey data (svy) estimation, alternative 
> >> link functions (logit, probit, complementary log-log and log-log), 
> >> and the computation of estimated probabilities via the predict 
> >> command. gologit2 works under both Stata 8.2 and Stata 9 
> or higher. 
> >> Syntax is the same for both versions; but if you are using 
> Stata 9 or 
> >> higher,
> >> gologit2 supports
> >> several prefix commands, including by, nestreg, xi and sw. 
> gologit2 
> >> is inspired by Vincent Fu's gologit program and is backward 
> >> compatible with it but offers several additional powerful options.
> >>
> >> -------------------------------------------
> >> Richard Williams, Notre Dame Dept of Sociology
> >> OFFICE: (574)631-6668, (574)631-6463
> >> FAX:    (574)288-4373
> >> HOME:   (574)289-5227
> >> EMAIL:  [email protected]
> >> WWW (personal):    http://www.nd.edu/~rwilliam
> >> WWW (department):    http://www.nd.edu/~soc
> >>
> >> *
> >> *   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/
> >>
> >
> >
> >
> > "Some people see things as they are and say why.
> >  I dream things that never were and say why not?"
> >
> > Abhijit Sen Gupta
> > Graduate Student
> > University of California at Santa Cruz Visit me : - 
> > http://econ.ucsc.edu/grads/abhijit
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around 
> > http://mail.yahoo.com
> > *
> > *   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/
> 

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