How can I code more than one variable?

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

How can I code more than one variable?

Ece Kayrak
 Hello, could you please help me on this problem?
   
Question: Which language would you like to learn as a foreign language?
  • German
  • French
  • Spanish
  • Chinese
  • Other
Some answers have only one choice(such as German) and there is no problem to give them codes(1 for German). However, some answers have two choices (such as both German and French) and when I code them as 1,2 (1for German and 2 for French) the system does not recognize them as variables. What can I do?!
 
    
 
Reply | Threaded
Open this post in threaded view
|

Re: How can I code more than one variable?

mpirritano

Dummy coding.

 

http://www.ats.ucla.edu/stat/mult_pkg/faq/general/dummy.htm

 

Create 5 new variables:

 

lang_german

lang_french

lang_spanish

lang_chinese

lang_other

 

For each variable if it is selected by an individual assign it a 1, and a 0 if not chosen. That way someone could have a 1 for every variable if they speak all 5.

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Ece Kayrak
Sent: Tuesday, June 29, 2010 12:32 PM
To: [hidden email]
Subject: How can I code more than one variable?

 

 Hello, could you please help me on this problem?

   

Question: Which language would you like to learn as a foreign language?

  • German
  • French
  • Spanish
  • Chinese
  • Other

Some answers have only one choice(such as German) and there is no problem to give them codes(1 for German). However, some answers have two choices (such as both German and French) and when I code them as 1,2 (1for German and 2 for French) the system does not recognize them as variables. What can I do?!

 

    

 

Reply | Threaded
Open this post in threaded view
|

Re: How can I code more than one variable?

Hector Maletta

In addition to Matthew’s suggestion:

It might happen that after creating the five variables you find out only (relatively) few combinations are actually observed in your data set. In that case, you may convert the response set into a single variable. One simple manner is to add up the five dummies as digits in a five-digit number. Example:

 

COMPUTE languages= lang_german*10000+lang_french*1000+lang_spanish*100+lang_chinese*10+lang_other.

Value label languages

0 ‘None’

11111 ‘All five’

1 ‘Other language only’

10 ‘Chinese’

11 ‘Chinese and other’

100 ‘Spanish’

101 ‘Spanish and other’

110 ‘Spanish and Chinese’

……………………

(define labels only for observed combinations).

 

Hector

 

De: SPSSX(r) Discussion [mailto:[hidden email]] En nombre de Pirritano, Matthew
Enviado el: Tuesday, June 29, 2010 4:48 PM
Para: [hidden email]
Asunto: Re: How can I code more than one variable?

 

Dummy coding.

 

http://www.ats.ucla.edu/stat/mult_pkg/faq/general/dummy.htm

 

Create 5 new variables:

 

lang_german

lang_french

lang_spanish

lang_chinese

lang_other

 

For each variable if it is selected by an individual assign it a 1, and a 0 if not chosen. That way someone could have a 1 for every variable if they speak all 5.

 

Matthew Pirritano, Ph.D.

Research Analyst IV

Medical Services Initiative (MSI)

Orange County Health Care Agency

(714) 568-5648


From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Ece Kayrak
Sent: Tuesday, June 29, 2010 12:32 PM
To: [hidden email]
Subject: How can I code more than one variable?

 

 Hello, could you please help me on this problem?

   

Question: Which language would you like to learn as a foreign language?

  • German
  • French
  • Spanish
  • Chinese
  • Other

Some answers have only one choice(such as German) and there is no problem to give them codes(1 for German). However, some answers have two choices (such as both German and French) and when I code them as 1,2 (1for German and 2 for French) the system does not recognize them as variables. What can I do?!

 

    

 

Se certificó que el correo entrante no contiene virus.
Comprobada por AVG - www.avg.es
Versión: 8.5.439 / Base de datos de virus: 271.1.1/2970 - Fecha de la versión: 06/29/10 06:35:00

Reply | Threaded
Open this post in threaded view
|

Re: How can I code more than one variable?

John F Hall
In reply to this post by Ece Kayrak
Not quite sure how your data are organised, but check out MULT RESPONSE in the syntax guide and also the Multiple response tutorials on my site
----- Original Message -----
Sent: Tuesday, June 29, 2010 9:32 PM
Subject: How can I code more than one variable?

 Hello, could you please help me on this problem?
   
Question: Which language would you like to learn as a foreign language?
  • German
  • French
  • Spanish
  • Chinese
  • Other
Some answers have only one choice(such as German) and there is no problem to give them codes(1 for German). However, some answers have two choices (such as both German and French) and when I code them as 1,2 (1for German and 2 for French) the system does not recognize them as variables. What can I do?!