Date: Mon, 21 Feb 2011 10:08:29 -0800
Reply-To: Bruce Weaver <email@example.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Bruce Weaver <firstname.lastname@example.org>
Subject: Re: Selecting the rightmost variable of several columns
Content-Type: text/plain; charset=us-ascii
> Dear list,
> Does anyone know how I can select value from the "rightmost" of a set of
> For example, each column might represent the same variable measured in
> different years. I want to select the most recent information, because the
> value might be missing for the current year.
> Many thanks,
If I follow, you want to do something like this.
* Read in some sample data.
data list / v1 to v3 1-3 .
* Pick out right-most valid value.
numeric rigthmost (f2.0).
do repeat v = v1 to v3.
- if not missing(v) rightmost = v.
"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/Selecting-the-rightmost-variable-of-several-columns-tp3394411p3394510.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
For a list of commands to manage subscriptions, send the command