Hello everyone,
I need help with the analysis of the data for my thesis. I have imported all the data from an Excel file, but the data were classified as string variables. To run the syntax compute variable, I had to change the variables to numeric variables. So I did that with Automatic Recode and it worked, but when I run the syntax now, it calculates all the labels instead of the actual values. This is the formula COMPUTE trajlength = ABS(X_2  X_1) + ABS(X_3  X_2) + ABS(X_4  X_3) + ABS(X_5  X_4) + ABS(X_6  X_5) + ABS(X_7  X_6) + ABS(X_8  X_7) + ABS(X_9  X_8) + ABS(X_10  X_9) + ABS(X_11  X_10) + ABS(X_12  X_11) + ABS(X_13  X_12) + ABS(X_14  X_13) + ABS(X_15  X_14) + ABS(X_16  X_15) + ABS(X_17  X_16) + ABS(X_18  X_17) + ABS(X_19  X_18) + ABS(X_20  X_19) + ABS(X_21  X_20) + ABS(X_22  X_21) + ABS(X_23  X_22) + ABS(X_24  X_23) + ABS(X_25  X_24) + ABS(X_26  X_25) + ABS(X_27  X_26) + ABS(X_28  X_27) + ABS(X_29  X_28) + ABS(X_30  X_29) + ABS(X_31  X_30) + ABS(X_32  X_31) + ABS(X_33  X_32) + ABS(X_34  X_33) + ABS(X_35  X_34) + ABS(X_36  X_35) + ABS(X_37  X_36) + ABS(X_38  X_37) + ABS(X_39  X_38) + ABS(X_40  X_39) + ABS(X_41  X_40) + ABS(X_42  X_41) + ABS(X_43  X_42) + ABS(X_44  X_43) + ABS(X_45  X_44) + ABS(X_46  X_45) + ABS(X_47  X_46) + ABS(X_48  X_47) + ABS(X_49  X_48) + ABS(X_50  X_49) + ABS(X_51  X_50) + ABS(X_52  X_51) + ABS(X_53  X_52) + ABS(X_54  X_53) + ABS(X_55  X_54) + ABS(X_56  X_55) + ABS(X_57  X_56) + ABS(X_58  X_57) + ABS(X_59  X_58) + ABS(X_60  X_59) + ABS(X_61  X_60) + ABS(X_62  X_61) + ABS(X_63  X_62) + ABS(X_64  X_63) + ABS(X_65  X_64) + ABS(X_66  X_65) + ABS(X_67  X_66) + ABS(X_68  X_67) + ABS(X_69  X_68) + ABS(X_70  X_69) + ABS(X_71  X_70) + ABS(X_72  X_71) + ABS(X_73  X_72) + ABS(X_74  X_73) + ABS(X_75  X_74) + ABS(X_76  X_75) + ABS(X_77  X_76) + ABS(X_78  X_77) + ABS(X_79  X_78) + ABS(X_80  X_79) + ABS(X_81  X_80) + ABS(X_82  X_81) + ABS(X_83  X_82) + ABS(X_84  X_83) + ABS(X_85  X_84) + ABS(X_86  X_85) + ABS(X_87  X_86) + ABS(X_88  X_87) + ABS(X_89  X_88) + ABS(X_90  X_89) + ABS(X_91  X_90) + ABS(X_92  X_91) + ABS(X_93  X_92) + ABS(X_94  X_93) + ABS(X_95  X_94) + ABS(X_96  X_95) + ABS(X_97  X_96) + ABS(X_98  X_97) + ABS(X_99  X_98) + ABS(X_100  X_99) + ABS(X_101  X_100). So for example, the actual data is 0.002 and 0.004 but because of the labels these are numbered 12 and 14. That means that the outcomes under the new variable are not the actual values and these are actually way higher than should be. Is there any way that I can remove these labels or do something else so that the formula calculates the right values?  Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
Hi, try the VALUELABEL function like this:
Good luck, Mario Giesel Munich, Germany
Am Mittwoch, 30. Dezember 2020, 15:05:07 MEZ hat LO2345 <[hidden email]> Folgendes geschrieben:
Hello everyone, I need help with the analysis of the data for my thesis. I have imported all the data from an Excel file, but the data were classified as string variables. To run the syntax compute variable, I had to change the variables to numeric variables. So I did that with Automatic Recode and it worked, but when I run the syntax now, it calculates all the labels instead of the actual values. This is the formula COMPUTE trajlength = ABS(X_2  X_1) + ABS(X_3  X_2) + ABS(X_4  X_3) + ABS(X_5  X_4) + ABS(X_6  X_5) + ABS(X_7  X_6) + ABS(X_8  X_7) + ABS(X_9  X_8) + ABS(X_10  X_9) + ABS(X_11  X_10) + ABS(X_12  X_11) + ABS(X_13  X_12) + ABS(X_14  X_13) + ABS(X_15  X_14) + ABS(X_16  X_15) + ABS(X_17  X_16) + ABS(X_18  X_17) + ABS(X_19  X_18) + ABS(X_20  X_19) + ABS(X_21  X_20) + ABS(X_22  X_21) + ABS(X_23  X_22) + ABS(X_24  X_23) + ABS(X_25  X_24) + ABS(X_26  X_25) + ABS(X_27  X_26) + ABS(X_28  X_27) + ABS(X_29  X_28) + ABS(X_30  X_29) + ABS(X_31  X_30) + ABS(X_32  X_31) + ABS(X_33  X_32) + ABS(X_34  X_33) + ABS(X_35  X_34) + ABS(X_36  X_35) + ABS(X_37  X_36) + ABS(X_38  X_37) + ABS(X_39  X_38) + ABS(X_40  X_39) + ABS(X_41  X_40) + ABS(X_42  X_41) + ABS(X_43  X_42) + ABS(X_44  X_43) + ABS(X_45  X_44) + ABS(X_46  X_45) + ABS(X_47  X_46) + ABS(X_48  X_47) + ABS(X_49  X_48) + ABS(X_50  X_49) + ABS(X_51  X_50) + ABS(X_52  X_51) + ABS(X_53  X_52) + ABS(X_54  X_53) + ABS(X_55  X_54) + ABS(X_56  X_55) + ABS(X_57  X_56) + ABS(X_58  X_57) + ABS(X_59  X_58) + ABS(X_60  X_59) + ABS(X_61  X_60) + ABS(X_62  X_61) + ABS(X_63  X_62) + ABS(X_64  X_63) + ABS(X_65  X_64) + ABS(X_66  X_65) + ABS(X_67  X_66) + ABS(X_68  X_67) + ABS(X_69  X_68) + ABS(X_70  X_69) + ABS(X_71  X_70) + ABS(X_72  X_71) + ABS(X_73  X_72) + ABS(X_74  X_73) + ABS(X_75  X_74) + ABS(X_76  X_75) + ABS(X_77  X_76) + ABS(X_78  X_77) + ABS(X_79  X_78) + ABS(X_80  X_79) + ABS(X_81  X_80) + ABS(X_82  X_81) + ABS(X_83  X_82) + ABS(X_84  X_83) + ABS(X_85  X_84) + ABS(X_86  X_85) + ABS(X_87  X_86) + ABS(X_88  X_87) + ABS(X_89  X_88) + ABS(X_90  X_89) + ABS(X_91  X_90) + ABS(X_92  X_91) + ABS(X_93  X_92) + ABS(X_94  X_93) + ABS(X_95  X_94) + ABS(X_96  X_95) + ABS(X_97  X_96) + ABS(X_98  X_97) + ABS(X_99  X_98) + ABS(X_100  X_99) + ABS(X_101  X_100). So for example, the actual data is 0.002 and 0.004 but because of the labels these are numbered 12 and 14. That means that the outcomes under the new variable are not the actual values and these are actually way higher than should be. Is there any way that I can remove these labels or do something else so that the formula calculates the right values?  ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
In reply to this post by LO2345
I answered this earlier on the IBM Predictive Analytics site. On Wed, Dec 30, 2020 at 7:05 AM LO2345 <[hidden email]> wrote: Hello everyone, 
In reply to this post by LO2345
Make a U turn. AUTORECODE while very useful in some cases is a lethal dead end for you. Before you crash and burn look into the NUMBER function to convert your string values to proper numerical values.
===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
The answer I posted was to just use ALTER TYPE on all those variables  one command. On Wed, Dec 30, 2020 at 7:26 AM David Marso <[hidden email]> wrote: Make a U turn. AUTORECODE while very useful in some cases is a lethal dead end for you. Before you crash and burn look into the NUMBER function to convert your string values to proper numerical values. 
Administrator

