Deleting negatives

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

Deleting negatives

Humphrey Paulie
Dear all,
I have a variable that has both negative and positive values. I want to compute the mean of the absolute values, i.e., without considering the negative signs. I want to treat all negative values as positive and compute a mean. How can I do this in SPSS?
Thanks a lotHumphrey

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Deleting negatives

ariel barak
Hi Humphrey,

Here is tested code that works...happy to help.

-Ariel

DATA LIST LIST /Score (F8).
BEGIN DATA
-78
80
-55
65
END DATA.

DATASET NAME Original.

COMPUTE AbsoluteScore=ABS(Score).

DESCRIPTIVES VARIABLES=AbsoluteScore
  /STATISTICS=MEAN STDDEV MIN MAX.

On Thu, Jan 1, 2009 at 12:01 PM, Humphrey Paulie
<[hidden email]>wrote:

> Dear all,
> I have a variable that has both negative and positive values. I want to
> compute the mean of the absolute values, i.e., without considering the
> negative signs. I want to treat all negative values as positive and compute
> a mean. How can I do this in SPSS?
> Thanks a lotHumphrey
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Deleting negatives

Bahir Aldulaymi
In reply to this post by Humphrey Paulie
Hi Humphrey

Another way to do it is by using Transform-- Compute-- then go to
function group and choose Arithmic --ABS ( Absolute value),  double
click it and put the varaible you want to transform in (?)  in front
of it. Remember to name the new variable.

Yours

Bahir

Den 01/01/2009 kl. 19.01 skrev Humphrey Paulie:

> Dear all,
> I have a variable that has both negative and positive values. I want
> to compute the mean of the absolute values, i.e., without
> considering the negative signs. I want to treat all negative values
> as positive and compute a mean. How can I do this in SPSS?
> Thanks a lotHumphrey
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except
> the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD

__________________________________________________
Bruger du Yahoo!?
Er du træt af spam?  Yahoo!Mail har den bedste spambeskyttelse, der findes
http://dk.mail.yahoo.com

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Deleting negatives

Art Kendall
In reply to this post by Humphrey Paulie
compute newvar= abs(oldvar).
descriptives variables = newvar.

Art Kendall
Social Research Consultants

Humphrey Paulie wrote:

> Dear all,
> I have a variable that has both negative and positive values. I want to compute the mean of the absolute values, i.e., without considering the negative signs. I want to treat all negative values as positive and compute a mean. How can I do this in SPSS?
> Thanks a lotHumphrey
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>
>
>

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Deleting negatives

Richard Ristow
In reply to this post by Humphrey Paulie
At 01:01 PM 1/1/2009, Humphrey Paulie wrote:

>I have a variable that has both negative and positive values. I want
>to compute the mean of the absolute values, i.e., without
>considering the negative signs.

Several correct solutions have been posted; this is Art Kendall's,
the most compact:

compute newvar= abs(oldvar).
descriptives variables = newvar.

One addendum:

If you use the TEMPORARY statement before the COMPUTE, "newvar" won't
be saved as part of the file. Whether you want it to be or not
depends on your purposes, of course.

-Best of luck,
  Richard Ristow

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD