Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Michael Betz <betz.40@buckeyemail.osu.edu> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | RE: st: Differencing problem |
Date | Wed, 26 Jun 2013 22:38:37 +0000 |
The code you sent works fine. I am using -xtset- to define the panel data. Will that make a difference? -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Sergiy Radyakin Sent: Wednesday, June 26, 2013 4:41 PM To: statalist@hsphsun2.harvard.edu Subject: Re: st: Differencing problem See if this works. The problem may be with the time variable. Sergiy sysuse auto,clear generate t=_n tsset t generate x=d.mpg list mpg x On Wed, Jun 26, 2013 at 4:20 PM, Michael Betz <betz.40@buckeyemail.osu.edu> wrote: > Hi, > > I am trying to use the "d." operator to get differenced observations > but am having some trouble. When I try to calculate differenced > observations using > > gen newvar=d.(var) > > Stata returns each observation as missing. My data has observations for each variable in each of two time periods and variation exists over the two time periods. I've used the "d." before without problems so I'm not sure what I'm missing here. Any help is appreciated. > > Mike > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/