Combining "Variables" into one "Variable"

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Combining "Variables" into one "Variable"

mooreadamsbl
I hope someone can help me with this dataset, as I have read so many posts and forums and nothing seems to apply. I am working with a data set that asked a question of faculty: What was their primary academic field? and allowed them 40+ choices and a check "all that apply" option. The data set that was sent to me to work with, from this survey, lists the responses to each department as if they were a separate variable...

For example, in my variable view it shows (Just to give you a snippet of the beginning):

Name                  Label        
Q_23_A         What is your primary academic field? Mark all that apply - African Studies
Q_23_B         What is your primary academic field? Mark all that apply - African-American Studies

And so on. I know I will need to make these a binary variable once I group them, but what I am trying to do is take these individual academic fields, group them into 10 academic groupings/departments. So I would take, for example, French, Spanish, Italian, Chinese, etc. and place them all into the "World Language" new variable. But since they have each response set up like a variable itself I am at a total loss. Any suggestions?
Reply | Threaded
Open this post in threaded view
|

Re: Combining "Variables" into one "Variable"

John F Hall

You need to use the SPSS command MULT RESPONSE.  To find out about it from the GUI

 

Help > Command Syntax Reference  then scroll down to MULT RESPONSE (pp 1159 ff)

 

Open a new syntax file with File > New > Syntax

 

If your variables are all coded 0,1, use dichotomous mode: write in the following (don’t forget the full stop):

 

MULT RESPONSE groups = field 'Academic field'

               (q_23_a to q_23_j (1))

               /freq field.

 

Table will use variable labels.

 

If they are coded 1 to 10, use it in integer mode:

 

MULT RESPONSE groups = field 'Academic field'

               (q_23_a to q_23_j (1,10))

               /freq field.

 

Table will use value labels.

 

Check out also MRSETS (pp 1155 ff) with:

 

Data >> Define Multiple Response Sets

 

If this is new to you, there are several tutorials on this topic on my page:

http://surveyresearch.weebly.com/33-multiple-response-mult-response.html . . and a similar exercise to yours is detailed in slide-show 3 (slides 25 - 44) from page:

http://surveyresearch.weebly.com/old-dog-old-tricks-using-spss-syntax-to-beat-the-mouse-trap.html

 

Hope this helps.

 

John F Hall (Mr)

[Retired academic survey researcher]

 

Email:   [hidden email] 

Website: www.surveyresearch.weebly.com

SPSS start page:  www.surveyresearch.weebly.com/1-survey-analysis-workshop

 

 

 

 

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of mooreadamsbl
Sent: 03 April 2016 04:56
To: [hidden email]
Subject: Combining "Variables" into one "Variable"

 

I hope someone can help me with this dataset, as I have read so many posts and forums and nothing seems to apply. I am working with a data set that asked a question of faculty: What was their primary academic field? and allowed them 40+ choices and a check "all that apply" option. The data set that was sent to me to work with, from this survey, lists the responses to each department as if they were a separate variable...

 

For example, in my variable view it shows (Just to give you a snippet of the

beginning):

 

Name                  Label       

Q_23_A         What is your primary academic field? Mark all that apply -

African Studies

Q_23_B         What is your primary academic field? Mark all that apply -

African-American Studies

 

And so on. I know I will need to make these a binary variable once I group them, but what I am trying to do is take these individual academic fields, group them into 10 academic groupings/departments. So I would take, for example, French, Spanish, Italian, Chinese, etc. and place them all into the "World Language" new variable. But since they have each response set up like a variable itself I am at a total loss. Any suggestions?

 

 

 

--

View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Combining-Variables-into-one-Variable-tp5731851.html

Sent from the SPSSX Discussion mailing list archive at Nabble.com.

 

=====================

To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Combining "Variables" into one "Variable"

Jon Peck
In reply to this post by mooreadamsbl
The CTABLES (Custom Tables>Custom Tables) and GGRAPH (Chart Builder) procedures can analyze mult response data using sets defined by MRSETS (Analyze > Custom Tables > Multiple Response Sets).  The old MULT RESPONSE procedure can also do some mult response set analysis, but the other procedures are superior.

