Bookmark and Share

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

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

RE: st: Differencing problem

From   Michael Betz <>
To   "" <>
Subject   RE: st: Differencing problem
Date   Thu, 27 Jun 2013 01:56:16 +0000

. d college_

              storage  display     value
variable name   type   format      label      variable label
college_        float  %9.0g                  

. su college_

    Variable |       Obs        Mean    Std. Dev.       Min        Max
    college_ |       716    94970.41    257294.9       3479    3707827

-----Original Message-----
From: [] On Behalf Of Nick Cox
Sent: Wednesday, June 26, 2013 6:53 PM
Subject: Re: st: Differencing problem

I would bet No. Show us the results of

d var
su var


On 26 June 2013 23:38, Michael Betz <> wrote:

> The code you sent works fine. I am using -xtset- to define the panel data. Will that make a difference?

Sergiy Radyakin

> 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 <> wrote:

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

*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index