Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie question about variables

13 views
Skip to first unread message

Geoff

unread,
Jan 22, 2012, 8:21:00 AM1/22/12
to
Hi,

Am *very* new to SPSS 19 and would like some advice on how to approach a
(to me) simple issue.

I have a survey consisting of 100 questions all of which can be answered
yes/no. I've assigned 1/0 (plus 999 for missing) respectively and would
like to group the answers to questions 7, 41, 55, 56 and 96 - counting
(or adding) the number of "1"s to generate a score.

Any help gratefully accepted!

Geoff

Andy W

unread,
Jan 22, 2012, 9:14:13 AM1/22/12
to
You will have to define what you want to do with missing values before
we can give a solution. If you didn't have any missing data, it would
be as simple as a compute statement. So if V7 is question 7 and V41 is
question 41 etc. it would look like this in syntax.

***********************************************.
compute added_ques = V7 + V41 + V55 + V56 + V96.
execute.
***********************************************.

But that will not work if you have any missing values (as you would
add 999 in the calculation). So in the above example if one of the
responses has a missing value what do you want the resulting summed
variable to equal? Do you want it to be missing, do you want it to add
the available data, or do you want to perform some type of imputation
scheme (i.e. replace the missing data with some other reasonable guess
as to what the missing data will be)?

Andy




Geoff

unread,
Jan 22, 2012, 11:03:14 AM1/22/12
to
Thanks Andy, I think I'll disregard the missing data for now and go with
your "compute" suggestion.

Geoff

David

unread,
Jan 22, 2012, 12:34:33 PM1/22/12
to
Using the COMPUTE with + when you have missing values declared will
yield system missing for any case with any missing values.
Best in this case to use SUM function or COUNT.
COMPUTE yourvar=SUM(V7,V41,V55,V56,V96).
or
COUNT yourvar=V7 V41 V55 V56 V96 (1).

Geoff

unread,
Jan 22, 2012, 4:54:52 PM1/22/12
to
Done - but now I have another question. My data set has a client ID, 100
yes/no variables and 20 calculated variables. If I add a case, the
calculated variables do not update. Is this expected behaviour in SPSS
19 or am I missing something fundamental like needing the complete
dataset before applying the Transforms?

Cheers,

G


Andy W

unread,
Jan 23, 2012, 7:56:18 AM1/23/12
to
This is intended. One of the nice things about syntax is you can save
the file (an .sps file) and then just re-run any commands with the
updated dataset to produce tables, summary statistics, graphs,
whatever you want.

Thanks to David for reminding me about the SUM command, and I had
never even seen the COUNT command before!

Andy

David

unread,
Jan 23, 2012, 8:54:59 AM1/23/12
to
This is not Excel!!
--

Geoff

unread,
Jan 23, 2012, 6:36:42 PM1/23/12
to
I'm thinking that's a good thing :-)

Geoff

unread,
Jan 23, 2012, 6:41:40 PM1/23/12
to
Thanks Andy, I'll do that and re-run it as required. Could you recommend
a book or online resource that would help educate me to the point where
I'm not asking these really basic questions of you guys?

Unfortunately the academic institution at which I'm studying only offers
training to post-grads and I'm not there (yet!).

Thanks again for your help.

Geoff

David

unread,
Jan 23, 2012, 6:53:05 PM1/23/12
to
The Syntax Reference Guide is the gold standard WRT documentation.
You can also pick up a lot of tips and tricks by perusing the on line
archives of this group and the SPSSX-L archives:
http://spssx-discussion.1045642.n5.nabble.com/
http://listserv.uga.edu/cgi-bin/wa?A0=spssx-l
HTH, David

Robert

unread,
Jan 24, 2012, 6:27:27 AM1/24/12
to
> G- Hide quoted text -
>
> - Show quoted text -

As others have said, new cases do not have old transformations
automatically applied.

You can recall previously used commands from the "recall recently used
dialog" icon on the header ribbon for your current session. Older
used commands can be copied from the Journal file, which can be found
from the Edit/Options/File locations menu, and pasted into a syntax
file that is one of the options for the File/New menu.

Robert

Andy W

unread,
Jan 24, 2012, 7:53:41 AM1/24/12
to
Geoff,

I agree with David on both points, although I'll slightly elaborate.
IMO there is no substitute for learning by doing.

The syntax reference guide that comes with the software is very good
for the majority of the commands, and I have a set of printed out
commands that I use on a regular basis that I haven't kept to memory.
The only book I have, and I would recommend it, is Sarah Boslaugh's An
intermediate guide to SPSS programming: using syntax for data
management. Intermediate isn't the right word for the title though, it
is best for beginners whom need to manage data in SPSS syntax.

I also follow both this google group, the developer works forum, and
the nabble group (although I don't participate at the nabble forum).
There good snippets to follow just to see what is possible in the
software, and good references to keep in the back of your mind when
your trying to solve some similar problem. I use a feed reader to
follow them, but the traffic is slight enough at all three that it
isn't a big burden to peruse the listings on a daily basis. I learn
(and re-learn stuff I forget about) all the time from following the
forums.

My only other piece of advice is do everything in syntax. Even if you
use the GUI to accomplish some task, paste the output.

There are plenty of resources around the internet as well. I have
compiled a collection at the stats.stackexchange 'SPSS' tag wiki,
http://stats.stackexchange.com/tags/spss/info , and most of the
websites referenced therein have various resources listed as well.

Best,
Andy
0 new messages