pspp-users
[Top][All Lists]
Advanced

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

Re: Recode


From: pohaku
Subject: Re: Recode
Date: Wed, 9 Jan 2013 14:04:17 -0800 (PST)


In conclusion...

Thanks so much ... so order of writing recode *can* be important if you have
a border line case... the effective pseudo code would be that explains
recode for continuous numeric data....

Var real x = real from 0 to 4.5.
Var string code ;

If  between(x, 2.222,2.555)
        Code="C"
        Leave
Else if between (x, 2.555, 3.000)
             Code = "B"
            Leave
Else if between (x,3.000, 3.500)
          Code = "A"
        Leave
Etc.

Where between  is true (a<=x<=b) the thus a value of 2.555 would fall in the
c range because it is between 2.222 and 2.555 and that range is the first to
qualify as the if statement.




Ben Pfaff wrote:
> 
> On Wed, Jan 09, 2013 at 10:37:55AM -0800, pohaku wrote:
>> 
>> 
>> 
>> Ben Pfaff wrote:
>> > 
>> > On Wed, Jan 09, 2013 at 09:22:12AM -0800, pohaku wrote:
>> >> 
>> >> In recode you use (num1 thru num2 = ?). But, suppose you are recoding
>> >> continuous data, then it is likely that num2 of one code is num1 of
>> next.
>> >> Example recoding student GPA
>> >> 
>> >> (2.222 thru 2.555 = C)
>> >> (2.555 thru 3.000 = B)
>> >> 
>> >> the question is -- is the logic of the recode 
>> >> 
>> >> (2.222<= X <2.555 =C)
>> >> (2.555<=X  <3.000 = B)
>> > 
>> > It's 2.222 <= x <= 2.555 becomes C, 2.555 < x <= 3.000 becomes B.
>> > 
>> > to be clear... the firs recode is inclusive on upper and lower end of
>> > range and successive recodes are exclusive and inclusive
> 
> All of them include both ends of the range, but they are checked in the
> order they are written and only the first match is executed.
> 
>> > (2.222<= X <=2.555 =C)
>> > (2.555 < X  =< 3.000 = B)
>> > (3.000 < X  =< 4.000 = A)
>> > (4.000 < X  =< 4.200 = A+)
>> > (4.200 < X <= highest =A++)
>> > 
>> > is this the logic above? for real/continuous data the boundaries are
>> > important. all the documentation is more or less categorical or
>> discrete
>> > in nature thus this boundary issue doesn't come up. just that i am
>> using
>> > PSPP for first time in intro stats course and chapter 2 is qualitative
>> > descriptive stats and recoding of continuous to categorical is rather
>> > essential to create a meaningful frequency distribution table with a
>> > reasonable number of rows.
> 
> Well, your example only included the first two, but yes it would be easy
> to rewrite the informal notation above into a real RECODE command with
> those semantics.
> 
> _______________________________________________
> Pspp-users mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/pspp-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Recode-tp34879175p34880343.html
Sent from the Gnu - PSPP - Users mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]