Recode value to sysmis

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

Recode value to sysmis

Kevin Bladon
Hello all,

Just wondering if someone knows the code that would be required to recode
certain values to be recognized as sysmis.

For instance, using the following data:

Twp  Rge  Stand   DBH
76   25   1       999
76   25   1       25.4
76   25   2       999
76   26   1       999

I would like to have SPSS recognize the first 999 as a sysmis value, but not
change any of the other values.  Any help with this problem would be greatly
appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Recode value to sysmis

Kevin Bladon
Gary,

Wouldn't this recode ALL of the DBH values that equal 999 to sysmis?�
Can I combine this "recode" code with an IF statement to select only
those cases that I want (in this example Twp 26, Rge 25, Stand 1).

Thanks in advance,
kevin.

On Aug 22, 2006 13:15, Hal 9000 <[hidden email]> wrote:

>recode DBH (999 = sysmis).
>
>I think this should do it.
>-Gary
>
>
>
>
>On 8/22/06, Kevin Bladon wrote:
>>
>>Hello all,
>>
>>Just wondering if someone knows the code that would be required to
>>recode
>>certain values to be recognized as sysmis.
>>
>>For instance, using the following data:
>>
>>Twp Rge Stand DBH
>>76 25 1 999
>>76 25 1 25.4
>>76 25 2 999
>>76 26 1 999
>>
>>I would like to have SPSS recognize the first 999 as a sysmis value,
>>but
>>not
>>change any of the other values. Any help with this problem would be
>>greatly
>>appreciated.
>>


Kevin Bladon, Ph.D., A.Ag.
Resource Analyst
Silvacom Ltd.
3825 - 93 Street
Edmonton, AB
T6E 5K5
Phone: 780.462.3238
Fax: 780.462.4726
E-mail: [hidden email]
www.silvacom.com

"Make every obstacle an opportunity."
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � - Lance Armstrong
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � Cancer survivor and 7 time Tour de
France champion (1999-2005)
Reply | Threaded
Open this post in threaded view
|

Re: Recode value to sysmis

Edward Boadi
In reply to this post by Kevin Bladon
Try this :

NUMERIC DUP (F4).
sort cases by DBH.
COMPUTE DUP=0.
IF DBH=LAG(DBH)  DUP=LAG(DUP) + 1.
EXECUTE.
* Set DBH equal to a non existant value of DBH, here it was set to 0.
DO IF ( DUP = 0 &  DBH = 999 ) .
Compute   DBH= 0.
END IF.
RECODE DBH (0=SYSMIS).
EXECUTE.

Edward.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]]On Behalf Of
Kevin Bladon
Sent: Tuesday, August 22, 2006 3:00 PM
To: [hidden email]
Subject: Recode value to sysmis


Hello all,

Just wondering if someone knows the code that would be required to recode
certain values to be recognized as sysmis.

For instance, using the following data:

Twp  Rge  Stand   DBH
76   25   1       999
76   25   1       25.4
76   25   2       999
76   26   1       999

I would like to have SPSS recognize the first 999 as a sysmis value, but not
change any of the other values.  Any help with this problem would be greatly
appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Recode value to sysmis

Christian Ganser
In reply to this post by Kevin Bladon
You could type

do if twp=26 and rge=25 and stand=1.
recode DBH (999=sysmis).
end if.


Kevin Bladon wrote:

> Gary,
>
> Wouldn't this recode ALL of the DBH values that equal 999 to sysmis?�
> Can I combine this "recode" code with an IF statement to select only
> those cases that I want (in this example Twp 26, Rge 25, Stand 1).
>
> Thanks in advance,
> kevin.
>
> On Aug 22, 2006 13:15, Hal 9000 <[hidden email]> wrote:
>
>
>> recode DBH (999 = sysmis).
>>
>> I think this should do it.
>> -Gary
>>
>>
>>
>>
>> On 8/22/06, Kevin Bladon wrote:
>>
>>> Hello all,
>>>
>>> Just wondering if someone knows the code that would be required to
>>> recode
>>> certain values to be recognized as sysmis.
>>>
>>> For instance, using the following data:
>>>
>>> Twp Rge Stand DBH
>>> 76 25 1 999
>>> 76 25 1 25.4
>>> 76 25 2 999
>>> 76 26 1 999
>>>
>>> I would like to have SPSS recognize the first 999 as a sysmis value,
>>> but
>>> not
>>> change any of the other values. Any help with this problem would be
>>> greatly
>>> appreciated.
>>>
>>>
>
>
> Kevin Bladon, Ph.D., A.Ag.
> Resource Analyst
> Silvacom Ltd.
> 3825 - 93 Street
> Edmonton, AB
> T6E 5K5
> Phone: 780.462.3238
> Fax: 780.462.4726
> E-mail: [hidden email]
> www.silvacom.com
>
> "Make every obstacle an opportunity."
> � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � - Lance Armstrong
> � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � Cancer survivor and 7 time Tour de
> France champion (1999-2005)
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Recode value to sysmis

Kevin Bladon
Thanks to all!

On Aug 22, 2006 14:05, Christian Ganser wrote:

