# spssforum.com

by SPSS users, for SPSS users
 It is currently Sat May 25, 2013 6:49 pm

 All times are UTC

 Page 1 of 1 [ 5 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: create new variable with a twistPosted: Mon Dec 15, 2008 8:30 pm

Joined: Mon Dec 15, 2008 8:18 pm
Posts: 3
I have sales mix variables from 1 - 5 (Mix1-Mix5). They each represent a % of firm sales in each market channel:
Mix1 = retail
Mix2 = food service
Mix3 = institutional
Mix4 = industrial
Mix5 = other

I want to create a new variable that identifies which channel has the most sales (ex: MixMax = channel that accounts for most sales).

For example, if case #1 had the following:
Mix1 = 40
Mix2 = 10
Mix3 = 25
Mix4 = 25
Mix5 = 0

then MixMax = "Retail"

How do I do this in SPSS 16?
Any ideas on how to deal with ties (ex: Mix1 = 50 and Mix2 = 50 and all others =0)?

Top

 Post subject: Posted: Mon Dec 15, 2008 9:28 pm
 Moderator

Joined: Tue Jun 12, 2007 12:08 pm
Posts: 2074
Location: Florida, USA
Under Compute there is a max function

Check it out and let us know if this is what you are looking for

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

Statman
Statistical Services
IBM/SPSS Beta Site

Top

 Post subject: Posted: Mon Dec 15, 2008 9:41 pm

Joined: Mon Dec 15, 2008 8:18 pm
Posts: 3
The max function simply kicks back the maximum value. I want to note which of the variables has that value. So, for my original example I am trying to note that the largest sales channel for the respondent is the retail channel. Does that help clarify my question?

Top

 Post subject: Posted: Mon Dec 15, 2008 10:20 pm

Joined: Mon Dec 15, 2008 8:18 pm
Posts: 3
Okay, I finally figured out a way to get there. Here is what I did:

1. Created a MixMax variable by computing the max(mix1, mix2, mix3, mix4, mix5).
2. Created new variable MixMaj
3. Filtered data on condition mix1=MixMax
4. Recoded MixMaj - missing variable changed to 1
5. Repeated steps 3&4 for 2 - 5
6. Checked for equal splits by filtering all data on mix# = mix\$

This worked. However, I am curious to know if there is another way to do this work. Any ideas?

Top

 Post subject: Posted: Tue Dec 16, 2008 1:23 am
 Moderator

Joined: Tue Jun 12, 2007 12:08 pm
Posts: 2074
Location: Florida, USA
Well done

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 5 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 1 guest

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ SPSS    General    Data input    Output    SPSS for beginners    Enhancing data    Modifying SPSS output    Coding SPSS syntax SPSS the software    Errors    Where is .. in SPSS Statistics    Statistics for beginners    Heavy statistics SPSS Jobs    SPSS Jobs SPSS Forum    Read this first    General feedback or questions about this forum    Library