Hi,
I have a dataset with 25 variables, temporal measures. I want to difference variable pairs for all temporal combinations (e.g., T1 - T2, T1-T3....T24-T25). There are many possible combinations as you can guess. Is there code that I can write in SPSS that will generate these variables for me so that I don't have to go the Transform variable and do each pair individually? Cheers, Sean |
Is this correct? You
want to create 300 new variables, each if which is the
difference between 2 time points?
D01_02, ... D25_25? The actual calculation can be done with two loops. Something like this if you want days (UNTESTED). vector t = t1 to t25. vector DaysDiff (300, f6). compute IndexIntoDaysDiff=1. Loop i = 1 to 24. Loop j = 2 to 25. compute IndexIntoDaysdiff = compute DaysDiff(IndexIntoDaysDiff) = datediff (t(i) - t(j), "days"). compute IndexIntoDaysDiff = IndexIntoDaysDiff +1. end loop. end loop. However, why are you doing this? to you want to pass this as a matrix to some procedure? There may be other ways to reach your goals if you give more detail. Art Kendall Social Research ConsultantsOn 10/17/2013 2:51 PM, SeanSweeney [via SPSSX Discussion] wrote: Hi,
Art Kendall
Social Research Consultants |
Hi Art,
Thanks for the reply. We're doing research where we're attempting to use satellite reflectance to map mycorrhizea gradients. Mycorrhizae are fungi that for symbiotic relationships with particular tree species. They affect the way the tree cycles nutrients and if we can map these gradients it will profoundly improve our models for C estimates. There's not much theory that we have to work from at this point so we're exploring the relationships between band differencing and ratios with in situ measurements of particular mycorrhizae. We've acquired satellite data at 25 points in time. There are 6 bands available with each image (3 visible, 1 Near-IR, and 2 Mid-IR). So, there are many potential independent variables that we'd like to generate so that we can explore correlations with the dependent variable. This is something that is probably easier done in Matlab but I wanted to see if I could generate these in SPSS. Cheers, Sean |
In reply to this post by Art Kendall
Here I'll be a little more specific.
Say I was only interested in the Near-IR Band 4. I have 25 temporal measures of band 4. There are a possible 300 ways I can difference Band 4. For example, T1_B4 - T2_B4, T1_B4 - T3_B4....T24_B4 - T25_B4. I will also want to create ratios. For example, T1_B4/T2_B4, T1B4/T3_B4...T24_B4/T25_B4. |
Administrator
|
If I follow, Art's basic approach will work, but can be simplified a bit, because the 25 temporal measures are not date variables, and you don't want differences in days between date variables: You just want differences between two measures of something. Something like this should do it, then:
vector t = T1_B4 to T25_B4. vector Diff (300). compute IndexIntoDiff=1. Loop i = 1 to 24. Loop j = 2 to 25. compute Diff(IndexIntoDiff) = t(i) - t(j). compute IndexIntoDiff = IndexIntoDiff +1. end loop. end loop. Note that the variables in that first VECTOR command must be consecutive in the file. HTH.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Administrator
|
It may be a tad painful later to know WTH Diff200 is later ;-)
Try this macro which I am sure will likely compel Jon to throw a python snippet into the mix. -- DEFINE MakeSubs (!POS !TOKENS(1) / !POS !TOKENS(1) /!POS !TOKENS(1) ). !LET !Sub="" !DO !temp=2 !TO !2 !LET !Sub=!CONCAT(!Sub,"x") !DOEND !DO !Part1=!1 !TO !LENGTH(!Sub)!LET !sub2="x" !DO !temp=1 !TO !Part1 !LET !sub2=!CONCAT(!SUB2,"x") !DOEND !DO !Part2=!LENGTH(!sub2) !TO !2 COMPUTE !CONCAT(!3,!Part1,"_",!3,!Part2) = !CONCAT(!3,!Part1) - !CONCAT(!3,!Part2) . !DOEND !DOEND !ENDDEFINE. SET MPRINT ON PRINTBACK ON. MakeSubs 1 25 T . EXECUTE.
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 SeanSweeney
You have had a few
responses, but the underlying questions are still not clear.
It may be that you want to do some procedures that have all these computations implicit in the procedure. The matrices can be generated in SPSS using the loop structure. In my example. David can probably even use the MATRIX procedure to do it more efficiently. This could be important if you have many thousands of images. It sounds like you want 6 lower triangle matrices of differences (1 for each band) and 6 lower triangle matrices of ratios. But what are you intending after that? It sound like you have a doubly repeated measure, I.e., there are two factors. The 25 values on the first factor are time points. Are they dates at irregular intervals, or are they at equal intervals and can simply be indexed 1 to 25? The other factor has 6 levels representing the 6 bands. Are the values for bands at equal intervals (so the values are interval level)? Or are the values for band only ordinal? Is it correct to assume that your case (entity) is a particular location? Is it correct to assume that at each of the times for each of the locations You measure 1 or more DVs? Are the DVs measured at the locations 25 times? I.e., they are not just from the image? Are the locations next to each other so that they are another repeated factor? How many images do you have? There are many different meanings for C estimates. How are you using that term? Art Kendall Social Research ConsultantsOn 10/17/2013 4:17 PM, SeanSweeney [via SPSSX Discussion] wrote: Here I'll be a little more specific.
Art Kendall
Social Research Consultants |
In reply to this post by Bruce Weaver
I was testing this using 7 dates of Band 1. So I wanted to difference T1_B1-T2_B1, T1_B1-T3_B1 and so one. There are 21 combinations. I have the bands ordered sequentially in the data file.
I used this code: vector t = T1_B1 to T7_B1. vector Diff (21). compute IndexIntoDiff=1. Loop i = 1 to 6. Loop j = 2 to 7. compute Diff(IndexIntoDiff) = t(i) - t(j). compute IndexIntoDiff = IndexIntoDiff +1. end loop. end loop. It writes the fields into the data file but there are no values. It tell me that the transformations are pending but does nothing. Any suggestions? |
put this on the line
after your last "end loop".
execute. Art Kendall Social Research ConsultantsOn 10/17/2013 5:58 PM, SeanSweeney [via SPSSX Discussion] wrote: I was testing this using 7 dates of Band 1. So I wanted to difference T1_B1-T2_B1, T1_B1-T3_B1 and so one. There are 21 combinations. I have the bands ordered sequentially in the data file.
Art Kendall
Social Research Consultants |
Administrator
|
In reply to this post by SeanSweeney
Add an EXECUTE command! ;-)
But note that David raised a good point about not being able to easily tell which DIFF score goes with which paired difference. If that is important, you might want to try his macro (although it might make your eyes bleed a bit if stare at it for too long). ;-) HTH.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Administrator
|
Aside from bleeding eyeballs, you will need to alter it to support your variable names.
Leaving that as an exercise. If you get stuck then post back with what you have tried and any error messages etc. Hint: pass your band suffix as an additional !POS arg and modify the !CONCAT statements and COMPUTE to properly build the names. --
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
|
Here is a version which will support suffixes in the original variables as well as both subtraction and ratios.
DEFINE MakeSubs (!POS !TOKENS(1) / !POS !TOKENS(1) /!POS !TOKENS(1) /!POS !TOKENS(1) /!POS !TOKENS(1) ). !LET !Sub="" !DO !temp=2 !TO !2 !LET !Sub=!CONCAT(!Sub,"x") !DOEND !DO !Part1=!1 !TO !LENGTH(!Sub)!LET !sub2="x" !DO !temp=1 !TO !Part1 !LET !sub2=!CONCAT(!SUB2,"x") !DOEND !DO !Part2=!LENGTH(!sub2) !TO !2 !IF (!5 !EQ DIFF) !THEN !LET !OPER="-" !IFEND !IF (!5 !EQ DIV) !THEN !LET !OPER= "/" !IFEND COMPUTE !CONCAT(!3,!Part1,"_",!3,!Part2,"_",!4,"_",!5) = !CONCAT(!3,!Part1,"_",!4) !OPER !CONCAT(!3,!Part2,"_",!4) . !DOEND !DOEND !ENDDEFINE. SET MPRINT ON PRINTBACK ON. MakeSubs 1 25 T B4 DIFF. MakeSubs 1 25 T B4 DIV. EXECUTE. example of generated code. COMPUTE T1_T2_B4_DIFF = T1_B4 - T2_B4. ..... COMPUTE T24_T25_B4_DIFF = T24_B4 - T25_B4. COMPUTE T1_T2_B4_DIV = T1_B4 / T2_B4. ..... COMPUTE T24_T25_B4_DIV = T24_B4 / T25_B4.
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?" |
Hi Dave,
It works perfectly! Thanks so much for all the help, to you and all others who contributed to this thread. Cheers, Sean |
Administrator
|
In reply to this post by Art Kendall
"David can probably even use the MATRIX procedure to do it more
efficiently. This could be important if you have many thousands of images. " ** ;-)) DATASET DECLARE "OutX". MATRIX. GET X / FILE * / VARIABLES X01 TO X25. COMPUTE New=MAKE(NROW(X),1,0). LOOP #=1 TO NCOL(X)-1. COMPUTE New={New,X(:,1:(NCOL(X)-#)) - X(:,(#+1):NCOL(X))}. END LOOP. SAVE New(:,2:NCOL(New)) / OUTFILE "OutX" . END MATRIX. *NOTE: This kicks out the columns in order 1-2, 2-3, ...24-25, 1-3, 2-4...23-25 .... 1-25 It might be a PIA to create macro code to generate an appropriate/correct RENAME command ;-(( Any takers to butcher my post from yesterday? Maybe Python code would be less klunky than a macro?
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?" |
Maybe create small
syntax to write out a text file, e.g., varnames.sps?
compute varname = concat("xyz", number(i,n2), "_",number(j,n2)). Art Kendall Social Research ConsultantsOn 10/18/2013 11:26 AM, David Marso [via SPSSX Discussion] wrote: "David can probably even use the MATRIX procedure to do it more
Art Kendall
Social Research Consultants |
In reply to this post by David Marso
Hi David,
I ran into 1 little glitch...normal! On the first pass the macro differences in this order: T1_B1-T2_B1, T1_B1-T3_B1....T1_B1-T25B1 (which is what I want) On the second pass it differences in this order: T2_B1-T2_B1, T2_B1-T3_B1 (so I get values of zero for the first operation of the second pass) What I'd like it to do for the second pass and after is the following: 2nd pass T2_B1-T3_B1, T2_B1-T4_B1...T2_B1-T25_B1 3rd pass T3_B1-T4_B1, T3_B1-T5_B1... so I need incremental increases in the 2nd loop also...any suggestions? |
In reply to this post by David Marso
So, what should be happening is that there are 24 calculations for the first pass:
T1_B1-T2_B1, T1_B1-T3_B1....T1_B1-T25_B1 23 calculations for the second pass: T2_B1-T3_B1, T2_B1-T4_B1.... 22 calculations for the third pass: T3_B1-T4_B1, T3_B1-T5_B1... and so on. This will prevent any duplication in the pairings and reduce the number of variables. Cheers, Sean |
Administrator
|
In reply to this post by SeanSweeney
Here is how it works on a sample 10 variable data set.
Hard to say what you are running since you don't post the exact macro (hopefully exactly what I posted) and the macro call. SET MPRINT ON PRINTBACK ON is useful for debugging macros. As far as I can tell the macro works perfectly and you have somehow screwed around with it. SET MPRINT ON PRINTBACK ON. MakeSubs 1 10 T B1 DIFF. 35 0 M> 36 0 M> . 37 0 M> COMPUTE T1_T2_B1_DIFF = T1_B1 - T2_B1. 38 0 M> COMPUTE T1_T3_B1_DIFF = T1_B1 - T3_B1. 39 0 M> COMPUTE T1_T4_B1_DIFF = T1_B1 - T4_B1. 40 0 M> COMPUTE T1_T5_B1_DIFF = T1_B1 - T5_B1. 41 0 M> COMPUTE T1_T6_B1_DIFF = T1_B1 - T6_B1. 42 0 M> COMPUTE T1_T7_B1_DIFF = T1_B1 - T7_B1. 43 0 M> COMPUTE T1_T8_B1_DIFF = T1_B1 - T8_B1. 44 0 M> COMPUTE T1_T9_B1_DIFF = T1_B1 - T9_B1. 45 0 M> COMPUTE T1_T10_B1_DIFF = T1_B1 - T10_B1. 46 0 M> COMPUTE T2_T3_B1_DIFF = T2_B1 - T3_B1. 47 0 M> COMPUTE T2_T4_B1_DIFF = T2_B1 - T4_B1. 48 0 M> COMPUTE T2_T5_B1_DIFF = T2_B1 - T5_B1. 49 0 M> COMPUTE T2_T6_B1_DIFF = T2_B1 - T6_B1. 50 0 M> COMPUTE T2_T7_B1_DIFF = T2_B1 - T7_B1. 51 0 M> COMPUTE T2_T8_B1_DIFF = T2_B1 - T8_B1. 52 0 M> COMPUTE T2_T9_B1_DIFF = T2_B1 - T9_B1. 53 0 M> COMPUTE T2_T10_B1_DIFF = T2_B1 - T10_B1. 54 0 M> COMPUTE T3_T4_B1_DIFF = T3_B1 - T4_B1. 55 0 M> COMPUTE T3_T5_B1_DIFF = T3_B1 - T5_B1. 56 0 M> COMPUTE T3_T6_B1_DIFF = T3_B1 - T6_B1. 57 0 M> COMPUTE T3_T7_B1_DIFF = T3_B1 - T7_B1. 58 0 M> COMPUTE T3_T8_B1_DIFF = T3_B1 - T8_B1. 59 0 M> COMPUTE T3_T9_B1_DIFF = T3_B1 - T9_B1. 60 0 M> COMPUTE T3_T10_B1_DIFF = T3_B1 - T10_B1. 61 0 M> COMPUTE T4_T5_B1_DIFF = T4_B1 - T5_B1. 62 0 M> COMPUTE T4_T6_B1_DIFF = T4_B1 - T6_B1. 63 0 M> COMPUTE T4_T7_B1_DIFF = T4_B1 - T7_B1. 64 0 M> COMPUTE T4_T8_B1_DIFF = T4_B1 - T8_B1. 65 0 M> COMPUTE T4_T9_B1_DIFF = T4_B1 - T9_B1. 66 0 M> COMPUTE T4_T10_B1_DIFF = T4_B1 - T10_B1. 67 0 M> COMPUTE T5_T6_B1_DIFF = T5_B1 - T6_B1. 68 0 M> COMPUTE T5_T7_B1_DIFF = T5_B1 - T7_B1. 69 0 M> COMPUTE T5_T8_B1_DIFF = T5_B1 - T8_B1. 70 0 M> COMPUTE T5_T9_B1_DIFF = T5_B1 - T9_B1. 71 0 M> COMPUTE T5_T10_B1_DIFF = T5_B1 - T10_B1. 72 0 M> COMPUTE T6_T7_B1_DIFF = T6_B1 - T7_B1. 73 0 M> COMPUTE T6_T8_B1_DIFF = T6_B1 - T8_B1. 74 0 M> COMPUTE T6_T9_B1_DIFF = T6_B1 - T9_B1. 75 0 M> COMPUTE T6_T10_B1_DIFF = T6_B1 - T10_B1. 76 0 M> COMPUTE T7_T8_B1_DIFF = T7_B1 - T8_B1. 77 0 M> COMPUTE T7_T9_B1_DIFF = T7_B1 - T9_B1. 78 0 M> COMPUTE T7_T10_B1_DIFF = T7_B1 - T10_B1. 79 0 M> COMPUTE T8_T9_B1_DIFF = T8_B1 - T9_B1. 80 0 M> COMPUTE T8_T10_B1_DIFF = T8_B1 - T10_B1. 81 0 M> COMPUTE T9_T10_B1_DIFF = T9_B1 - T10_B1.
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?" |
Hi David,
Yes, I did screw around with the code...it's working now. I've been doing intra-band differencing to this point. What if I want to do inter-band differencing as well? Take, for example this simplified dataset: T1 T2 T3 B1 B1 B1 B2 B2 B2 B3 B3 B3 B4 B4 B4 B5 B5 B5 B6 B6 B6 The output I would seek is the following: T1_B1-T2_B1, T1_B1-T3_B1, T1_B1-T1_B2, T1_B1-T2_B2, T1_B1-T3_B2, T1_B1-T1_B3, T1_B1-T2_B3....T1_B1-T3_B6 I know you've probably grown weary with this but any suggestions on how I might modify the code? Thanks for all help. Cheers, Sean ________________________________________ From: David Marso [via SPSSX Discussion] [[hidden email]] Sent: Friday, October 18, 2013 1:29 PM To: Sweeney, Sean P. Subject: Re: Automatically genrate new variables Here is how it works on a sample 10 variable data set. Hard to say what you are running since you don't post the exact macro (hopefully exactly what I posted) and the macro call. SET MPRINT ON PRINTBACK ON is useful for debugging macros. As far as I can tell the macro works perfectly and you have somehow screwed around with it. SET MPRINT ON PRINTBACK ON. MakeSubs 1 10 T B1 DIFF. 35 0 M> 36 0 M> . 37 0 M> COMPUTE T1_T2_B1_DIFF = T1_B1 - T2_B1. 38 0 M> COMPUTE T1_T3_B1_DIFF = T1_B1 - T3_B1. 39 0 M> COMPUTE T1_T4_B1_DIFF = T1_B1 - T4_B1. 40 0 M> COMPUTE T1_T5_B1_DIFF = T1_B1 - T5_B1. 41 0 M> COMPUTE T1_T6_B1_DIFF = T1_B1 - T6_B1. 42 0 M> COMPUTE T1_T7_B1_DIFF = T1_B1 - T7_B1. 43 0 M> COMPUTE T1_T8_B1_DIFF = T1_B1 - T8_B1. 44 0 M> COMPUTE T1_T9_B1_DIFF = T1_B1 - T9_B1. 45 0 M> COMPUTE T1_T10_B1_DIFF = T1_B1 - T10_B1. 46 0 M> COMPUTE T2_T3_B1_DIFF = T2_B1 - T3_B1. 47 0 M> COMPUTE T2_T4_B1_DIFF = T2_B1 - T4_B1. 48 0 M> COMPUTE T2_T5_B1_DIFF = T2_B1 - T5_B1. 49 0 M> COMPUTE T2_T6_B1_DIFF = T2_B1 - T6_B1. 50 0 M> COMPUTE T2_T7_B1_DIFF = T2_B1 - T7_B1. 51 0 M> COMPUTE T2_T8_B1_DIFF = T2_B1 - T8_B1. 52 0 M> COMPUTE T2_T9_B1_DIFF = T2_B1 - T9_B1. 53 0 M> COMPUTE T2_T10_B1_DIFF = T2_B1 - T10_B1. 54 0 M> COMPUTE T3_T4_B1_DIFF = T3_B1 - T4_B1. 55 0 M> COMPUTE T3_T5_B1_DIFF = T3_B1 - T5_B1. 56 0 M> COMPUTE T3_T6_B1_DIFF = T3_B1 - T6_B1. 57 0 M> COMPUTE T3_T7_B1_DIFF = T3_B1 - T7_B1. 58 0 M> COMPUTE T3_T8_B1_DIFF = T3_B1 - T8_B1. 59 0 M> COMPUTE T3_T9_B1_DIFF = T3_B1 - T9_B1. 60 0 M> COMPUTE T3_T10_B1_DIFF = T3_B1 - T10_B1. 61 0 M> COMPUTE T4_T5_B1_DIFF = T4_B1 - T5_B1. 62 0 M> COMPUTE T4_T6_B1_DIFF = T4_B1 - T6_B1. 63 0 M> COMPUTE T4_T7_B1_DIFF = T4_B1 - T7_B1. 64 0 M> COMPUTE T4_T8_B1_DIFF = T4_B1 - T8_B1. 65 0 M> COMPUTE T4_T9_B1_DIFF = T4_B1 - T9_B1. 66 0 M> COMPUTE T4_T10_B1_DIFF = T4_B1 - T10_B1. 67 0 M> COMPUTE T5_T6_B1_DIFF = T5_B1 - T6_B1. 68 0 M> COMPUTE T5_T7_B1_DIFF = T5_B1 - T7_B1. 69 0 M> COMPUTE T5_T8_B1_DIFF = T5_B1 - T8_B1. 70 0 M> COMPUTE T5_T9_B1_DIFF = T5_B1 - T9_B1. 71 0 M> COMPUTE T5_T10_B1_DIFF = T5_B1 - T10_B1. 72 0 M> COMPUTE T6_T7_B1_DIFF = T6_B1 - T7_B1. 73 0 M> COMPUTE T6_T8_B1_DIFF = T6_B1 - T8_B1. 74 0 M> COMPUTE T6_T9_B1_DIFF = T6_B1 - T9_B1. 75 0 M> COMPUTE T6_T10_B1_DIFF = T6_B1 - T10_B1. 76 0 M> COMPUTE T7_T8_B1_DIFF = T7_B1 - T8_B1. 77 0 M> COMPUTE T7_T9_B1_DIFF = T7_B1 - T9_B1. 78 0 M> COMPUTE T7_T10_B1_DIFF = T7_B1 - T10_B1. 79 0 M> COMPUTE T8_T9_B1_DIFF = T8_B1 - T9_B1. 80 0 M> COMPUTE T8_T10_B1_DIFF = T8_B1 - T10_B1. 81 0 M> COMPUTE T9_T10_B1_DIFF = T9_B1 - T10_B1. SeanSweeney wrote Hi David, I ran into 1 little glitch...normal! On the first pass the macro differences in this order: T1_B1-T2_B1, T1_B1-T3_B1....T1_B1-T25B1 (which is what I want) On the second pass it differences in this order: T2_B1-T2_B1, T2_B1-T3_B1 (so I get values of zero for the first operation of the second pass) What I'd like it to do for the second pass and after is the following: 2nd pass T2_B1-T3_B1, T2_B1-T4_B1...T2_B1-T25_B1 3rd pass T3_B1-T4_B1, T3_B1-T5_B1... so I need incremental increases in the 2nd loop also...any suggestions? 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?" ________________________________ If you reply to this email, your message will be added to the discussion below: http://spssx-discussion.1045642.n5.nabble.com/Automatically-genrate-new-variables-tp5722599p5722621.html To unsubscribe from Automatically genrate new variables, click here< NAML<http://spssx-discussion.1045642.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> |
Administrator
|
This post was updated on .
Actually !HEAD/!TAIL parsing is not reqired.
Here is a hint: DEFINE TriangleFromList (List !CMDEND ). !DO !B1 !IN (!List) !DO !B2 !IN (!List) !IF (!B1 !LE !B2) !THEN ECHO !QUOTE(!CONCAT(!B1,"_",!B2)). !IFEND !DOEND !DOEND !ENDDEFINE. TriangleFromList List=B1 B2 B3. 146 0 M> 147 0 M> . 148 0 M> ECHO 'B1_B1'. B1_B1 149 0 M> ECHO 'B1_B2'. B1_B2 150 0 M> ECHO 'B1_B3'. B1_B3 151 0 M> ECHO 'B2_B2'. B2_B2 152 0 M> ECHO 'B2_B3'. B2_B3 153 0 M> ECHO 'B3_B3'. B3_B3 Add two more !DO !DOEND blocks traversing a list B1 B2 B3 etc One on the !HEAD of the list, the second on the !TAIL of the list. Beyond that, I do offer consulting and training. ----
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?" |
Free forum by Nabble | Edit this page |