combine continuous variables

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

JolienK
Posts: 9
Joined: Tue Jul 14, 2015 5:34 pm

combine continuous variables

Postby JolienK » Wed Jul 29, 2015 5:06 pm

Hey!

A little while ago I asked a question about combining some categorical variables. I managed to do that with a do if compute syntax. But now I want to do the same thing with continuous variables. So I have 11 types of income distributions, but I like to make it 1 variable. So I tried this:
COMPUTE inkomen_som = (inkomen1 + inkomen2 + inkomen3 + inkomen4 + inkomen5 + inkomen6 + inkomen7 + inkomen8 + inkomen9 + inkomen10 + inkomen11)

But then I got this result: 801813
Only this number instead of a distribution. What am I doing wrong?

Thanks a lot!
GerineL
Moderator
Posts: 1477
Joined: Tue Jun 10, 2008 4:50 pm

Re: combine continuous variables

Postby GerineL » Thu Jul 30, 2015 9:46 am

What do you mean by "distribution"?
What you did in your syntax is create a variable that is the sum of all other income variables.

Also, it is not finished, maybe that is the problem?

Your syntax should read:

Code: Select all

COMPUTE inkomen_som = (inkomen1 + inkomen2 + inkomen3 + inkomen4 + inkomen5 + inkomen6 + inkomen7 + inkomen8 + inkomen9 + inkomen10 + inkomen11) .
execute
If this does not get you the result you want, please provide an example of what you do want to achieve.

Who is online

Users browsing this forum: No registered users and 1 guest

cron