Need help with basic syntax calculation

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Posts: 1
Joined: Sun Aug 14, 2011 9:52 am

Need help with basic syntax calculation

Postby mg2104 » Sun Aug 14, 2011 9:57 am

I have three derived variables with response values from 1 to 6. All I want to do is simply add the three variables:

‘Compute newvar1=var1+var2+var3.’

However, I presume this phrase assumes that to be considered in newvar1 the case has to be present in var1,2+3. Some cases are not present in all so how do I write syntax which accounts for this so if for example the value of var1 was 0 but the values of var2 and var3 were 6 and 6 then newvar1 would still equal 12 for that individual case?

Posts: 2699
Joined: Tue Jun 12, 2007 12:08 pm
Location: Florida, USA

Re: Need help with basic syntax calculation

Postby statman » Mon Aug 15, 2011 1:56 pm

Yes, might have to replace missing with a zero but take a look at the Compute Help for more information
See the note below

NOTE: Please read the Posting Guidelines and always tell us your OS, the SPSS version and information about your study and data!

Statistical Services

Who is online

Users browsing this forum: No registered users and 2 guests