|
Dear Johnny,
thanks for your help again. I had used the recoding procedure before, but then it did not allow me to put two different conditions in the new recoded variable. I now decided to separate the two groups, pregnant and non pregnant according to their references. Therefore I did two records, one for each Hb reference and runned two different crosstabs, accordingly. To get what I wanted in one table, I had to make another table manually. See examples 1., 2. and Mannually below. Should I do it differently? I am still open for alternatives. Thanks, Alice. 1. Recoded weather pregnant Total Non pregnant Pregnant Classified using non pregnancy references Non Anemic 260 10 270 Mild anemia 70 20 90 Moderate anemia 20 10 30 Severe anemia 10 0 10 Total 360 40 400 2. Recoded whether pregnant Total Non pregnant Pregnant Classified using pregnancy references Non Anemic 300 20 320 Mild anemia 30 10 40 Moderate anemia 20 10 30 Severe anemia 10 0 10 Total 360 40 400 Manually Recoded whether pregnant Total Non pregnant Pregnant Classified using both non- and pregnancy references Non Anemic 260 20 280 Mild anemia 70 10 80 Moderate anemia 20 10 30 Severe anemia 10 0 10 Total 354 40 400 ________________________________ From: Johnny Amora <[hidden email]> To: alice temu <[hidden email]> Sent: Tuesday, January 6, 2009 12:03:10 AM Subject: Re: Crosstabs You can just recode first the continuous variable. Instead of using syntax to recode, use the point-click. To recode, click Transform then Record into Different Variables Then follow through the dialog box. After recoding, run the chisquare. Just tell me if there are still problems. Johnny --- On Tue, 1/6/09, alice temu <[hidden email]> wrote: From: alice temu <[hidden email]> Subject: Re: Crosstabs To: [hidden email] Date: Tuesday, 6 January, 2009, 12:49 PM Dear Jonny, thanks for your help. My problem is giving (computing) the variable Y (from continuous values), a value (based on pregnant and non pregnant references) Pregnant: < 11, >= 11 Non pregnant: < 12, >=12 I tried to compute and run frequencies and crosstabs, see below. The values got mixed up. How can I better attempt this test. Thanks again, Alice. IF (((RecPregNow = 0 & hemogl >= 12) | (RecPregNow >= 1 & hemogl >= 11))) testheamanpre = 1 . VARIABLE LABELS testheamanpre 'test heamoglobin anemia pregnancy' . EXECUTE . IF (((RecPregNow = 0 & hemogl < 12) | (RecPregNow >= 1 & hemogl < 11))) testheamanpre = 2 . EXECUTE . FREQUENCIES VARIABLES=testheamanpre /STATISTICS=SUM /BARCHART FREQ /ORDER= ANALYSIS . CROSSTABS /TABLES=testheamanpre BY hamlet /FORMAT= AVALUE TABLES /STATISTIC=CHISQ CORR /CELLS= COUNT ROW COLUMN TOTAL /COUNT ROUND CELL . ________________________________ From: Johnny Amora <[hidden email]> To: [hidden email] Sent: Monday, January 5, 2009 9:30:02 PM Subject: Re: Crosstabs Hi Alice, To do crosstabs you should have the variables in your data set. The variables should be in the columns. In your case, you should have, say, X variable with values pregnant and non pregnant; and Y variable with values anemic and non-anemic. Suppose you have 5 respondents, your data set should have three columns as follows: Respondent X Y A pregnant anemic B nonpregnant nonanemic C nonpregnant anemic D pregnant anemic E pregnant nonanemic Then run the following syntax to produce the crosstabs and chisquare statistics: CROSSTABS /TABLES= X BY Y /FORMAT= AVALUE TABLES /STATISTIC=CHISQ /CELLS= COUNT /COUNT ROUND CELL . Hope this helps, Johnny --- On Tue, 1/6/09, alice temu <[hidden email]> wrote: From: alice temu <[hidden email]> Subject: Crosstabs To: [hidden email] Date: Tuesday, 6 January, 2009, 10:06 AM Dear all, Happy New Year. I have a question on Crosstabs in SPSS I would like to run one variable (Hb) with two different cutoff points (reference limits) I would like to see (pregnant and anemic), (pregnant but not anemic),(not pregnantbut anemic), and (not pregnant and not anemic) with their corresponding reference limits in one table (see below). Is this applicable in SPSS to have frequencies, correlation etc. in such categorical variables? Any alternatives? Please help. Thanks, Alice. Anemic Non anemic Total Pregnant Non pregnant Total ===================== 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 Catch Emoticarolers in the act in this Christmas! Spread holiday cheers to your friends and loved ones via Yahoo! Messenger today! Get started at http://emoticarolers.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 ________________________________ Is Bangus or Tilapia more delicious? Tell us what you think in Yahoo! Answers ===================== 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 |
|
Stick your RECODE command inside a DO IF command where you check the
pregnancy variable. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of alice temu Sent: Tuesday, January 06, 2009 12:01 PM To: [hidden email] Subject: Crosstabs Dear Johnny, thanks for your help again. I had used the recoding procedure before, but then it did not allow me to put two different conditions in the new recoded variable. I now decided to separate the two groups, pregnant and non pregnant according to their references. Therefore I did two records, one for each Hb reference and runned two different crosstabs, accordingly. To get what I wanted in one table, I had to make another table manually. See examples 1., 2. and Mannually below. Should I do it differently? I am still open for alternatives. Thanks, Alice. 1. Recoded weather pregnant Total Non pregnant Pregnant Classified using non pregnancy references Non Anemic 260 10 270 Mild anemia 70 20 90 Moderate anemia 20 10 30 Severe anemia 10 0 10 Total 360 40 400 2. Recoded whether pregnant Total Non pregnant Pregnant Classified using pregnancy references Non Anemic 300 20 320 Mild anemia 30 10 40 Moderate anemia 20 10 30 Severe anemia 10 0 10 Total 360 40 400 Manually Recoded whether pregnant Total Non pregnant Pregnant Classified using both non- and pregnancy references Non Anemic 260 20 280 Mild anemia 70 10 80 Moderate anemia 20 10 30 Severe anemia 10 0 10 Total 354 40 400 ________________________________ From: Johnny Amora <[hidden email]> To: alice temu <[hidden email]> Sent: Tuesday, January 6, 2009 12:03:10 AM Subject: Re: Crosstabs You can just recode first the continuous variable. Instead of using syntax to recode, use the point-click. To recode, click Transform then Record into Different Variables Then follow through the dialog box. After recoding, run the chisquare. Just tell me if there are still problems. Johnny --- On Tue, 1/6/09, alice temu <[hidden email]> wrote: From: alice temu <[hidden email]> Subject: Re: Crosstabs To: [hidden email] Date: Tuesday, 6 January, 2009, 12:49 PM Dear Jonny, thanks for your help. My problem is giving (computing) the variable Y (from continuous values), a value (based on pregnant and non pregnant references) Pregnant: < 11, >= 11 Non pregnant: < 12, >=12 I tried to compute and run frequencies and crosstabs, see below. The values got mixed up. How can I better attempt this test. Thanks again, Alice. IF (((RecPregNow = 0 & hemogl >= 12) | (RecPregNow >= 1 & hemogl >= 11))) testheamanpre = 1 . VARIABLE LABELS testheamanpre 'test heamoglobin anemia pregnancy' . EXECUTE . IF (((RecPregNow = 0 & hemogl < 12) | (RecPregNow >= 1 & hemogl < 11))) testheamanpre = 2 . EXECUTE . FREQUENCIES VARIABLES=testheamanpre /STATISTICS=SUM /BARCHART FREQ /ORDER= ANALYSIS . CROSSTABS /TABLES=testheamanpre BY hamlet /FORMAT= AVALUE TABLES /STATISTIC=CHISQ CORR /CELLS= COUNT ROW COLUMN TOTAL /COUNT ROUND CELL . ________________________________ From: Johnny Amora <[hidden email]> To: [hidden email] Sent: Monday, January 5, 2009 9:30:02 PM Subject: Re: Crosstabs Hi Alice, To do crosstabs you should have the variables in your data set. The variables should be in the columns. In your case, you should have, say, X variable with values pregnant and non pregnant; and Y variable with values anemic and non-anemic. Suppose you have 5 respondents, your data set should have three columns as follows: Respondent X Y A pregnant anemic B nonpregnant nonanemic C nonpregnant anemic D pregnant anemic E pregnant nonanemic Then run the following syntax to produce the crosstabs and chisquare statistics: CROSSTABS /TABLES= X BY Y /FORMAT= AVALUE TABLES /STATISTIC=CHISQ /CELLS= COUNT /COUNT ROUND CELL . Hope this helps, Johnny --- On Tue, 1/6/09, alice temu <[hidden email]> wrote: From: alice temu <[hidden email]> Subject: Crosstabs To: [hidden email] Date: Tuesday, 6 January, 2009, 10:06 AM Dear all, Happy New Year. I have a question on Crosstabs in SPSS I would like to run one variable (Hb) with two different cutoff points (reference limits) I would like to see (pregnant and anemic), (pregnant but not anemic),(not pregnantbut anemic), and (not pregnant and not anemic) with their corresponding reference limits in one table (see below). Is this applicable in SPSS to have frequencies, correlation etc. in such categorical variables? Any alternatives? Please help. Thanks, Alice. Anemic Non anemic Total Pregnant Non pregnant Total ===================== 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 Catch Emoticarolers in the act in this Christmas! Spread holiday cheers to your friends and loved ones via Yahoo! Messenger today! Get started at http://emoticarolers.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 ________________________________ Is Bangus or Tilapia more delicious? Tell us what you think in Yahoo! Answers ===================== 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 |
|
Alice
If what you want is to create a new ordinal variable 'anemia' with 4 levels (0, non-anemic; 1, mild anemia; 2, moderate anemia; 3 severe anemia) you could use something like the following IF statements: IF ((RecPregNow =0 and hemogl GE 12) OR (RecPregNow =1 and hemogl GE 11)) Anemia=0. IF ((RecPregNow =0 and (hemogl GE 10 and hemogl LE 11.9 )) OR (RecPregNow =1 and (hemogl GE 9 and hemogl LE 10.9 ))) Anemia=1. IF ((RecPregNow =0 and (hemogl GE 7 and hemogl LE 9.9 )) OR (RecPregNow =1 and (hemogl GE 6 and hemogl LE 8.9 ))) Anemia=2. IF ((RecPregNow =0 and (hemogl LT 7.0)) OR (RecPregNow =1 and hemogl lt 6.0 )) Anemia=3. FORMATS Anemia (f1). VARIABLE LABELS Anemia 'Level of anemia'. VALUE LABELS Anemia 0 'None' 1 'Mild' 2 'Moderate' 3 'Severe'. I recognize that this isn't very elegant (actually it's fairly clunky and pretty close to brute force) and if anemic had more levels, it would rapidly become unworkable, but for what you want it works fine. NOTE: I MADE UP THE CUT POINTS FOR MILD, MODERATE AND SEVERE ANEMIA. YOU WILL NEED TO SUBSTITUTE THE CORRECT VALUES. Pat -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of ViAnn Beadle Sent: January 6, 2009 3:33 PM To: [hidden email] Subject: Re: Crosstabs Stick your RECODE command inside a DO IF command where you check the pregnancy variable. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of alice temu Sent: Tuesday, January 06, 2009 12:01 PM To: [hidden email] Subject: Crosstabs Dear Johnny, thanks for your help again. I had used the recoding procedure before, but then it did not allow me to put two different conditions in the new recoded variable. I now decided to separate the two groups, pregnant and non pregnant according to their references. Therefore I did two records, one for each Hb reference and runned two different crosstabs, accordingly. To get what I wanted in one table, I had to make another table manually. See examples 1., 2. and Mannually below. Should I do it differently? I am still open for alternatives. Thanks, Alice. 1. Recoded weather pregnant Total Non pregnant Pregnant Classified using non pregnancy references Non Anemic 260 10 270 Mild anemia 70 20 90 Moderate anemia 20 10 30 Severe anemia 10 0 10 Total 360 40 400 2. Recoded whether pregnant Total Non pregnant Pregnant Classified using pregnancy references Non Anemic 300 20 320 Mild anemia 30 10 40 Moderate anemia 20 10 30 Severe anemia 10 0 10 Total 360 40 400 Manually Recoded whether pregnant Total Non pregnant Pregnant Classified using both non- and pregnancy references Non Anemic 260 20 280 Mild anemia 70 10 80 Moderate anemia 20 10 30 Severe anemia 10 0 10 Total 354 40 400 ________________________________ From: Johnny Amora <[hidden email]> To: alice temu <[hidden email]> Sent: Tuesday, January 6, 2009 12:03:10 AM Subject: Re: Crosstabs You can just recode first the continuous variable. Instead of using syntax to recode, use the point-click. To recode, click Transform then Record into Different Variables Then follow through the dialog box. After recoding, run the chisquare. Just tell me if there are still problems. Johnny --- On Tue, 1/6/09, alice temu <[hidden email]> wrote: From: alice temu <[hidden email]> Subject: Re: Crosstabs To: [hidden email] Date: Tuesday, 6 January, 2009, 12:49 PM Dear Jonny, thanks for your help. My problem is giving (computing) the variable Y (from continuous values), a value (based on pregnant and non pregnant references) Pregnant: < 11, >= 11 Non pregnant: < 12, >=12 I tried to compute and run frequencies and crosstabs, see below. The values got mixed up. How can I better attempt this test. Thanks again, Alice. IF (((RecPregNow = 0 & hemogl >= 12) | (RecPregNow >= 1 & hemogl >= 11))) testheamanpre = 1 . VARIABLE LABELS testheamanpre 'test heamoglobin anemia pregnancy' . EXECUTE . IF (((RecPregNow = 0 & hemogl < 12) | (RecPregNow >= 1 & hemogl < 11))) testheamanpre = 2 . EXECUTE . FREQUENCIES VARIABLES=testheamanpre /STATISTICS=SUM /BARCHART FREQ /ORDER= ANALYSIS . CROSSTABS /TABLES=testheamanpre BY hamlet /FORMAT= AVALUE TABLES /STATISTIC=CHISQ CORR /CELLS= COUNT ROW COLUMN TOTAL /COUNT ROUND CELL . ________________________________ From: Johnny Amora <[hidden email]> To: [hidden email] Sent: Monday, January 5, 2009 9:30:02 PM Subject: Re: Crosstabs Hi Alice, To do crosstabs you should have the variables in your data set. The variables should be in the columns. In your case, you should have, say, X variable with values pregnant and non pregnant; and Y variable with values anemic and non-anemic. Suppose you have 5 respondents, your data set should have three columns as follows: Respondent X Y A pregnant anemic B nonpregnant nonanemic C nonpregnant anemic D pregnant anemic E pregnant nonanemic Then run the following syntax to produce the crosstabs and chisquare statistics: CROSSTABS /TABLES= X BY Y /FORMAT= AVALUE TABLES /STATISTIC=CHISQ /CELLS= COUNT /COUNT ROUND CELL . Hope this helps, Johnny --- On Tue, 1/6/09, alice temu <[hidden email]> wrote: From: alice temu <[hidden email]> Subject: Crosstabs To: [hidden email] Date: Tuesday, 6 January, 2009, 10:06 AM Dear all, Happy New Year. I have a question on Crosstabs in SPSS I would like to run one variable (Hb) with two different cutoff points (reference limits) I would like to see (pregnant and anemic), (pregnant but not anemic),(not pregnantbut anemic), and (not pregnant and not anemic) with their corresponding reference limits in one table (see below). Is this applicable in SPSS to have frequencies, correlation etc. in such categorical variables? Any alternatives? Please help. Thanks, Alice. Anemic Non anemic Total Pregnant Non pregnant Total ===================== 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 Catch Emoticarolers in the act in this Christmas! Spread holiday cheers to your friends and loved ones via Yahoo! Messenger today! Get started at http://emoticarolers.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 ________________________________ Is Bangus or Tilapia more delicious? Tell us what you think in Yahoo! Answers ===================== 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 ===================== 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 |
| Free forum by Nabble | Edit this page |