However, if you just need to combine values for certain variables, that can be done with a COMPUTE transformation such as
compute academic = Q23_A or Q23_B or ...
This assumes that these variables are coded 0/1.  If they are coded some other way, the transformation would be different, but you would need to spell out the coding to answer this.

On Sat, Apr 2, 2016 at 8:56 PM, mooreadamsbl <[hidden email]> wrote:
I hope someone can help me with this dataset, as I have read so many posts
and forums and nothing seems to apply. I am working with a data set that
asked a question of faculty: What was their primary academic field? and
allowed them 40+ choices and a check "all that apply" option. The data set
that was sent to me to work with, from this survey, lists the responses to
each department as if they were a separate variable...

For example, in my variable view it shows (Just to give you a snippet of the
beginning):

Name                  Label
Q_23_A         What is your primary academic field? Mark all that apply -
African Studies
Q_23_B         What is your primary academic field? Mark all that apply -
African-American Studies

And so on. I know I will need to make these a binary variable once I group
them, but what I am trying to do is take these individual academic fields,
group them into 10 academic groupings/departments. So I would take, for
example, French, Spanish, Italian, Chinese, etc. and place them all into the
"World Language" new variable. But since they have each response set up like
a variable itself I am at a total loss. Any suggestions?



--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Combining-Variables-into-one-Variable-tp5731851.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD



--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Combining "Variables" into one "Variable"

Bruce Weaver
Administrator
Regarding Jon's second paragraph below, if you used the ANY function, it wouldn't matter if you have variables coded 1=Yes, 0=No or some other coding, so long as the code for Yes is the same across all variables.  E.g, if 1=Yes, you could do this:

COMPUTE WorldLang = ANY(1, French, Spanish, Italian, Chinese[,etc]).
FORMATS WorldLang (F1).
VALUE LABELS WorldLang 1 'Yes' 0 'No'.
FREQUENCIES WorldLang.

If you need to know how many languages are endorsed, look up COUNT.  

HTH.


Jon Peck wrote
The CTABLES (Custom Tables>Custom Tables) and GGRAPH (Chart Builder)
procedures can analyze mult response data using sets defined by MRSETS
(Analyze > Custom Tables > Multiple Response Sets).  The old MULT RESPONSE
procedure can also do some mult response set analysis, but the other
procedures are superior.

However, if you just need to combine values for certain variables, that can
be done with a COMPUTE transformation such as
compute academic = Q23_A or Q23_B or ...
This assumes that these variables are coded 0/1.  If they are coded some
other way, the transformation would be different, but you would need to
spell out the coding to answer this.

On Sat, Apr 2, 2016 at 8:56 PM, mooreadamsbl <[hidden email]> wrote:

> I hope someone can help me with this dataset, as I have read so many posts
> and forums and nothing seems to apply. I am working with a data set that
> asked a question of faculty: What was their primary academic field? and
> allowed them 40+ choices and a check "all that apply" option. The data set
> that was sent to me to work with, from this survey, lists the responses to
> each department as if they were a separate variable...
>
> For example, in my variable view it shows (Just to give you a snippet of
> the
> beginning):
>
> Name                  Label
> Q_23_A         What is your primary academic field? Mark all that apply -
> African Studies
> Q_23_B         What is your primary academic field? Mark all that apply -
> African-American Studies
>
> And so on. I know I will need to make these a binary variable once I group
> them, but what I am trying to do is take these individual academic fields,
> group them into 10 academic groupings/departments. So I would take, for
> example, French, Spanish, Italian, Chinese, etc. and place them all into
> the
> "World Language" new variable. But since they have each response set up
> like
> a variable itself I am at a total loss. Any suggestions?
>
>
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/Combining-Variables-into-one-Variable-tp5731851.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>



--
Jon K Peck
[hidden email]

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Combining "Variables" into one "Variable"

Jon Peck
As Bruce says, the any function allows for finding 1 values regardless of other coding, but if there can be missing values that should result in the result, WorldLang, also being missing, any won't produce that.

