Question about Create Command, DIFF subcommand...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about Create Command, DIFF subcommand...

Hal 9000
Hello List,

I have been inching my way through the command syntax docs and I have
encountered something that I don't understand. The CREATE command has
subcommand DIFF, which requires 2 specifications: the variable name, and the
degree of difference. When the degree of difference is specified as 1, it
appears to take the difference of the current record less the previous
record. [create VAR1 = diff(D_VAR, 1)].

But, when the degree of difference is specified as greater than 1, I can't
figure out what is happening.
For example, starting with this dataset.........

        V1
***************************
         1
         2
         7
         4
        10

........this syntax.........

create DIFF_1 = diff(v1, 1).
create DIFF_2 = diff(v1, 2).
...produces these results:

      V1          DIFF_1   DIFF_2
*****************************************
         1
         2           1
         7           5           4
         4          -3          -8
        10           6           9

DIFF_1 makes perfect sense to me; DIFF_2 does not. Does any knowledgeable
person care to shed some light?
Thank You!
-Gary
Reply | Threaded
Open this post in threaded view
|

Fwd: Question about Create Command, DIFF subcommand...

Hal 9000
 Excellent. Yes, it does appear that way. It's funny, I only showed the 1st
and 2nd degree differences in the same dataset to be concise...though I now
see it is actually revealing. As a follow-up question to the list, I am
curious how other users might use this type of function. I have an itchy
feeling that I might find a use for this one day. Thanks Justin!
-Gary


 On 9/4/06, Justin Black <[hidden email]> wrote:

>
> Hi Gary,
>
> I'm not sure how exactly the DIFF subcommand works, but it appears
> from your output that specifying the degree of difference as 2
> produces the differences of the 1 degree differences.
>
> --Justin
>
> On 9/4/06, Hal 9000 <[hidden email]> wrote:
> > Hello List,
> >
> > I have been inching my way through the command syntax docs and I have
> > encountered something that I don't understand. The CREATE command has
> > subcommand DIFF, which requires 2 specifications: the variable name, and
> the
> > degree of difference. When the degree of difference is specified as 1,
> it
> > appears to take the difference of the current record less the previous
> > record. [create VAR1 = diff(D_VAR, 1)].
> >
> > But, when the degree of difference is specified as greater than 1, I
> can't
> > figure out what is happening.
> > For example, starting with this dataset.........
> >
> >         V1
> > ***************************
> >          1
> >          2
> >          7
> >          4
> >         10
> >
> > ........this syntax.........
> >
> > create DIFF_1 = diff(v1, 1).
> > create DIFF_2 = diff(v1, 2).
> > ...produces these results:
> >
> >       V1          DIFF_1   DIFF_2
> > *****************************************
> >          1
> >          2           1
> >          7           5           4
> >          4          -3          -8
> >         10           6           9
> >
> > DIFF_1 makes perfect sense to me; DIFF_2 does not. Does any
> knowledgeable
> > person care to shed some light?
> > Thank You!
> > -Gary
> >
>
Reply | Threaded
Open this post in threaded view
|

FW: Fwd: Question about Create Command, DIFF subcommand...

Sereke Berhane
In reply to this post by Hal 9000
Dear lists:
  I am very happy for writing me especially with examples.
 And I would like you to strongly stress mainly on commands and
subcommands along with simple data.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Hal 9000
Sent: Tuesday, September 05, 2006 12:56 AM
To: [hidden email]
Subject: Fwd: Question about Create Command, DIFF subcommand...

 Excellent. Yes, it does appear that way. It's funny, I only showed the
1st
and 2nd degree differences in the same dataset to be concise...though I
now
see it is actually revealing. As a follow-up question to the list, I am
curious how other users might use this type of function. I have an itchy
feeling that I might find a use for this one day. Thanks Justin!
-Gary


 On 9/4/06, Justin Black <[hidden email]> wrote:

>
> Hi Gary,
>
> I'm not sure how exactly the DIFF subcommand works, but it appears
> from your output that specifying the degree of difference as 2
> produces the differences of the 1 degree differences.
>
> --Justin
>
> On 9/4/06, Hal 9000 <[hidden email]> wrote:
> > Hello List,
> >
> > I have been inching my way through the command syntax docs and I
have
> > encountered something that I don't understand. The CREATE command
has
> > subcommand DIFF, which requires 2 specifications: the variable name,
and
> the
> > degree of difference. When the degree of difference is specified as
1,
> it
> > appears to take the difference of the current record less the
previous

> > record. [create VAR1 = diff(D_VAR, 1)].
> >
> > But, when the degree of difference is specified as greater than 1, I
> can't
> > figure out what is happening.
> > For example, starting with this dataset.........
> >
> >         V1
> > ***************************
> >          1
> >          2
> >          7
> >          4
> >         10
> >
> > ........this syntax.........
> >
> > create DIFF_1 = diff(v1, 1).
> > create DIFF_2 = diff(v1, 2).
> > ...produces these results:
> >
> >       V1          DIFF_1   DIFF_2
> > *****************************************
> >          1
> >          2           1
> >          7           5           4
> >          4          -3          -8
> >         10           6           9
> >
> > DIFF_1 makes perfect sense to me; DIFF_2 does not. Does any
> knowledgeable
> > person care to shed some light?
> > Thank You!
> > -Gary
> >
>