Generate combined codebook

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

Generate combined codebook

Javier Figueroa
Hello SPSS Experts

Before worrying about the doubt that arises, I would like to wish many exams in their activities and thank them for taking a few moments to try to solve the problems that present me in the use of this excellent statistical program.

I have a database 233,353 records, there are multiple questions and answers sinples, my problem is with the multiple answer I would like to combine the answers and then generate a variable with that result. Former.

Structure of the database

id = no. of the questionnaire identifier
p21 = Buy a tour package? Si = 1, No = 2.
p21a = How much does the tour package cost? Values
p21b1 = Does the package include international shipping? Yes = 1, No = p21b2 = Does the package include national transport? Si = 1, No = 2.
p21b3 = Does the package include accommodation? Si = 1, No = 2.
p21b4 = Does the package include food? Si = 1, No = 2.
p21b5 = Does the Tour package include Tours? Si = 1, No = 2.

I would like to have as a result to have all possible combinations as well as
VARIABLE LEBELS result 'Services that includes tourist package'.
VALUE LEBEL result
1 'All (international transport, national transport, lodging, food, excursions)'
2 International transport, national transport
3 International Transport, Accommodation

Database example

DATA LIST /id 1 p21 5-5 p21a 6-14 p21b1 15-15 p21b2 16-16 p21b3 17-17 p21b4 18-18 p21b5 19-19.
BEGIN DATA
1   1  245000 11111
2   1   35000 12112
3   1   30000 11122
4   1   25000 11111
5   2  
6   1   18000 22111
7   2  
8   2 
9   1   35000 21112
END DATA.

VARIABLE LABELS id 'Id Cuestionario'.
VARIABLE LABELS p21 '¿Adquirio paquete turistico?'.
VALUE LABELS p21
1   Si
2   No.
VARIABLE LABELS p21a '¿Cuanto le costo el paquete turistico?'.
VARIABLE LABELS p21b1 '¿El paquete turistico incluye transporte internacional?'.
VALUE LABELS p21b1 to p21b5
1   Si
2   No.
VARIABLE LABELS p21b2 '¿El paquete turistico incluye transporte nacional?'.
VARIABLE LABELS p21b3 '¿El paquete turistico incluye Alojamiento?'.
VARIABLE LABELS p21b4 '¿El paquete turistico incluye Alimentación?'.
VARIABLE LABELS p21b5 '¿El paquete turistico incluye Tours?'.


.....

I thank you in advance for your attention and again wish you many successes in your activities.
Sincerely,

--
Javier Figueroa
Procesamiento y Análisis de bases de datos
Cel: 5927-4748 / 4970-1940
Casa: 2289-0184

===================== 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: Generate combined codebook

Ives, Melissa L

Javier,

 

I didn’t see a reply to your question, so I thought I’d share my thoughts.

 

It sounds like you are looking for a single variable with ‘all possible response combinations’ for each of the 5 questions (international shipping to tours).

There will be 25 or 32 possible combinations (including ‘None of the above’).

 

One way this kind of thing is done is to multiply each response by (10 * the item count (1-5)) then add them up.

 

e.g. (in reverse order)

resultsum=(Tours *10)+(Food*100)+(Accomodations*1000)(NatTrans*10000)(IntShip*100000).

 

I would recode the variables so No=0 and Si=1, but that isn’t vital.

If you do recode your results look like (if not you would see 11111 to 22222):

00000 – none

00001 – tours only

00010 – food only

00100 – accommodations only

01000 – national transportation only

10000 – international shipping only

…(the other 22).

11011 – all but accommodations

11101 – all but food

11110 – all but tours

11111 – everything

 

Hope this helps.

Melissa

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Javier Figueroa
Sent: Friday, October 06, 2017 6:01 PM
To: [hidden email]
Subject: [SPSSX-L] Generate combined codebook

 

Hello SPSS Experts

 

Before worrying about the doubt that arises, I would like to wish many exams in their activities and thank them for taking a few moments to try to solve the problems that present me in the use of this excellent statistical program.

 

I have a database 233,353 records, there are multiple questions and answers sinples, my problem is with the multiple answer I would like to combine the answers and then generate a variable with that result. Former.

 

Structure of the database

 

id = no. of the questionnaire identifier

p21 = Buy a tour package? Si = 1, No = 2.

p21a = How much does the tour package cost? Values

p21b1 = Does the package include international shipping? Yes = 1, No = p21b2 = Does the package include national transport? Si = 1, No = 2.

p21b3 = Does the package include accommodation? Si = 1, No = 2.

p21b4 = Does the package include food? Si = 1, No = 2.

p21b5 = Does the Tour package include Tours? Si = 1, No = 2.

 

I would like to have as a result to have all possible combinations as well as

VARIABLE LEBELS result 'Services that includes tourist package'.

VALUE LEBEL result

1 'All (international transport, national transport, lodging, food, excursions)'

2 International transport, national transport

3 International Transport, Accommodation

 

Database example

 

DATA LIST /id 1 p21 5-5 p21a 6-14 p21b1 15-15 p21b2 16-16 p21b3 17-17 p21b4 18-18 p21b5 19-19.

BEGIN DATA

1   1  245000 11111

2   1   35000 12112

3   1   30000 11122

4   1   25000 11111

5   2  

6   1   18000 22111

7   2  

8   2 

9   1   35000 21112

END DATA.

 

VARIABLE LABELS id 'Id Cuestionario'.

VARIABLE LABELS p21 '¿Adquirio paquete turistico?'.

VALUE LABELS p21

1   Si

2   No.

VARIABLE LABELS p21a '¿Cuanto le costo el paquete turistico?'.