On Sun, Apr 3, 2016 at 9:26 AM, Bruce Weaver <[hidden email]> wrote:
Regarding Jon's second paragraph below, if you used the ANY function, it
wouldn't matter if you have variables coded 1=Yes, 0=No or some other
coding, so long as the code for Yes is the same across all variables.  E.g,
if 1=Yes, you could do this:

COMPUTE WorldLang = ANY(1, French, Spanish, Italian, Chinese[,etc]).
FORMATS WorldLang (F1).
VALUE LABELS WorldLang 1 'Yes' 0 'No'.
FREQUENCIES WorldLang.

If you need to know how many languages are endorsed, look up COUNT.

HTH.



Jon Peck wrote
> The CTABLES (Custom Tables>Custom Tables) and GGRAPH (Chart Builder)
> procedures can analyze mult response data using sets defined by MRSETS
> (Analyze > Custom Tables > Multiple Response Sets).  The old MULT RESPONSE
> procedure can also do some mult response set analysis, but the other
> procedures are superior.
>
> However, if you just need to combine values for certain variables, that
> can
> be done with a COMPUTE transformation such as
> compute academic = Q23_A or Q23_B or ...
> This assumes that these variables are coded 0/1.  If they are coded some
> other way, the transformation would be different, but you would need to
> spell out the coding to answer this.
>
> On Sat, Apr 2, 2016 at 8:56 PM, mooreadamsbl <

> mooreadamsbl@

> > wrote:
>
>> I hope someone can help me with this dataset, as I have read so many
>> posts
>> and forums and nothing seems to apply. I am working with a data set that
>> asked a question of faculty: What was their primary academic field? and
>> allowed them 40+ choices and a check "all that apply" option. The data
>> set
>> that was sent to me to work with, from this survey, lists the responses
>> to
>> each department as if they were a separate variable...
>>
>> For example, in my variable view it shows (Just to give you a snippet of
>> the
>> beginning):
>>
>> Name                  Label
>> Q_23_A         What is your primary academic field? Mark all that apply -
>> African Studies
>> Q_23_B         What is your primary academic field? Mark all that apply -
>> African-American Studies
>>
>> And so on. I know I will need to make these a binary variable once I
>> group
>> them, but what I am trying to do is take these individual academic
>> fields,
>> group them into 10 academic groupings/departments. So I would take, for
>> example, French, Spanish, Italian, Chinese, etc. and place them all into
>> the
>> "World Language" new variable. But since they have each response set up
>> like
>> a variable itself I am at a total loss. Any suggestions?
>>
>>
>>
>> --
>> View this message in context:
>> http://spssx-discussion.1045642.n5.nabble.com/Combining-Variables-into-one-Variable-tp5731851.html
>> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>>
>> =====================
>> To manage your subscription to SPSSX-L, send a message to
>>

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
>> command. To leave the list, send the command
>> SIGNOFF SPSSX-L
>> For a list of commands to manage subscriptions, send the command
>> INFO REFCARD
>>
>
>
>
> --
> Jon K Peck

> jkpeck@

>
> =====================
> To manage your subscription to SPSSX-L, send a message to

> LISTSERV@.UGA

