This post was updated on .
check1.sav
check_1_syntax.sps Hi, I am having trouble with computing scale in SPSS 17 by using following compute command COMPUTE check1=RND(MEAN.3(S1,S2,S3,S4, S5) * 5) . EXECUTE . Here is a sample copy of the data set I am using. It consist of only 5 variables and six respondents. The obtained after using the above mentioned compute command are also presented. (original SPSS sample file and syntax are also attached with the message. S1 S2 S3 S4 S5 Check1 0.00 99.00 2.00 2.00 2.00 8.00 2.00 2.00 0.00 1.00 1.00 6.00 99.00 0.00 1.00 2.00 2.00 6.00 1.00 2.00 99.00 2.00 2.00 9.00 0.00 1.00 99.00 1.00 1.00 4.00 1.00 2.00 99.00 1.00 1.00 6.00 Here 0=no, 1=yes, 2= yes twice, 99=missing If you see the first row in check 1 column the answer is written 8 although it should have been 6. The anomaly between manually calculations and calculations done by using above compute command only occurs when there is a missing value in the data. I have 100% sure I have correctly specified user missing values (99) in variable data view and other things. I have even tried recording user missing value as system missing values. I have been burning my brain over it but cannot figure it out. please guide. Thanks. |
Administrator
|
Why do you think it should be 6 rather than 8?
My math results in 8! 6/4=1.5 1.5 * 5=7.5 Rnd(7.5)=8!!!
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 sabahat
this syntax
data list list / produced
Art Kendall Social Research Consultants On 6/7/2012 5:51 AM, sabahat wrote: ===================== 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 REFCARDCOMPUTE check1=RND(MEAN.3(S1,S2,S3,S4, S5) * 5) .
Art Kendall
Social Research Consultants |
In reply to this post by sabahat
here is a demo that what you are doing is
substituting means for missing data.
You might not want to round the plugged score. this syntax. data list list / produces this output.
Art Kendall Social Research Consultants On 6/7/2012 5:51 AM, sabahat wrote: ===================== 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 REFCARDHi, I am having trouble with computing scale in SPSS by using following compute command COMPUTE check1=RND(MEAN.3(S1,S2,S3,S4, S5) * 5) . EXECUTE . Here is a sample copy of the data set I am using. It consist of only 5 variables and six respondents. The obtained after using the above mentioned compute command are also presented. (original SPSS sample file and syntax are also attached with the message. S1 S2 S3 S4 S5 Check1 0.00 99.00 2.00 2.00 2.00 8.00 2.00 2.00 0.00 1.00 1.00 6.00 99.00 0.00 1.00 2.00 2.00 6.00 1.00 2.00 99.00 2.00 2.00 9.00 0.00 1.00 99.00 1.00 1.00 4.00 1.00 2.00 99.00 1.00 1.00 6.00 Here 0=no, 1=yes, 2= yes twice, 99=missing If you see the first row in check 1 column the answer is written 8 although it should have been 6. The anomaly between manually calculations and calculations done by using above compute command only occurs when there is a missing value in the data. I have 100% sure I have correctly specified user missing values (99) in variable data view and other things. I have even tried recording user missing value as system missing values. I have been burning my brain over it but cannot figure it out. please guide. Thanks. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Incorrect-scale-by-using-compute-command-obtained-tp5713553.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
Art Kendall
Social Research Consultants |
Free forum by Nabble | Edit this page |