|
I am attempting to score the Eating Disorders Diagnostic Scale using syntax provided by the authors. However, when I attempt to execute the syntax commands (using "run"), it creates new variables but every cell in the new variables is empty.
Can anyone tell me what the problem might be? (I should note that I generally work with the graphical user interface and rarely use syntax so there may be something simple that I'm overlooking).
I've included the syntax below
If edds5=0 and edds6=0 edds9=0. If edds5=0 and edds6=0 edds10=0. If edds5=0 and edds6=0 edds11=0. If edds5=0 and edds6=0 edds12=0. If edds5=0 and edds6=0 edds13=0. If edds5=0 and edds6=0 edds14=0. Compute eddsBMI=(Edds19 / 2.205)/((Edds20 / 39.37) ** 2). If edds19 < 50 eddsBMI=999. If edds20 < 40 eddsBMI=999. RECODE eddsBMI (999=SYSMIS). Compute feature=sum.1(edds9, edds10, edds11, edds12, edds13). Compute bedbing=999. If edds5=0 bedbing=0. If edds5=1 and edds6=1 and edds7>=1 and feature>=3 and edds14=1 bedbing=1. If edds5=1 and edds6=1 and edds7>=2 and feature>=3 and edds14=1 bedbing=2. Compute bulbing=999. If edds5=0 bulbing=0. If edds5=1 and edds6=1 and edds8 >=1 bulbing=1. If edds5=1 and edds6=1 and edds8 >=2 bulbing=2. RECODE bedbing bulbing (999=SYSMIS). Compute compsum=999. Compute compsum=sum.2(edds15,edds16,edds17,edds18). RECODE compsum (999=SYSMIS). Compute compen=999. If compsum < 1 compen=0. If compsum >=1 compen=1. If compsum >=2 compen=2. RECODE compen (999=SYSMIS). Compute wtshap=999. If edds3 < 6 or edds4 < 6 wtshap=0. If edds3 >=1 or edds4 >=1 wtshap=1. If edds3 >=4 or edds4 >=4 wtshap=2. Compute LowBMI=999. If eddsBMI > 10 lowBMI=0. If eddsBMI <=18.5 LowBMI=1. If eddsBMI <=17.5 LowBMI=2. Compute fearwt=999. If edds2 <7 fearwt=0. If edds2 >=1 fearwt=1. If edds2 >=4 fearwt=2. Compute amen=999. If edds21 >=0 amen=0. If edds21 >=1 amen=1. If edds21 >=0 and edds22=1 amen=1. If edds21 >=3 amen=2. If edds21 >=0 and edds22=1 amen=2. RECODE wtshap lowbmi fearwt amen (999=SYSMIS). Compute eddsdx=999. If edds1 < 8 eddsdx=0. If bedbing=1 and compen=0 eddsdx=7. If bulbing >=1 and compen >=1 and wtshap>=1 eddsdx=6. If bedbing=2 and compen=0 eddsdx=3. If bulbing =2 and compen=2 and wtshap=2 eddsdx=2. If lowBMI >=1 and amen >=1 eddsdx=5. If lowBMI =2 and amen =2 eddsdx=1. RECODE eddsdx (999=SYSMIS). Compute eddssym=sum.8(edds1 to edds18, edds21).
|
|
try adding a last line
EXECUTE. Did that fix it? The syntax show several bad habits. the worst is not distinguishing sytem missing from user missing. As you learn syntax with SPSS avoid assigning SYSMIS to variables. Leasve tat value for its original purpose, namely, a value in your data when teh machine is unable to follow your instruction. It is a useful flag that your logic as holes in it. Although using "=" as a logical operator is technically correct, you'll confuse yourself less in the future by using it only for assigning values to variables. You and other reading your syntax will b better able If edds5=0 and edds6=0 edds9=0. is written as If edds5 eq 0 and edds6 eq 0 edds9=0. The GUI is a great way to get a first draft of syntax. But inevitably as you learn about analysis, SPSS, and your data you will refine your writing.
Art Kendall
Social Research Consultants |
|
Administrator
|
In reply to this post by Roberts, Alan C.
Simply add an EXECUTE. (at the end) or a procedure to pass the data (FREQUENCIES or any other).
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?" |
|
Thanks! That did it.
________________________________________ From: SPSSX(r) Discussion <[hidden email]> on behalf of David Marso <[hidden email]> Sent: Sunday, February 28, 2016 5:19 PM To: [hidden email] Subject: Re: empty cells Simply add an EXECUTE. (at the end) or a procedure to pass the data (FREQUENCIES or any other). ----- 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?" -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/empty-cells-tp5731626p5731628.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 |
|
Administrator
|
In reply to this post by Art Kendall
I concur.
In addition for easier readability I tend to use ALL CAPS for SPSS commands and operators. If edds5 eq 0 and edds6 eq 0 edds9=0. written as IF (edds5 EQ 0 AND edds6 EQ 0) edds9=0.
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?" |
|
Administrator
|
In reply to this post by Art Kendall
Note also for repetitive codes DO REPEAT is a time/keyboard saver.
RECODE as well in some cases. If edds5=0 and edds6=0 edds9=0. If edds5=0 and edds6=0 edds10=0. If edds5=0 and edds6=0 edds11=0. If edds5=0 and edds6=0 edds12=0. If edds5=0 and edds6=0 edds13=0. If edds5=0 and edds6=0 edds14=0. Rewritten as. DO IF (edds5 EQ 0 AND edds6 EQ 0). DO REPEAT edds=edds9 TO eds14. COMPUTE edds=0. END REPEAT. END IF. Alternatively: NUMERIC edds9 TO edds14. DO IF (edds5 EQ 0 AND edds6 EQ 0). RECODE edds9 TO edds14 (ELSE=0). END IF.
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?" |
|
In reply to this post by David Marso
Yes, but in the Syntax Editor, SPSS colour coding distinguishes commands and
operators, so it doesn't matter whether they are in UPPER or lower case. 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 David Marso Sent: 28 February 2016 23:33 To: [hidden email] Subject: Re: empty cells I concur. In addition for easier readability I tend to use ALL CAPS for SPSS commands and operators. If edds5 eq 0 and edds6 eq 0 edds9=0. written as IF (edds5 EQ 0 AND edds6 EQ 0) edds9=0. Art Kendall wrote > try adding a last line > EXECUTE. > > Did that fix it? > > The syntax show several bad habits. > the worst is not distinguishing sytem missing from user missing. > > As you learn syntax with SPSS avoid assigning SYSMIS to variables. > Leasve tat value for its original purpose, namely, a value in your > data when teh machine is unable to follow your instruction. It is a > useful flag that your logic as holes in it. > > Although using "=" as a logical operator is technically correct, you'll > confuse yourself less in the future by using it only for assigning > values to variables. > You and other reading your syntax will b better able If edds5=0 and > edds6=0 edds9=0. > is written as > If edds5 eq 0 and edds6 eq 0 edds9=0. > > The GUI is a great way to get a first draft of syntax. But inevitably > as you learn about analysis, SPSS, and your data you will refine your > writing. ----- 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?" -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/empty-cells-tp5731626p5731630. 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 |
|
It is true that the syntax editor uses color to make distinctions. A great improvement.
However, in this list (and others) the posted syntax does not use color. Also the syntax in <help> and other documentation does not use color. Pasted snippets to Word or WordPerfect, or logged syntax in output do not preserve color In the mid-80s I suggested auto-indent and it was eventually implemented. I have also suggested making available options for automatic -- conversion of the symbolic operators to conventional operators -- case consistency for COMMANDS, OPERATORS, AND Functions -- detection of different casing for variables. Age AGE age. A later improvement would ask the user which casing was preferred and would repair it throughout the syntax. These would enhance readability for people. I would like to see SPSS clean up its documentation to be consistent with good practice in composing syntax. -------------- For newbies it would help them if there would be a warning when nominal missing and valid values were found that were not labeled, or when variables were not labeled. [I teach that the variables view be complete before running anything.]
Art Kendall
Social Research Consultants |
|
Thanks to everyone. These are helpful comments.
________________________________________ From: SPSSX(r) Discussion <[hidden email]> on behalf of Art Kendall <[hidden email]> Sent: Monday, February 29, 2016 8:47 AM To: [hidden email] Subject: Re: empty cells It is true that the syntax editor uses color to make distinctions. A great improvement. However, in this list (and others) the posted syntax does not use color. Also the syntax in <help> and other documentation does not use color. Pasted snippets to Word or WordPerfect, or logged syntax in output do not preserve color In the mid-80s I suggested auto-indent and it was eventually implemented. I have also suggested making available *options* for automatic -- conversion of the symbolic operators to conventional operators -- case consistency for COMMANDS, OPERATORS, AND Functions -- detection of different casing for variables. Age AGE age. A later improvement would ask the user which casing was preferred and would repair it throughout the syntax. These would enhance readability for people. I would like to see SPSS clean up its documentation to be consistent with good practice in composing syntax. -------------- For newbies it would help them if there would be a warning when nominal missing and valid values were found that were not labeled, or when variables were not labeled. [I teach that the variables view be complete before running anything.] ----- Art Kendall Social Research Consultants -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/empty-cells-tp5731626p5731634.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 |
| Free forum by Nabble | Edit this page |