>You could type
>
>do if twp=26 and rge=25 and stand=1.
>recode DBH (999=sysmis).
>end if.
>
>
>Kevin Bladon wrote:
>>Gary,
>>
>>Wouldn't this recode ALL of the DBH values that equal 999 to sysmis?�
>>Can I combine this "recode" code with an IF statement to select only
>>those cases that I want (in this example Twp 26, Rge 25, Stand 1).
>>
>>Thanks in advance,
>>kevin.
>>
>>On Aug 22, 2006 13:15, Hal 9000 <[hidden email]> wrote:
>>
>>
>>>recode DBH (999 = sysmis).
>>>
>>>I think this should do it.
>>>-Gary
>>>
>>>
>>>
>>>
>>>On 8/22/06, Kevin Bladon wrote:
>>>
>>>>Hello all,
>>>>
>>>>Just wondering if someone knows the code that would be required to
>>>>recode
>>>>certain values to be recognized as sysmis.
>>>>
>>>>For instance, using the following data:
>>>>
>>>>Twp Rge Stand DBH
>>>>76 25 1 999
>>>>76 25 1 25.4
>>>>76 25 2 999
>>>>76 26 1 999
>>>>
>>>>I would like to have SPSS recognize the first 999 as a sysmis value,
>>>>but
>>>>not
>>>>change any of the other values. Any help with this problem would be
>>>>greatly
>>>>appreciated.
>>>>
>>>>
>>
>>
>>Kevin Bladon, Ph.D., A.Ag.
>>Resource Analyst
>>Silvacom Ltd.
>>3825 - 93 Street
>>Edmonton, AB
>>T6E 5K5
>>Phone: 780.462.3238
>>Fax: 780.462.4726
>>E-mail: [hidden email]
>>www.silvacom.com
>>
>>"Make every obstacle an opportunity."
>>� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � - Lance
>>Armstrong
>>� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � Cancer
>>survivor and 7 time Tour de
>>France champion (1999-2005)
>>
>>


Kevin Bladon, Ph.D., A.Ag.
Resource Analyst
Silvacom Ltd.
3825 - 93 Street
Edmonton, AB
T6E 5K5
Phone: 780.462.3238
Fax: 780.462.4726
E-mail: [hidden email]
www.silvacom.com

"Make every obstacle an opportunity."
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � - Lance Armstrong
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � Cancer survivor and 7 time Tour de
France champion (1999-2005)
Reply | Threaded
Open this post in threaded view
|

Re: Recode value to sysmis

Art Kendall
In reply to this post by Christian Ganser
It would usually be better to preserve the distinction between system
missing and user missing values.  This is extremely useful in larger
analyses. It is a major advantage of SPSS over other packages.

Since the user is declaring this missing, he must have a reason and a
user-missing value should be assigned.

system missing means that the input data could not be read as the kind
of variable it was called, or that a transformation was not able to
perform the calculation requested.

do if twp eq 26 and rge eq 25 and stand eq 1.
recode DBH (999=-999).
end if.
missing values DBH (-999).

Art
Social Research Consultants


Christian Ganser wrote:

> You could type
>
> do if twp=26 and rge=25 and stand=1.
> recode DBH (999=sysmis).
> end if.
>
>
> Kevin Bladon wrote:
>
>> Gary,
>>
>> Wouldn't this recode ALL of the DBH values that equal 999 to sysmis?�
>> Can I combine this "recode" code with an IF statement to select only
>> those cases that I want (in this example Twp 26, Rge 25, Stand 1).
>>
>> Thanks in advance,
>> kevin.
>>
>> On Aug 22, 2006 13:15, Hal 9000 <[hidden email]> wrote:
>>
>>
>>> recode DBH (999 = sysmis).
>>>
>>> I think this should do it.
>>> -Gary
>>>
>>>
>>>
>>>
>>> On 8/22/06, Kevin Bladon wrote:
>>>
>>>> Hello all,
>>>>
>>>> Just wondering if someone knows the code that would be required to
>>>> recode
>>>> certain values to be recognized as sysmis.
>>>>
>>>> For instance, using the following data:
>>>>
>>>> Twp Rge Stand DBH
>>>> 76 25 1 999
>>>> 76 25 1 25.4
>>>> 76 25 2 999
>>>> 76 26 1 999
>>>>
>>>> I would like to have SPSS recognize the first 999 as a sysmis value,
>>>> but
>>>> not
>>>> change any of the other values. Any help with this problem would be
>>>> greatly
>>>> appreciated.
>>>>
>>>>
>>
>>
>> Kevin Bladon, Ph.D., A.Ag.
>> Resource Analyst
>> Silvacom Ltd.
>> 3825 - 93 Street
>> Edmonton, AB
>> T6E 5K5
>> Phone: 780.462.3238
>> Fax: 780.462.4726
>> E-mail: [hidden email]
>> www.silvacom.com
>>
>> "Make every obstacle an opportunity."
>> � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � - Lance
>> Armstrong
>> � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
>> Cancer survivor and 7 time Tour de
>> France champion (1999-2005)
>>
>>
>
>
Art Kendall
Social Research Consultants