And after that one ALTER TYPE command, how about using VECTOR and LOOP in
place of that LONG COMPUTE command? This is not tested, but I think it will work: COMPUTE trajlength = 0. VECTOR X = X_1 to X_101. LOOP # = 1 to 100. COMPUTE trajlength = trajlength + ABS(X(#+1)X(#)). END LOOP. Jon Peck wrote > The answer I posted was to just use ALTER TYPE on all those variables  > one > command. > > On Wed, Dec 30, 2020 at 7:26 AM David Marso < > dmmugaspss@ > > wrote: > >> Make a U turn. AUTORECODE while very useful in some cases is a lethal >> dead >> end for you. Before you crash and burn look into the NUMBER function to >> convert your string values to proper numerical values. >> >> ===================== >> To manage your subscription to SPSSXL, send a message to >> > LISTSERV@.UGA > (not to SPSSXL), with no body text except the >> command. To leave the list, send the command >> SIGNOFF SPSSXL >> For a list of commands to manage subscriptions, send the command >> INFO REFCARD >> > > >  > Jon K Peck > jkpeck@ > > ===================== > To manage your subscription to SPSSXL, send a message to > LISTSERV@.UGA > (not to SPSSXL), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSXL > For a list of commands to manage subscriptions, send the command > INFO REFCARD   Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an email, please use the address shown above.  Sent from: http://spssxdiscussion.1045642.n5.nabble.com/ ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD

Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an email, please use the address shown above. 
The solution I posted elsewhere, after the ALTER TYPE step, has the minor advantage that it is independent of the number of variables. begin program python3. def deltasum(*args): deltas = sum([abs(args[i]  args[i1]) for i in range(1, len(args))]) return deltas end program. spssinc trans result = absdeltas /variables x1 to x101 /formula "deltasum(<>)". On Wed, Dec 30, 2020 at 2:09 PM Bruce Weaver <[hidden email]> wrote: And after that one ALTER TYPE command, how about using VECTOR and LOOP in 
I suppose I might want to look at the sum of the differences.
But if someone asked me to give them that, I would suggest
that they might (also) want to get the sum of the squared
differences, which are automatically positive numbers. Getting
that only entails changing the function, whichever method is used.
Then I would compute the mean of the squared differences, and
take the square root. This "root mean square" is essentially a
standard deviation. Folks are more accustomed to standard deviations
than to absolute deviations. If there is a trend line, having the RMS
puts you in a better position to evaluate it further.

Rich Ulrich
From: SPSSX(r) Discussion <[hidden email]> on behalf of Jon Peck <[hidden email]>
Sent: Wednesday, December 30, 2020 4:16 PM To: [hidden email] <[hidden email]> Subject: Re: Question about compute ABS formula SPSS The solution I posted elsewhere, after the ALTER TYPE step, has the minor advantage that it is independent of the number of variables.
begin program python3. def deltasum(*args): deltas = sum([abs(args[i]  args[i1]) for i in range(1, len(args))]) return deltas end program.
spssinc trans result = absdeltas /variables x1 to x101 /formula "deltasum(<>)". On Wed, Dec 30, 2020 at 2:09 PM Bruce Weaver <[hidden email]> wrote:
And after that one ALTER TYPE command, how about using VECTOR and LOOP in 
Free forum by Nabble  Edit this page 