| Date: | Tue, 19 Apr 2011 14:52:01 +0200 |
| Reply-To: | John F Hall <johnfhall@orange.fr> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | John F Hall <johnfhall@orange.fr> |
| Subject: | Re: help: compute a new variable,
by using the responses of two variables |
| In-Reply-To: | <1303212375501-4313025.post@n5.nabble.com> |
| Content-Type: | text/plain; charset="us-ascii" |
He wants the new variable to be called warmmom so he needs:
COMPUTE WARMMOM = H3WP19 .
IF missing(H3WP19) WARMMOM=H3WP31.
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Bruce Weaver
Sent: 19 April 2011 13:26
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: help: compute a new variable, by using the responses of two
variables
If the only missing values are 96, 97 and 99, then using MISSING(), as Jon
suggests, is simpler, I think.
IF missing(H3WP19) H3WP19=H3WP31.
For Hector's method, I would use ANY rather than multiple OR's.
Missing values H3WP19 ().
IF any(H3WP19,96,97,99) H3WP19=H3WP31.
HTH.
Hector Maletta wrote:
>
> Jon,
>
> Of course, but the expression would become more complicated. I wanted to
> keep it as simple as possible.
>
> Hector
>
>
>
> De: Jon K Peck [mailto:peck@us.ibm.com]
> Enviado el: Tuesday, April 19, 2011 00:35
> Para: Hector Maletta
> CC: SPSSX-L@LISTSERV.UGA.EDU
> Asunto: Re: [SPSSX-L] help: compute a new variable, by using the responses
> of two variables
>
>
>
> Wouldn't it be better to leave the missing value definition intact and use
> the MISSING function?
>
> Jon Peck
> Senior Software Engineer, IBM
> peck@us.ibm.com
> 312-651-3435
>
>
>
> From: Hector Maletta <hmaletta@fibertel.com.ar>
> To: SPSSX-L@LISTSERV.UGA.EDU
> Date: 04/18/2011 09:19 PM
> Subject: Re: [SPSSX-L] help: compute a new variable,
> by
> using the responses of two variables
> Sent by: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
>
> _____
>
>
>
>
> Simple syntax:
> Missing values H3WP19 ().
> IF (H3WP19=96 or if H3WP19=97 or if H3WP19=99) H3WP19=H3WP31.
>
> I include the MISSING VALUES command to cancel any user-declared missing
> values, just in case you had declared the values 96, 97 and 99 as missing.
> In that case, The IF command would not work in cases with those values if
> they are missing, because cases with missing values are ignored in IF
> commands as the above.
> After applying the above syntax you can define again your missing values
> for
> H3WP19.
>
> Hector
>
> De: SPSSX(r) Discussion [ <mailto:SPSSX-L@LISTSERV.UGA.EDU>
> mailto:SPSSX-L@LISTSERV.UGA.EDU] En nombre de Buhi, Eric
> Enviado el: Monday, April 18, 2011 23:16
> Para: SPSSX-L@LISTSERV.UGA.EDU
> Asunto: help: compute a new variable, by using the responses of two
> variables
>
> Good evening all.
>
> I am trying to compute a new variable, by using the responses of two
> variables. Specifically, I would like to create WarmMom, such that if
> H3WP19
> is not answered (e.g., 96, 97, 99), then it will substitute, or use the
> value for H3WP31 (below).
>
> Does anyone know what syntax commands I'd use?
>
> H3WP19 Most of the time {residential mom} is warm and loving toward
> you 1=SA, 2=Agree, 3=Neither A or D, 4=Disagree, 5=SD, 96=refused,
> 97=legit skip,99=not appl
>
> H3WP31 Most of the time {mom you used to live with} is warm and
> loving toward you 1=SA, 2=Agree, 3=Neither A or D, 4=Disagree,
> 5=SD,
> 97=legit skip,98=dk, 99=not appl
>
> Thanks for your help!
>
> -Eric
>
>
>
> _____
>
>
> No virus found in this message.
> Checked by AVG - www.avg.com <http://www.avg.com/>
> Version: 10.0.1321 / Virus Database: 1500/3582 - Release Date: 04/18/11
>
> _____
>
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1321 / Virus Database: 1500/3582 - Release Date: 04/18/11
>
-----
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."
NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.
--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/help-compute-a-new-variable-by
-using-the-responses-of-two-variables-tp4312268p4313025.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (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
LISTSERV@LISTSERV.UGA.EDU (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
|