>  (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"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/Combining-Variables-into-one-Variable-tp5731851p5731856.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD



--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Combining "Variables" into one "Variable"

Bruce Weaver
Administrator
Good point, Jon.  I was just trying to get rid of all those ORs.  How's this?

* This assumes 1=Yes coding.
COUNT # = French Spanish Italian Chinese [etc.] (1).
COMPUTE WorldLang = # GT 0.
FORMATS WorldLang (F1).


Jon Peck wrote
As Bruce says, the any function allows for finding 1 values regardless of
other coding, but if there can be missing values that should result in the
result, WorldLang, also being missing, any won't produce that.

On Sun, Apr 3, 2016 at 9:26 AM, Bruce Weaver <[hidden email]>
wrote:

> Regarding Jon's second paragraph below, if you used the ANY function, it
> wouldn't matter if you have variables coded 1=Yes, 0=No or some other
> coding, so long as the code for Yes is the same across all variables.  E.g,
> if 1=Yes, you could do this:
>
> COMPUTE WorldLang = ANY(1, French, Spanish, Italian, Chinese[,etc]).
> FORMATS WorldLang (F1).
> VALUE LABELS WorldLang 1 'Yes' 0 'No'.
> FREQUENCIES WorldLang.
>
> If you need to know how many languages are endorsed, look up COUNT.
>
> HTH.
>
>
>
> Jon Peck wrote
> > The CTABLES (Custom Tables>Custom Tables) and GGRAPH (Chart Builder)
> > procedures can analyze mult response data using sets defined by MRSETS
> > (Analyze > Custom Tables > Multiple Response Sets).  The old MULT
> RESPONSE
> > procedure can also do some mult response set analysis, but the other
> > procedures are superior.
> >
> > However, if you just need to combine values for certain variables, that
> > can
> > be done with a COMPUTE transformation such as
> > compute academic = Q23_A or Q23_B or ...
> > This assumes that these variables are coded 0/1.  If they are coded some
> > other way, the transformation would be different, but you would need to
> > spell out the coding to answer this.
> >
> > On Sat, Apr 2, 2016 at 8:56 PM, mooreadamsbl <
>
> > mooreadamsbl@
>
> > > wrote:
> >
> >> I hope someone can help me with this dataset, as I have read so many
> >> posts
> >> and forums and nothing seems to apply. I am working with a data set that
> >> asked a question of faculty: What was their primary academic field? and
> >> allowed them 40+ choices and a check "all that apply" option. The data
> >> set
> >> that was sent to me to work with, from this survey, lists the responses
> >> to
> >> each department as if they were a separate variable...
> >>
> >> For example, in my variable view it shows (Just to give you a snippet of
> >> the
> >> beginning):
> >>
> >> Name                  Label
> >> Q_23_A         What is your primary academic field? Mark all that apply
> -
> >> African Studies
> >> Q_23_B         What is your primary academic field? Mark all that apply
> -
> >> African-American Studies
> >>
> >> And so on. I know I will need to make these a binary variable once I
> >> group
> >> them, but what I am trying to do is take these individual academic
> >> fields,
> >> group them into 10 academic groupings/departments. So I would take, for
> >> example, French, Spanish, Italian, Chinese, etc. and place them all into
> >> the
> >> "World Language" new variable. But since they have each response set up
> >> like
> >> a variable itself I am at a total loss. Any suggestions?
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://spssx-discussion.1045642.n5.nabble.com/Combining-Variables-into-one-Variable-tp5731851.html
> >> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
> >>
> >> =====================
> >> To manage your subscription to SPSSX-L, send a message to
> >>
>
> > LISTSERV@.UGA
>
> >  (not to SPSSX-L), with no body text except the
> >> command. To leave the list, send the command
> >> SIGNOFF SPSSX-L
> >> For a list of commands to manage subscriptions, send the command
> >> INFO REFCARD
> >>
> >
> >
> >
> > --
> > Jon K Peck
>
> > jkpeck@
>
> >
> > =====================
> > To manage your subscription to SPSSX-L, send a message to
>
> > LISTSERV@.UGA
>
> >  (not to SPSSX-L), with no body text except the
> > command. To leave the list, send the command
> > SIGNOFF SPSSX-L
> > For a list of commands to manage subscriptions, send the command
> > INFO REFCARD
>
>
>
>
>
> -----
> --
> Bruce Weaver
> [hidden email]
> http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "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/Combining-Variables-into-one-Variable-tp5731851p5731856.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>



--
Jon K Peck
[hidden email]

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Combining "Variables" into one "Variable"

David Marso
Administrator


In a similar vein also look at SUM function.

Bruce Weaver wrote
Good point, Jon.  I was just trying to get rid of all those ORs.  How's this?

* This assumes 1=Yes coding.
COUNT # = French Spanish Italian Chinese [etc.] (1).
COMPUTE WorldLang = # GT 0.
FORMATS WorldLang (F1).


Jon Peck wrote
As Bruce says, the any function allows for finding 1 values regardless of
other coding, but if there can be missing values that should result in the
result, WorldLang, also being missing, any won't produce that.

On Sun, Apr 3, 2016 at 9:26 AM, Bruce Weaver <[hidden email]>
wrote:

> Regarding Jon's second paragraph below, if you used the ANY function, it
> wouldn't matter if you have variables coded 1=Yes, 0=No or some other
> coding, so long as the code for Yes is the same across all variables.  E.g,
> if 1=Yes, you could do this:
>
> COMPUTE WorldLang = ANY(1, French, Spanish, Italian, Chinese[,etc]).
> FORMATS WorldLang (F1).
> VALUE LABELS WorldLang 1 'Yes' 0 'No'.
> FREQUENCIES WorldLang.
>
> If you need to know how many languages are endorsed, look up COUNT.
>
> HTH.
>
>
>
> Jon Peck wrote
> > The CTABLES (Custom Tables>Custom Tables) and GGRAPH (Chart Builder)
> > procedures can analyze mult response data using sets defined by MRSETS
> > (Analyze > Custom Tables > Multiple Response Sets).  The old MULT
> RESPONSE
> > procedure can also do some mult response set analysis, but the other
> > procedures are superior.
> >
> > However, if you just need to combine values for certain variables, that
> > can
> > be done with a COMPUTE transformation such as
> > compute academic = Q23_A or Q23_B or ...
> > This assumes that these variables are coded 0/1.  If they are coded some
> > other way, the transformation would be different, but you would need to
> > spell out the coding to answer this.
> >
> > On Sat, Apr 2, 2016 at 8:56 PM, mooreadamsbl <
>
> > mooreadamsbl@
>
> > > wrote:
> >
> >> I hope someone can help me with this dataset, as I have read so many
> >> posts
> >> and forums and nothing seems to apply. I am working with a data set that
> >> asked a question of faculty: What was their primary academic field? and
> >> allowed them 40+ choices and a check "all that apply" option. The data
> >> set
> >> that was sent to me to work with, from this survey, lists the responses
> >> to
> >> each department as if they were a separate variable...
> >>
> >> For example, in my variable view it shows (Just to give you a snippet of
> >> the
> >> beginning):
> >>
> >> Name                  Label
> >> Q_23_A         What is your primary academic field? Mark all that apply
> -
> >> African Studies
> >> Q_23_B         What is your primary academic field? Mark all that apply
> -
> >> African-American Studies
> >>
> >> And so on. I know I will need to make these a binary variable once I
> >> group
> >> them, but what I am trying to do is take these individual academic
> >> fields,
> >> group them into 10 academic groupings/departments. So I would take, for
> >> example, French, Spanish, Italian, Chinese, etc. and place them all into
> >> the
> >> "World Language" new variable. But since they have each response set up
> >> like
> >> a variable itself I am at a total loss. Any suggestions?
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://spssx-discussion.1045642.n5.nabble.com/Combining-Variables-into-one-Variable-tp5731851.html
> >> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
> >>
> >> =====================
> >> To manage your subscription to SPSSX-L, send a message to
> >>
>
> > LISTSERV@.UGA
>
> >  (not to SPSSX-L), with no body text except the
> >> command. To leave the list, send the command
> >> SIGNOFF SPSSX-L
> >> For a list of commands to manage subscriptions, send the command
> >> INFO REFCARD
> >>
> >
> >
> >
> > --
> > Jon K Peck
>
> > jkpeck@
>
> >
> > =====================
> > To manage your subscription to SPSSX-L, send a message to
>
> > LISTSERV@.UGA
>
> >  (not to SPSSX-L), with no body text except the
> > command. To leave the list, send the command
> > SIGNOFF SPSSX-L
> > For a list of commands to manage subscriptions, send the command
> > INFO REFCARD
>
>
>
>
>
> -----
> --
> Bruce Weaver
> [hidden email]
> http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "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/Combining-Variables-into-one-Variable-tp5731851p5731856.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>



--
Jon K Peck
[hidden email]

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Combining "Variables" into one "Variable"

Bruce Weaver
Administrator
I considered using SUM, but went with COUNT because it works regardless of how NO is coded.  SUM would require (or at least work best with) NO=0 coding.  


David Marso wrote
In a similar vein also look at SUM function.

Bruce Weaver wrote
Good point, Jon.  I was just trying to get rid of all those ORs.  How's this?

* This assumes 1=Yes coding.
COUNT # = French Spanish Italian Chinese [etc.] (1).
COMPUTE WorldLang = # GT 0.
FORMATS WorldLang (F1).


Jon Peck wrote
As Bruce says, the any function allows for finding 1 values regardless of
other coding, but if there can be missing values that should result in the
result, WorldLang, also being missing, any won't produce that.

On Sun, Apr 3, 2016 at 9:26 AM, Bruce Weaver <[hidden email]>
wrote:

> Regarding Jon's second paragraph below, if you used the ANY function, it
> wouldn't matter if you have variables coded 1=Yes, 0=No or some other
> coding, so long as the code for Yes is the same across all variables.  E.g,
> if 1=Yes, you could do this:
>
> COMPUTE WorldLang = ANY(1, French, Spanish, Italian, Chinese[,etc]).
> FORMATS WorldLang (F1).
> VALUE LABELS WorldLang 1 'Yes' 0 'No'.
> FREQUENCIES WorldLang.
>
> If you need to know how many languages are endorsed, look up COUNT.
>
> HTH.
>
>
>
> Jon Peck wrote
> > The CTABLES (Custom Tables>Custom Tables) and GGRAPH (Chart Builder)
> > procedures can analyze mult response data using sets defined by MRSETS
> > (Analyze > Custom Tables > Multiple Response Sets).  The old MULT
> RESPONSE
> > procedure can also do some mult response set analysis, but the other
> > procedures are superior.
> >
> > However, if you just need to combine values for certain variables, that
> > can
> > be done with a COMPUTE transformation such as
> > compute academic = Q23_A or Q23_B or ...
> > This assumes that these variables are coded 0/1.  If they are coded some
> > other way, the transformation would be different, but you would need to
> > spell out the coding to answer this.
> >
> > On Sat, Apr 2, 2016 at 8:56 PM, mooreadamsbl <
>
> > mooreadamsbl@
>
> > > wrote:
> >
> >> I hope someone can help me with this dataset, as I have read so many
> >> posts
> >> and forums and nothing seems to apply. I am working with a data set that
> >> asked a question of faculty: What was their primary academic field? and
> >> allowed them 40+ choices and a check "all that apply" option. The data
> >> set
> >> that was sent to me to work with, from this survey, lists the responses
> >> to
> >> each department as if they were a separate variable...
> >>
> >> For example, in my variable view it shows (Just to give you a snippet of
> >> the
> >> beginning):
> >>
> >> Name                  Label
> >> Q_23_A         What is your primary academic field? Mark all that apply
> -
> >> African Studies
> >> Q_23_B         What is your primary academic field? Mark all that apply
> -
> >> African-American Studies
> >>
> >> And so on. I know I will need to make these a binary variable once I
> >> group
> >> them, but what I am trying to do is take these individual academic
> >> fields,
> >> group them into 10 academic groupings/departments. So I would take, for
> >> example, French, Spanish, Italian, Chinese, etc. and place them all into
> >> the
> >> "World Language" new variable. But since they have each response set up
> >> like
> >> a variable itself I am at a total loss. Any suggestions?
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://spssx-discussion.1045642.n5.nabble.com/Combining-Variables-into-one-Variable-tp5731851.html
> >> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
> >>
> >> =====================
> >> To manage your subscription to SPSSX-L, send a message to
> >>
>
> > LISTSERV@.UGA
>
> >  (not to SPSSX-L), with no body text except the
> >> command. To leave the list, send the command
> >> SIGNOFF SPSSX-L
> >> For a list of commands to manage subscriptions, send the command
> >> INFO REFCARD
> >>
> >
> >
> >
> > --
> > Jon K Peck
>
> > jkpeck@
>
> >
> > =====================
> > To manage your subscription to SPSSX-L, send a message to
>
> > LISTSERV@.UGA
>
> >  (not to SPSSX-L), with no body text except the
> > command. To leave the list, send the command
> > SIGNOFF SPSSX-L
> > For a list of commands to manage subscriptions, send the command
> > INFO REFCARD
>
>
>
>
>
> -----
> --
> Bruce Weaver
> [hidden email]
> http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "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/Combining-Variables-into-one-Variable-tp5731851p5731856.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>



--
Jon K Peck
[hidden email]

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).