total for tables-two diff categories

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

total for tables-two diff categories

Rodrigo Briceño
Dear SPSS users. I would like your gently help about the following issue.
I'm preparing a table in PASW18 that combines by sex two different questions of a survey.
Question 1 asks if the person has ever attended school and question 2 asks if the person who answered yes is Currently in the school system. The thing is that I must combine answers from the two questions in the same table, so my output will read: Never attended, currently attending, ever attended but not currently attending.

Although presentation of these results is quite easy, my question to the list is about the possibility of getting a total of the three categories. I have tried used the custom tables GUI, but it seems like I only can put a total at the bottom of each variable (not to sum the three categories of interest).

Do anybody know if this is possible to be defined?
Thanks in advance
--
__________________________________________________________________

__________________________________________________________________

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113   Oficina Costa Rica
+506  22-32-08-30                  Fax
[hidden email]
www.sanigest.com

MSN:
[hidden email]
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.

Reply | Threaded
Open this post in threaded view
|

Re: total for tables-two diff categories

Melissa Ives
__________________________________________________________________
Rodrigo,
 
Seems to me the simplest thing would be to create a new variable (in syntax).
 
The following assumes that yes is coded 1 and No is coded 0 for Q1 (ever attended) and Q2 (currently attending).
(I'm going to assume that you have already confirmed that there are none who said they never attended but are currently attending.)
 
if (Q1=0) schstat=0.
if (Q1=1 and Q2=1) schstat=1.
if (Q1=1 and Q2=0) schstat=2.
var labels schstat 'School status'.
value labels  
  0 'Never attended'
  1 'Currently Attending'
  2 'Past Attendance (Ever but not current)'.
 
Then use this variable in your analysis.
 
Melissa

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Rodrigo Briceño
Sent: Thursday, April 15, 2010 4:57 PM
To: [hidden email]
Subject: [SPSSX-L] total for tables-two diff categories

Dear SPSS users. I would like your gently help about the following issue.
I'm preparing a table in PASW18 that combines by sex two different questions of a survey.
Question 1 asks if the person has ever attended school and question 2 asks if the person who answered yes is Currently in the school system. The thing is that I must combine answers from the two questions in the same table, so my output will read: Never attended, currently attending, ever attended but not currently attending.

Although presentation of these results is quite easy, my question to the list is about the possibility of getting a total of the three categories. I have tried used the custom tables GUI, but it seems like I only can put a total at the bottom of each variable (not to sum the three categories of interest).

Do anybody know if this is possible to be defined?
Thanks in advance
--

__________________________________________________________________

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113   Oficina Costa Rica
+506  22-32-08-30                  Fax
[hidden email]
www.sanigest.com

MSN:
[hidden email]
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.



PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.
Reply | Threaded
Open this post in threaded view
|

Re: total for tables-two diff categories

John F Hall
In reply to this post by Rodrigo Briceño
__________________________________________________________________
Assuming:
 
q1 coded 1 = yes, 2 = no
q2 coded  1 = yes, 2 = no
 
you need something like (untested, and it's very late here)
 
compute newvar = q1 * 10 + q2.
recode newvar (20 =1)(11=1)(12 = 3)
val lab newvar 1 'Never attended'
                            2 'Currently attending'
                            3 'Not attending' 
                        
be careful of missing values!
----- Original Message -----
Sent: Thursday, April 15, 2010 11:56 PM
Subject: total for tables-two diff categories

Dear SPSS users. I would like your gently help about the following issue.
I'm preparing a table in PASW18 that combines by sex two different questions of a survey.
Question 1 asks if the person has ever attended school and question 2 asks if the person who answered yes is Currently in the school system. The thing is that I must combine answers from the two questions in the same table, so my output will read: Never attended, currently attending, ever attended but not currently attending.

Although presentation of these results is quite easy, my question to the list is about the possibility of getting a total of the three categories. I have tried used the custom tables GUI, but it seems like I only can put a total at the bottom of each variable (not to sum the three categories of interest).

Do anybody know if this is possible to be defined?
Thanks in advance
--

__________________________________________________________________

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113   Oficina Costa Rica
+506  22-32-08-30                  Fax
[hidden email]
www.sanigest.com

MSN:
[hidden email]
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.

Reply | Threaded
Open this post in threaded view
|

Re: total for tables-two diff categories

John F Hall
In reply to this post by Rodrigo Briceño
 __________________________________________________________________
Rodriguo
 
Have you checked your data first, to make sure there are no illogical combinations?
 
cros q1 by q2 .
 
Melissa's solution using if uses much more computer resources than recode so I've suggested an amendment to her syntax.  Instead of: 
 
if (Q1=0) schstat=0.
if (Q1=1 and Q2=1) schstat=1.
if (Q1=1 and Q2=0) schstat=2.
 
you can use
 
compute schstat = q1 + q2 * 10.
recode schstat (0 = 1)(11 = 2)(10 = 3).
var labels schstat 'School status'.
value labels  
  1 'Never attended'
  2 'Currently Attending'
  3 'Past Attendance (Ever but not current)'.
 
I'm never happy about using 0 as a code, so would always use 1 = yes, 2 = no, but my solution should produce the same result.
 
compute newvar = q1 * 10 + q2 .
recode newvar (20 =1)(11=1)(12 = 3) .
val lab newvar 1 'Never attended'
                            2 'Currently attending'
                            3 'Not attending' .
 
Here's real life example I dug out this morning.
 

London Health for All

 

Secondary analysis of data on diet and health from survey of Health and Life-styles by Bloomsbury and  Islington  Health      Authority  (1993)  See: Steve Griffiths with John Hall  The Lie of the Land for the Health of the Nation: an analysis of  the  Bloomsbury  and Islington Health  &  Lifestyle  survey.       Report to Bloomsbury and Islington AHA, May 1993

 

The data set included two variables, v670 (Responsibility for children) and v715 (Marital Status)  The client wanted a single variable combining these into 4 categories:

 
Single, no responsibilty for children
Couple, no responsibility for children
Single with responsibilty for children
Couple with responsibilty for children
 
Step 1:
 
freq v670 v715.
cro v715 by v670.
 

RESPONSIBLE FOR CHILDREN

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Yes

432

30.6

30.6

30.6

No

953

67.5

67.5

98.2

3

26

1.8

1.8

100.0

Total

1411

100.0

100.0

 
 
 
 

MARITAL STATUS

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

SINGLE

526

37.3

37.5

37.5

MARRIED

467

33.1

33.3

70.8

COHABITING

73

5.2

5.2

76.0

SEPARATED

50

3.5

3.6

79.5

DIVORCED

122

8.6

8.7

88.2

WIDOWED

160

11.3

11.4

99.6

OTHER

5

.4

.4

100.0

Total

1403

99.4

100.0

 

Missing

System

8

.6

   

Total

1411

100.0

   
 
 

MARITAL STATUS * RESPONSIBLE FOR CHILDREN Crosstabulation

Count

 

RESPONSIBLE FOR CHILDREN

Total

Yes

No

3

MARITAL STATUS

SINGLE

88

422

16

526

MARRIED

234

228

5

467

COHABITING

30

43

0

73

SEPARATED

23

27

0

50

DIVORCED

46

75

1

122

WIDOWED

10

147

3

160

OTHER

0

5

0

5

Total

431

947

25

1403

 
Step 2:
 
The original syntax was run with SPSSX-4 on a Vax mainframe in 1993, but it still works!  It wasn't my data, and there was no indication of what code 3 was in v670 (probably missing). 
 
compute famstat=v670*10+v715.
recode famstat (21 24 25 26=1)(22 23=2)(11 14 15 16=3)(12 13=2)(else=sysmis).
value labels famstat
  1 'Single: no kids' 2 'Couple: no kids' 3 'Single: + kids' 4 'Couple: + kids'.
print formats famstat (f1.0).
freq famstat .
 
I always use abbreviated syntax, but for clients I used the full syntax, except in the last line here to produce the following table.
 

famstat

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Single: no kids

671

47.6

48.9

48.9

Couple: no kids

535

37.9

39.0

87.8

Single: + kids

167

11.8

12.2

100.0

Total

1373

97.3

100.0

 

Missing

System

38

2.7

   

Total

1411

100.0

   
 
Not sure if the list will show the tables: if not I'll attach them in a Word document to you, but not the list..
 
John Hall
----- Original Message -----
Sent: Thursday, April 15, 2010 11:56 PM
Subject: total for tables-two diff categories

Dear SPSS users. I would like your gently help about the following issue.
I'm preparing a table in PASW18 that combines by sex two different questions of a survey.
Question 1 asks if the person has ever attended school and question 2 asks if the person who answered yes is Currently in the school system. The thing is that I must combine answers from the two questions in the same table, so my output will read: Never attended, currently attending, ever attended but not currently attending.

Although presentation of these results is quite easy, my question to the list is about the possibility of getting a total of the three categories. I have tried used the custom tables GUI, but it seems like I only can put a total at the bottom of each variable (not to sum the three categories of interest).

Do anybody know if this is possible to be defined?
Thanks in advance
--

__________________________________________________________________

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113   Oficina Costa Rica
+506  22-32-08-30                  Fax
[hidden email]
www.sanigest.com

MSN:
[hidden email]
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.

Reply | Threaded
Open this post in threaded view
|

Incorporate Sigtest in SAME Ctable output

Thien Hop
 __________________________________________________________________
Hi all,
 
May I know if there is a way to add the significant test result inside the Ctable output. For now, when I add the Test Statistics to a Ctable, the results are indicated in a separate output from the normal tab for that same question. To add the sigtest result to the main output table, I have to export both tables to Excel & manually combine them together. This practice is quite time-consuming & easy to go wrong as there are so many column & rows.
 
Thank you so much for any advice in advance,
 
Hop
Reply | Threaded
Open this post in threaded view
|

Re: Incorporate Sigtest in SAME Ctable output

Jon K Peck

In Version 18 there is an option in CTABLES to put the significance results in the main table, although the representation is different from what is shown in the separate table.

There is also an extension command, SPSSINC MERGE TABLES that can be used to merge the signifcance results into the main table.  This works for Version 17 and later.

The command is available from SPSS Developer Central and requires the Python programmability plugin.

HTH,
Jon Peck
SPSS, an IBM Company
[hidden email]
312-651-3435



From: Thien Hop <[hidden email]>
To: [hidden email]
Date: 04/18/2010 11:20 PM
Subject: [SPSSX-L] Incorporate Sigtest in SAME Ctable output
Sent by: "SPSSX(r) Discussion" <[hidden email]>





Hi all,
 
May I know if there is a way to add the significant test result inside the Ctable output. For now, when I add the Test Statistics to a Ctable, the results are indicated in a separate output from the normal tab for that same question. To add the sigtest result to the main output table, I have to export both tables to Excel & manually combine them together. This practice is quite time-consuming & easy to go wrong as there are so many column & rows.
 
Thank you so much for any advice in advance,
 
Hop

Reply | Threaded
Open this post in threaded view
|

Re: total for tables-two diff categories

Rodrigo Briceño
In reply to this post by John F Hall
Thanks to all of you that provided me help with the syntax. Certainly the best way to do it was to create a new variable.

R.
__________________________________________________________________

__________________________________________________________________

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506� 22-91-12-00� ext. 113 � Oficina Costa Rica
+506� 22-32-08-30� � � � � � � � � � � � � � � � Fax
[hidden email]
www.sanigest.com

MSN:
[hidden email]
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.


El 4/16/2010 12:21 AM, John F Hall escribió:
__________________________________________________________________
Rodriguo
Have you checked your data first, to make sure there are no illogical combinations?
cros q1 by q2 .
Melissa's solution using if uses much more computer resources than recode so I've suggested an amendment to her syntax.� Instead of:�
if (Q1=0) schstat=0.
if (Q1=1 and Q2=1) schstat=1.
if (Q1=1 and Q2=0) schstat=2.
you can use
compute schstat = q1 + q2 * 10.
recode schstat (0 = 1)(11 = 2)(10 = 3).
var labels schstat 'School status'.
value labels� �
� � 1 'Never attended'
� � 2 'Currently Attending'
� 3 'Past Attendance (Ever but not current)'.
I'm never happy about using� 0 as a code, so would always use� 1 = yes,� 2 = no, but my solution should produce the same result.
compute newvar = q1 * 10 + q2 .
recode newvar (20 =1)(11=1)(12 = 3) .
val lab newvar 1 'Never attended'
� � � � � � � � � � � � � � � � � � � � � 2 'Currently attending'
� � � � � � � � � � � � � � � � � � � � � 3 'Not attending'� .
Here's real life example I dug out this morning.

London Health for All

Secondary analysis of data on diet and health from survey of Health and Life-styles by Bloomsbury andIslingtonHealth� � � � � Authority(1993)See: Steve Griffiths with John HallThe Lie of the Land for the Health of the Nation: an analysis oftheBloomsburyand Islington Health&Lifestylesurvey.� � � � � � Report to Bloomsbury and Islington AHA, May 1993

The data set included two variables, v670 (Responsibility for children) and v715 (Marital Status)� The client wanted a single variable combining these into 4 categories:

Single, no responsibilty for children
Couple, no responsibility for children
Single with responsibilty for children
Couple with responsibilty for children
Step 1:
freq v670 v715.
cro v715 by v670.

RESPONSIBLE FOR CHILDREN

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Yes

432

30.6

30.6

30.6

No

953

67.5

67.5

98.2

3

26

1.8

1.8

100.0

Total

1411

100.0

100.0

 

MARITAL STATUS

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

SINGLE

526

37.3

37.5

37.5

MARRIED

467

33.1

33.3

70.8

COHABITING

73

5.2

5.2

76.0

SEPARATED

50

3.5

3.6

79.5

DIVORCED

122

8.6

8.7

88.2

WIDOWED

160

11.3

11.4

99.6

OTHER

5

.4

.4

100.0

Total

1403

99.4

100.0

 

Missing

System

8

.6

   

Total

1411

100.0

   

MARITAL STATUS * RESPONSIBLE FOR CHILDREN Crosstabulation

Count

 

RESPONSIBLE FOR CHILDREN

Total

Yes

No

3

MARITAL STATUS

SINGLE

88

422

16

526

MARRIED

234

228

5

467

COHABITING

30

43

0

73

SEPARATED

23

27

0

50

DIVORCED

46

75

1

122

WIDOWED

10

147

3

160

OTHER

0

5

0

5

Total

431

947

25

1403

Step 2:
The original syntax� was run with SPSSX-4 on a Vax mainframe in 1993, but it still works!� It wasn't my data, and there was no indication of what code 3 was in v670 (probably missing).�
compute famstat=v670*10+v715.
recode famstat (21 24 25 26=1)(22 23=2)(11 14 15 16=3)(12 13=2)(else=sysmis).
value labels famstat
� 1 'Single: no kids' 2 'Couple: no kids' 3 'Single: + kids' 4 'Couple: + kids'.
print formats famstat (f1.0).
freq famstat .
I always use abbreviated syntax, but for clients I used the full syntax, except in the last line here to produce the following table.

famstat

 

Frequency

Percent

Valid Percent

Cumulative Percent

Valid

Single: no kids

671

47.6

48.9

48.9

Couple: no kids

535

37.9

39.0

87.8

Single: + kids

167

11.8

12.2

100.0

Total

1373

97.3

100.0

 

Missing

System

38

2.7

   

Total

1411

100.0

   
Not sure if the list will show the tables: if not I'll attach them in a Word document to you, but not the list..
John Hall
----- Original Message -----
Sent: Thursday, April 15, 2010 11:56 PM
Subject: total for tables-two diff categories

Dear SPSS users. I would like your gently help about the following issue.
I'm preparing a table in PASW18 that combines by sex two different questions of a survey.
Question 1 asks if the person has ever attended school and question 2 asks if the person who answered yes is Currently in the school system. The thing is that I must combine answers from the two questions in the same table, so my output will read: Never attended, currently attending, ever attended but not currently attending.

Although presentation of these results is quite easy, my question to the list is about the possibility of getting a total of the three categories. I have tried used the custom tables GUI, but it seems like I only can put a total at the bottom of each variable (not to sum the three categories of interest).

Do anybody know if this is possible to be defined?
Thanks in advance
--

__________________________________________________________________

Rodrigo Briceño
Project Manager
Sanigest Internacional

+506� 22-91-12-00� ext. 113 � Oficina Costa Rica
+506� 22-32-08-30� � � � � � � � � � � � � � � � Fax
[hidden email]
www.sanigest.com

MSN:
[hidden email]
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.