VARIABLE LABELS p21b1 '¿El paquete turistico incluye transporte internacional?'.

VALUE LABELS p21b1 to p21b5

1   Si

2   No.

VARIABLE LABELS p21b2 '¿El paquete turistico incluye transporte nacional?'.

VARIABLE LABELS p21b3 '¿El paquete turistico incluye Alojamiento?'.

VARIABLE LABELS p21b4 '¿El paquete turistico incluye Alimentación?'.

VARIABLE LABELS p21b5 '¿El paquete turistico incluye Tours?'.

 

 

.....

 

I thank you in advance for your attention and again wish you many successes in your activities.

Sincerely,

 

--

Javier Figueroa
Procesamiento y Análisis de bases de datos

Cel: 5927-4748 / 4970-1940

Casa: 2289-0184

===================== 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




This correspondence contains proprietary information some or all of which may be legally privileged; it is for the intended recipient only. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this correspondence and completely dispose of the correspondence immediately. Please notify the sender if you have received this email in error. NOTE: Messages to or from the State of Connecticut domain may be subject to the Freedom of Information statutes and regulations.

===================== 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: Generate combined codebook

Javier Figueroa
thanks Melissa, your response has been very useful, Solution is very practical and very beneficial I have a lot of records.

Sincerely,



2017-10-25 8:18 GMT-06:00 Ives, Melissa L <[hidden email]>:

Javier,

 

I didn’t see a reply to your question, so I thought I’d share my thoughts.

 

It sounds like you are looking for a single variable with ‘all possible response combinations’ for each of the 5 questions (international shipping to tours).

There will be 25 or 32 possible combinations (including ‘None of the above’).

 

One way this kind of thing is done is to multiply each response by (10 * the item count (1-5)) then add them up.

 

e.g. (in reverse order)

resultsum=(Tours *10)+(Food*100)+(Accomodations*1000)(NatTrans*10000)(IntShip*100000).

 

I would recode the variables so No=0 and Si=1, but that isn’t vital.

If you do recode your results look like (if not you would see 11111 to 22222):

00000 – none

00001 – tours only

00010 – food only

00100 – accommodations only

01000 – national transportation only

10000 – international shipping only

…(the other 22).

11011 – all but accommodations

11101 – all but food

11110 – all but tours

11111 – everything

 

Hope this helps.

Melissa

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Javier Figueroa
Sent: Friday, October 06, 2017 6:01 PM
To: [hidden email]
Subject: [SPSSX-L] Generate combined codebook

 

Hello SPSS Experts

 

Before worrying about the doubt that arises, I would like to wish many exams in their activities and thank them for taking a few moments to try to solve the problems that present me in the use of this excellent statistical program.

 

I have a database 233,353 records, there are multiple questions and answers sinples, my problem is with the multiple answer I would like to combine the answers and then generate a variable with that result. Former.

 

Structure of the database

 

id = no. of the questionnaire identifier

p21 = Buy a tour package? Si = 1, No = 2.

p21a = How much does the tour package cost? Values

p21b1 = Does the package include international shipping? Yes = 1, No = p21b2 = Does the package include national transport? Si = 1, No = 2.

p21b3 = Does the package include accommodation? Si = 1, No = 2.

p21b4 = Does the package include food? Si = 1, No = 2.

p21b5 = Does the Tour package include Tours? Si = 1, No = 2.

 

I would like to have as a result to have all possible combinations as well as

VARIABLE LEBELS result 'Services that includes tourist package'.

VALUE LEBEL result

1 'All (international transport, national transport, lodging, food, excursions)'

2 International transport, national transport

3 International Transport, Accommodation

 

Database example

 

DATA LIST /id 1 p21 5-5 p21a 6-14 p21b1 15-15 p21b2 16-16 p21b3 17-17 p21b4 18-18 p21b5 19-19.

BEGIN DATA

1   1  245000 11111

2   1   35000 12112

3   1   30000 11122

4   1   25000 11111

5   2  

6   1   18000 22111

7   2  

8   2 

9   1   35000 21112

END DATA.

 

VARIABLE LABELS id 'Id Cuestionario'.

VARIABLE LABELS p21 '¿Adquirio paquete turistico?'.

VALUE LABELS p21

1   Si

2   No.

VARIABLE LABELS p21a '¿Cuanto le costo el paquete turistico?'.

VARIABLE LABELS p21b1 '¿El paquete turistico incluye transporte internacional?'.

VALUE LABELS p21b1 to p21b5

1   Si

2   No.

VARIABLE LABELS p21b2 '¿El paquete turistico incluye transporte nacional?'.

VARIABLE LABELS p21b3 '¿El paquete turistico incluye Alojamiento?'.

VARIABLE LABELS p21b4 '¿El paquete turistico incluye Alimentación?'.

VARIABLE LABELS p21b5 '¿El paquete turistico incluye Tours?'.

 

 

.....

 

I thank you in advance for your attention and again wish you many successes in your activities.

Sincerely,

 

--

Javier Figueroa
Procesamiento y Análisis de bases de datos

Cel: 5927-4748 / 4970-1940

Casa: 2289-0184

===================== 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




This correspondence contains proprietary information some or all of which may be legally privileged; it is for the intended recipient only. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this correspondence and completely dispose of the correspondence immediately. Please notify the sender if you have received this email in error. NOTE: Messages to or from the State of Connecticut domain may be subject to the Freedom of Information statutes and regulations.




--
Javier Figueroa
Procesamiento y Análisis de bases de datos
Cel: 5927-4748 / 4970-1940
Casa: 2289-0184

===================== 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