I would like simply to copy the reciprocal of a set of variable into another set of variables like that: COMPUTE bOdd1_WIN_p.1 = 1/ bOdd1_WIN.1 . COMPUTE bOdd1_WIN_p.2 = 1/ bOdd1_WIN.2 . COMPUTE bOdd1_WIN_p.3 = 1/ bOdd1_WIN.3 . COMPUTE bOdd1_WIN_p.4 = 1/ bOdd1_WIN.4 . COMPUTE bOdd1_WIN_p.5 = 1/ bOdd1_WIN.5 . but this won't work: VECTOR bOdd1_WIN_p.(48). DO REPEAT #i = 1 to 48. COMPUTE bOdd1_WIN_p.(#i) = 1/bOdd1_WIN.(#i). END REPEAT. EXECUTE.
Dr. Frank Gaeth
|
it
seems you need to have two lists of variables either 2 vectors or 2 list
in do repeat.
try this untested approach do repeat newvar = bOdd1_WIN_p.1 to bOdd1_WIN_p.48/ oldvar = bOdd1_WIN.1 to bOdd1_WIN.48. compute newvar= 1/oldvar. end repeat. Art Kendall Social Research ConsultantsOn 4/25/2013 8:17 AM, drfg2008 [via SPSSX Discussion] wrote:
Art Kendall
Social Research Consultants |
In reply to this post by drfg2008
It works for me as long as you define the "bOdd1_WIN.(#i)" vector.
VECTOR bOdd1_WIN_p.(48). VECTOR bOdd1_WIN. = bOdd1_WIN.1 to bOdd1_WIN.48. DO REPEAT #i = 1 to 48. COMPUTE bOdd1_WIN_p.(#i) = 1/bOdd1_WIN.(#i). END REPEAT. EXECUTE. You have quite the way with variable names. *******************************************************. *complete example. data list free / id. begin data 1 2 3 4 5 end data. vector bOdd1_WIN.(48). loop #i = 1 to 48. compute bOdd1_WIN.(#i) = RV.UNIFORM(1,5). end loop. exe. *Old Code. VECTOR bOdd1_WIN_p.(48). DO REPEAT #i = 1 to 48. COMPUTE bOdd1_WIN_p.(#i) = 1/bOdd1_WIN.(#i). END REPEAT. EXECUTE. *This does not work since "bOdd1_WIN.(#i)" vector is not defined. *Old code works if you define that vector. match files file = * /drop bOdd1_WIN_p.1 to bOdd1_WIN_p.48. exe. *Updated Code. VECTOR bOdd1_WIN_p.(48). VECTOR bOdd1_WIN. = bOdd1_WIN.1 to bOdd1_WIN.48. DO REPEAT #i = 1 to 48. COMPUTE bOdd1_WIN_p.(#i) = 1/bOdd1_WIN.(#i). END REPEAT. EXECUTE. ********************************************************. |
Thanks, I forgot the second vector command:
VECTOR bOdd1_WIN. = bOdd1_WIN.1 to bOdd1_WIN.48. now it works. Frank
Dr. Frank Gaeth
|
Administrator
|
This post was updated on .
Edited: Changes in BOLD.
If the numbers are all non zero then you can nuke the very small fudge factor and remove the recode. If you have negative values *AND* 0's) then you will need to modify the recode (I'm sure you can sort that). The FORMAT and VARIABLE WIDTH are simply for visual confirmation. DATA LIST / X1 TO X40 1-40. BEGIN DATA 1616313136163163163615616316731673516351 7363137130003115235553123153163131310130 END DATA. MATRIX. GET X / VARIABLES X1 TO X40. SAVE (1/(X+.00000000000000000000000001)) / OUTFILE *. END MATRIX. RECODE ALL (1.000001 THRU HI=SYSMIS). FORMATS ALL (F20.16). VARIABLE WIDTH ALL (20).
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?" |
At 09:43 AM 4/25/2013, David Marso wrote:
>If the numbers are all positive then you can nuke the very small fudge factor >and remove the recode. >If you have negative values then you will need to modify the recode (I'm >sure you can sort that). >RECODE ALL (1.000001 THRU HI=SYSMIS). I think a cleaner way to do this RECODE, sidestepping having to choose a fudge factor, is RECODE ALL (LO THRU 1.0 = COPY) (ELSE = SYSMIS). But actually, I think the dividing-by-zero problem is a strong reason to do the computation in a transformation program, rather than MATRIX. ===================== 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
|
Thank You for that Richard,
I like your mop up much better than mine. using the Transformation program one would: DO REPEAT v= list1 / w=list2. DO IF (v NE 0). COMPUTE w=1/v. END IF. END REPEAT. --- I suppose my MATRIX hack is a little unorthodox but by choosing an INFINITESIMAL term to add to the vector I don't need to explicitly check and it comes back into SPSS with a fudge factor which can not be detected in the precision available to the main system. AND it SLAMS it all through with one line of clever code. MATRIX is a cranked up energizer bunny when it comes down to performance!!! It truly excels at vector based operations but is a little slow with item by item looping. Now, I have no idea how MATRIX can represent such very small values and avoid the zero divide infinity. But, AFAICT it works like a charm. The only mop up required are the HUGE lingering values which require a RECODE or other technique to remove. If there is a downside to this I would be most interested in your analysis and counterexamples.
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 Richard Ristow
OOPS! sysmis on right side of
assignment operator.
RECODE ALL (LO THRU 1.0 = COPY) (ELSE -999 = ). missing values all (-999). Art Kendall Social Research ConsultantsOn 4/25/2013 12:15 PM, Richard Ristow [via SPSSX Discussion] wrote: At 09:43 AM 4/25/2013, David Marso wrote:
Art Kendall
Social Research Consultants |
Administrator
|
In principle I agree with the sysmis on right side for the most part.
However in this case it is a direct correlate to the notion that the SYSTEM could NOT carry out some operation namely an attempted division by 0 (which would indeed end up as SYSMIS in normal calculations after spewing a host of warning messages. Protecting the division with DO IF will render the same result. So, my using SYSMIS in this case is deliberate and significant in reflecting the inability of the system to caary out the computation. -- In MATRIX such an misadventure results in a fatal untrappable error and SPSS takes its ball and goes home (end of game), leading to unhappy emails and or phone calls. My shameless hack attempts to capitalize on the cranked up energizer bunny properties of MATRIX vector efficiency while gracefully avoiding division by 0. It is crucial to mop up afterwards internally to avoid ludicrous results but it is easier than protecting EVERY DIVISION in MATRIX with the following awkward monstrosity. DO IF (zero_check_matrix). COMPUTE newarray = oldarray / value. ELSE. COMPUTE newarray=MAKE(NROW(oldarray),NCOL(oldArray),0). LOOP #=1 TO NROW(oldarray). LOOP ##=1 TO NCOL(oldArray). COMPUTE newarray(#,##)=oldarray(#,##)/value. END LOOP. END LOOP. END IF. This also ends up being a PITA because one must take great care to treat the resulting 0 appropriately in subsequent calculations. In the HACK mode one can test for HUGE values which are distinguishable from 0's which can legitimately arise from 0 numerators . Yeah, there are trade offs, and I am nowhere near solving every weird thing that can crop up in complex situations. But, I do stand by my using SYSMIS for this situation ;-) --
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?" |
I admit it is a soapbox
topic.
You surely are not a beginner and despite having used SPSS since 1972 I still learn from your posts. However, people who follow the list or search the archives are at least to some degree learners. To aid debugging and for quality assurance review I try to have people catch all instances of sysmis, redraft the syntax, and provide for that condition in the transformations. Then assign a missing value that can be labelled. Redrafting would not be finished until all sysmis had been changed to to user missing with value labels for example in this instance I would put value labels varlist -999 'missing to avoid dividing by zero' . Art Kendall Social Research ConsultantsOn 4/25/2013 1:47 PM, David Marso [via SPSSX Discussion] wrote: In principle I agree with the sysmis on right side for the most part.
Art Kendall
Social Research Consultants |
Administrator
|
Art,
What is your concept of SYSMIS and do you think it should ever remain in a data file? Isn't the very essence of system missing an entity that cannot be assigned a value by the 'system'? I would consider division by zero as a candidate for treatment as SYSTEM MISSING rather than USER MISSING. Interesting, you have been using SPSS 11 years longer than I have (1983). However, I did spend 11 years working at SPSS in the trenches (6 doing teksport,5 as a Full time Consultant)- Teksport was existence in the belly of the beast-answering all sorts of 'exotic questions' (Macro, INPUT PROGRAM, MATRIX etc -yeah, all the weirdness that nobody else wanted to touch with a 10 foot pole- ). In the early days of my taking on the 'exotic' I probably learned more from the users calling in than they learned from me. My very first exposure to macro was someone trying to do: !LET !arg2=!arg1 + 1. Well, that had me baffled. Well it is beyond obvious now, but believe it or not, once upon a time I was a rank newbie too. I didn't pop out of my mother with a full blown SPSS manual in my brain ;-) There was even a special folder in the support database called "Marso Madness". I wanted to call it "Doing Unnatural Acts with SPSS" but that got vetoed ;-). I LEARNED what I know today by being exposed to all the weird things 'weird' people try to do with SPSS for 6 years, 8 hours a day. I seriously doubt that support will even consider answering those sorts of questions any more. Maybe I'll call them for the heck of it and screw with their minds with some easy but actual 'how do I do this' question. and see how long it takes them to refer me to the consulting department ;-)))
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?" |
Much of my time has
been spent on providing just-in-time help of stat methods, and
SPSS.
I developed a lot of my soapboxes by seeing how people were shooting themselves in the foot. My use of SYSMIS is this. There is a value for a variable such as the system was unable to follow my instructions. I use the occurrence of a SYSMIS value as a clue in going back to find out what was wrong with my instructions (syntax). (Over the years I have come to believe that it is almost always the instructions that are to blame.). I then go back and change the instruction so that they provide for the special cases that caused the original SYSMIS. Hence, in this instance value labels varlist -999 'missing to avoid dividing by zero' . in public policy issues and program evaluation it is very common to do what in auditing is called "referencing" . This is a process where another person goes over the whole data gathering, transformation, and analysis, to check that the statements made are consistent with what was done. I would not want legislation or a court case to rely on my statements unless I exercised due diligence. In addition to redrafting the syntax to provide for the special cases, I also redraft syntax to include comments that explain why there are warnings. These go along with my soapbox about readability. Except for my first few years of using computers, by 1974 or so, I came to value human factors criteria, such as readability of syntax and listings, over machine efficiency. YMMV but I find it much more saving of my time in the long run to use syntax that explains what is going on. BTW even when I am the only one who is going to see the syntax, emphasizing readability also helps me when I am inevitably interrupted during an analysis. Even a short effort such as replying to a post on this list may be subject to phone calls, calls of nature, meals, etc. Foe example, I had two phone calls from my physicians while responding to this post. I also have a soapbox about about carefully differentiating the different kinds of user missing values including things like 'missing to avoid dividing by zero' . I find this very useful in the reasoning that the statistics are in support of. But that is another story. Art Kendall Social Research ConsultantsOn 4/26/2013 10:03 AM, David Marso [via SPSSX Discussion] wrote: Art,
Art Kendall
Social Research Consultants |
In reply to this post by David Marso
At 12:32 PM 4/25/2013, David Marso wrote:
>I suppose my MATRIX hack is a little unorthodox but by choosing an >INFINITESIMAL term to add to the vector I don't need to explicitly >check and it comes back into SPSS with a fudge factor which can not >be detected in the precision available to the main system. >Now, I have no idea how MATRIX can represent such very small values >and avoid the zero divide infinity. I've seen nothing explicit, but I assume MATRIX uses the same number representation as the main system: 64-bit binary floating, per IEEE standard 754; with 53-bit precision. ===================== 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 guess I would revise the value label and make it even more explicit and diagnostic.
Again, The system could not carry out the projected game plan -> SYSMIS . But, upon further reflection, I guess the User Missing has an upside since 1. You can't assign a VALUE LABEL to sysmis ;-( 2. The variable could be system missing for reasons other than a zero divide attempt. I think I shall do some code revision ;-) VALUE LABELS varlist -999 'Trapped math error: Attempted Division by 0 : Inspect (varlist) involved in denominator' -888 'Unable to evaluate formula: Missing numerator :Inspect (varlist) involved in numerator '. -777 'Some other things got screwed up'. Good Catch Art. --
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 Richard Ristow
True. Which gives you 10**+/-308
or so as the range of floating point numbers.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Richard Ristow <[hidden email]> To: [hidden email], Date: 04/26/2013 11:38 AM Subject: Re: [SPSSX-L] do repeat Sent by: "SPSSX(r) Discussion" <[hidden email]> At 12:32 PM 4/25/2013, David Marso wrote: >I suppose my MATRIX hack is a little unorthodox but by choosing an >INFINITESIMAL term to add to the vector I don't need to explicitly >check and it comes back into SPSS with a fudge factor which can not >be detected in the precision available to the main system. >Now, I have no idea how MATRIX can represent such very small values >and avoid the zero divide infinity. I've seen nothing explicit, but I assume MATRIX uses the same number representation as the main system: 64-bit binary floating, per IEEE standard 754; with 53-bit precision. ===================== 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 |
In reply to this post by David Marso
Great!
-777 is very much like how I end DO IF blocks else. Print / 'OOPS should not have arrived here'. compute result = -777 end if. remember just because I am paranoid does not mean the computer is not trying to mess me up. Art Kendall Social Research ConsultantsOn 4/26/2013 1:54 PM, David Marso [via SPSSX Discussion] wrote: I guess I would revise the value label and make it even more explicit and diagnostic.
Art Kendall
Social Research Consultants |
Administrator
|
Well, I guess it's difficult to account for every possibility.
I would probably use -666 rather than -777 or can we think of something worse. -666 'SPSS has conjured an imaginary number: We have exited the Euclidean plane' Re Paranoia and computers. I had been diligently working on my code for over 2 hrs yesterday (without saving -yeah, big mistake-). Had my fingers poised over the Ctrl and the S key when all of a sudden Windows just went blue screen on me. TOTAL system crash! Lost some very focused difficult documentation and error handling work. I'll bet the neighbors next door (if they were home) were wondering WTF? Didn't know we have a sailor living next door. (CIT):Computer Induced Tourette's? I'm looking for the cure (good thing for everyone I don't work in a cube farm).
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?" |
Write your code in Word with the autosave interval at 1 min. That will keep the neighbours of your back ;-)
Op 26 apr. 2013 om 21:14 heeft "David Marso" <[hidden email]> het volgende geschreven: > Well, I guess it's difficult to account for every possibility. > I would probably use -666 rather than -777 or can we think of something > worse. > -666 'SPSS has conjured an imaginary number: We have exited the Euclidean > plane' > > Re Paranoia and computers. > I had been diligently working on my code for over 2 hrs yesterday (without > saving -yeah, big mistake-). > Had my fingers poised over the Ctrl and the S key when all of a sudden > Windows just went blue screen on me. TOTAL system crash! Lost some very > focused difficult documentation and error handling work. > I'll bet the neighbors next door (if they were home) were wondering WTF? > Didn't know we have a sailor living next door. > (CIT):Computer Induced Tourette's? > I'm looking for the cure (good thing for everyone I don't work in a cube > farm). > > > Art Kendall wrote >> Great! >> >> -777 is very much like >> how I end DO IF blocks >> else. >> Print / 'OOPS should not have >> arrived here'. >> compute result = -777 >> end if. >> >> remember just because I am paranoid does not mean >> the >> computer is not trying to mess me up. >> >> Art Kendall >> Social Research Consultants >> On 4/26/2013 1:54 PM, David Marso [via SPSSX Discussion] wrote: >> >> I guess I would revise the value label and make it >> even more explicit and diagnostic. >> >> >> Again, The system could not carry out the projected game plan >> -> SYSMIS . >> >> But, upon further reflection, I guess the User Missing has an >> upside since >> 1. You can't assign a VALUE LABEL to sysmis ;-( >> >> 2. The variable could be system missing for reasons other than a >> zero divide attempt. >> >> >> I think I shall do some code revision ;-) >> >> >> VALUE LABELS varlist >> -999 'Trapped math error: Attempted Division by 0 : >> Inspect >> (varlist) involved in denominator' >> >> -888 'Unable to evaluate formula: Missing >> numerator :Inspect >> (varlist) involved in numerator '. >> >> -777 'Some other things got screwed up'. >> >> Good Catch Art. >> >> >> -- >> >> >> >> Art >> Kendall wrote >> Much of my time >> has >> >> been spent on providing >> just-in-time help of stat >> methods, and >> >> SPSS. >> I developed a lot of my soapboxes >> by seeing how >> >> people were shooting >> themselves in the foot. >> >> My use of SYSMIS is this. >> There is a value for a variable such as >> the system was >> unable to >> >> follow my instructions. >> I use the occurrence of a SYSMIS value as >> a clue in >> going back to >> >> find out what was wrong with my >> instructions (syntax). >> >> (Over the years I have come to believe >> that it is >> almost always >> >> the instructions that are to blame.). >> I then go back and change the instruction >> so that they >> provide for >> >> the special cases that caused the >> original SYSMIS. >> Hence, in this instance >> value labels varlist -999 >> 'missing to >> >> avoid dividing by >> zero' . >> >> in public policy issues and program >> evaluation it is >> very common >> >> to do what in auditing is called >> "referencing" . This >> is a >> >> process where another person goes >> over the whole data >> gathering, >> >> transformation, and analysis, to check >> that the >> statements made >> >> are consistent with what was done. >> I would not want >> legislation >> >> or a court case to rely on my >> statements unless I >> exercised due >> >> diligence. >> >> In addition to redrafting the syntax to >> provide for >> the special >> >> cases, I also redraft syntax to include >> comments that >> explain why >> >> there are warnings. >> >> These go along with my soapbox about >> readability. >> Except for my >> >> first few years of using computers, by >> 1974 or so, I >> came to value >> >> human factors criteria, such as >> readability of syntax >> and >> >> listings, over machine efficiency. YMMV >> but I find it >> much more >> >> saving of my time in the long run to use >> syntax that >> explains what >> >> is going on. >> >> BTW even when I am the only one who is >> going to see >> the syntax, >> >> emphasizing readability also helps me >> when I am >> inevitably >> >> interrupted during an analysis. >> Even a short effort >> such as >> >> replying to a post on this list may be >> subject to >> phone calls, >> >> calls of nature, meals, etc. Foe >> example, I had two >> phone calls >> >> from my physicians while responding >> to this post. >> >> I also have a soapbox about about >> carefully >> differentiating the >> >> different kinds of user missing values >> including >> things like >> >> 'missing to avoid dividing by >> zero' . I find this >> very useful >> >> in the reasoning that the statistics are >> in support >> of. But that >> >> is another story. >> >> Art Kendall >> >> Social Research Consultants >> On 4/26/2013 10:03 AM, David Marso [via >> SPSSX >> Discussion] wrote: >> >> Art, >> >> >> What is your concept of SYSMIS and >> do you think it >> should ever >> >> remain in a data file? >> >> >> Isn't the very essence of system missing >> an entity >> that cannot be >> >> assigned a value by the 'system'? >> >> >> I would consider division by zero as a >> candidate for >> treatment as >> >> SYSTEM MISSING rather than USER MISSING. >> >> >> >> Interesting, you have been using SPSS 11 >> years longer >> than I have >> >> (1983). >> >> >> >> However, I did spend 11 years working at >> SPSS in the >> trenches (6 >> >> doing teksport,5 as a Full time >> Consultant)- Teksport >> was >> >> existence in the belly of the >> beast-answering all >> sorts of 'exotic >> >> questions' (Macro, INPUT PROGRAM, MATRIX >> etc -yeah, >> all the >> >> weirdness that nobody else wanted to >> touch with a 10 >> foot pole- >> >> ). >> >> >> >> In the early days of my taking on the >> 'exotic' I >> probably learned >> >> more from the users calling in than they >> learned from >> me. My very >> >> first exposure to macro was someone >> trying to do: >> >> >> !LET !arg2=!arg1 + 1. >> >> >> Well, that had me baffled. Well it >> is beyond obvious >> now, but >> >> believe it or not, once upon a time I was >> a rank >> newbie too. >> >> >> I didn't pop out of my mother with a full >> blown SPSS >> manual in my >> >> brain ;-) >> >> >> >> There was even a special folder in the >> support >> database called >> >> "Marso Madness". I wanted to call >> it "Doing Unnatural >> Acts with >> >> SPSS" but that got vetoed ;-). >> >> >> >> I LEARNED what I know today by being >> exposed to all >> the weird >> >> things 'weird' people try to do with SPSS >> for 6 years, >> 8 hours a >> >> day. >> >> >> >> I seriously doubt that support will even >> consider >> answering those >> >> sorts of questions any more. Maybe >> I'll call them for >> the heck of >> >> it and screw with their minds with some >> easy but >> actual 'how do I >> >> do this' question. and see how long it >> takes them to >> refer me to >> >> the consulting department ;-))) >> >> >> >> >> >> Art >> >> Kendall wrote >> I admit it is a >> >> soapbox >> >> >> >> topic. >> >> >> You surely are not a beginner and despite >> having used >> >> SPSS since >> >> >> >> >> 1972 I still learn >> from your >> >> posts. >> >> >> >> >> However, people who >> follow the >> >> >> >> >> list or search the >> archives >> >> are at least >> >> >> >> >> to some degree >> learners. >> >> >> >> >> >> To aid debugging and >> for >> >> >> >> quality assurance review >> I >> try to have >> >> people catch >> >> >> >> all instances of sysmis, >> redraft the >> >> syntax, and >> >> >> >> provide for that >> condition >> in the >> >> >> transformations. >> >> >> >> Then assign a missing >> value >> that can >> >> >> >> be labelled. >> >> Redrafting would >> not be >> finished >> >> >> >> until all >> sysmis >> >> >> >> >> had been changed to >> to user >> >> missing with >> >> >> >> >> value labels >> >> for example in >> this >> instance I would >> >> put >> >> value labels varlist -999 >> >> >> >> >> 'missing to avoid >> >> >> >> >> dividing by >> zero' . >> >> >> >> >> >> >> >> Art Kendall >> >> >> Social Research >> Consultants >> >> On 4/25/2013 1:47 PM, David Marso [via >> SPSSX >> >> Discussion] wrote: >> >> >> In principle I agree with the sysmis on >> right side >> >> >> >> for the most part. >> >> >> >> >> However in this case it is a direct >> correlate to the >> >> notion that >> >> >> >> the SYSTEM could NOT carry out some >> operation namely >> >> an attempted >> >> >> >> division by 0 (which would indeed end up >> as SYSMIS in >> >> normal >> >> >> >> calculations after spewing a host of >> warning messages. >> >> Protecting >> >> >> >> the division with DO IF will render the >> same result. >> >> So, my using >> >> >> >> SYSMIS in this case is deliberate and >> significant in >> >> reflecting >> >> >> >> the inability of the system to caary out >> the >> >> computation. >> >> >> >> >> -- >> >> In MATRIX such an misadventure results in >> a fatal >> >> untrappable >> >> >> >> error and SPSS takes its ball and goes >> home (end of >> >> game), leading >> >> >> >> to unhappy emails and or phone calls. >> >> >> >> >> >> My shameless hack attempts to capitalize >> on the >> >> cranked up >> >> >> >> energizer bunny properties of MATRIX >> vector efficiency >> >> while >> >> >> >> gracefully avoiding division by 0. It is >> crucial to >> >> mop up >> >> >> >> afterwards internally to avoid ludicrous >> results but >> >> it is easier >> >> >> >> than protecting EVERY DIVISION in MATRIX >> with the >> >> following >> >> >> >> awkward monstrosity. >> >> >> DO IF (zero_check_matrix). >> >> >> >> >> COMPUTE newarray = oldarray / value. >> >> >> >> >> ELSE. >> >> >> >> >> COMPUTE >> >> >> newarray=MAKE(NROW(oldarray),NCOL(oldArray),0). >> >> >> >> >> LOOP #=1 TO NROW(oldarray). >> >> >> >> >> LOOP ##=1 TO NCOL(oldArray). >> >> >> >> >> COMPUTE >> newarray(#,##)=oldarray(#,##)/value. >> >> >> >> >> END LOOP. >> >> >> >> >> END LOOP. >> >> >> >> >> END IF. >> >> >> This also ends up being a PITA because one >> must take >> >> great care to >> >> >> >> treat the resulting 0 appropriately in >> subsequent >> >> calculations. >> >> >> >> In the HACK mode one can test for HUGE >> values which >> >> are >> >> >> >> distinguishable from 0's which can >> legitimately arise >> >> from 0 >> >> >> >> numerators . >> >> >> >> >> Yeah, there are trade offs, and I am >> nowhere near >> >> solving every >> >> >> >> weird thing that can crop up in complex >> situations. >> >> >> >> >> But, I do stand by my using SYSMIS for >> this situation >> >> ;-) >> >> >> >> >> -- >> >> >> >> >> >> >> >> Art >> >> >> >> Kendall wrote >> >> OOPS! sysmis on >> >> >> >> right side of >> >> >> >> >> >> assignment operator. >> >> RECODE ALL (LO THRU 1.0 = >> COPY) >> >> >> >> >> >> >> >> >> (ELSE -999 >> = ). >> >> >> >> >> >> >> >> missing values all (-999). >> >> Art Kendall >> >> >> >> >> >> Social Research Consultants >> >> On 4/25/2013 12:15 PM, Richard >> Ristow [via >> >> SPSSX >> >> >> >> Discussion] >> >> >> >> >> >> wrote: >> >> >> >> At 09:43 AM 4/25/2013, David >> Marso wrote: >> >> >> >> >> >> >> >> >> >> >If the numbers are all >> positive then >> >> you can nuke >> >> >> >> the very >> >> >> >> >> >> small fudge factor >> >> >> >> >> >> >> >> >and remove the recode. >> >> >> >> >> >> >> >> >If you have negative >> values then you >> >> will need to >> >> >> >> modify the >> >> >> >> >> >> recode (I'm >> >> >> >> >> >> >> >> >sure you can sort that). >> >> >> >> >> >> >> >> >> >> >RECODE ALL (1.000001 THRU >> HI=SYSMIS). >> >> >> >> >> >> >> >> >> >> I think a cleaner way to do >> this RECODE, >> >> sidestepping >> >> >> >> having to >> >> >> >> >> >> >> >> choose a fudge factor, is >> >> >> >> >> >> >> >> >> >> RECODE ALL (LO THRU 1.0 = >> COPY) >> >> >> >> >> >> >> >> >> (ELSE = >> SYSMIS). >> >> >> >> >> >> >> >> >> >> But actually, I think the >> dividing-by-zero >> >> problem is >> >> >> >> a strong >> >> >> >> >> >> reason >> >> >> >> >> >> >> >> to do the computation in a >> transformation >> >> program, >> >> >> >> rather than >> >> >> >> >> >> MATRIX. >> >> >> >> >> >> >> >> >> >> ===================== >> >> >> >> >> >> >> >> 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 >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> If you reply to this >> email, >> your >> >> >> >> >> >> message will be >> added to >> the >> >> discussion below: >> >> >> http://spssx-discussion.1045642.n5.nabble.com/do-repeat-tp5719707p5719720.html >> >> >> >> >> >> >> >> >> >> >> To start a new topic >> under >> SPSSX >> >> Discussion, email >> >> >> >> >> >> [hidden >> >> >> >> email] >> >> To unsubscribe from SPSSX >> Discussion, >> >> click >> >> >> >> >> >> here . >> >> NAML >> >> >> >> >> >> >> >> >> 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/do-repeat-tp5719707p5719723.html >> >> >> >> >> >> >> To start a new topic under SPSSX >> Discussion, email >> >> >> >> [hidden >> >> email] >> >> To unsubscribe from SPSSX Discussion, >> click >> >> >> >> here . >> >> NAML >> >> >> >> >> 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/do-repeat-tp5719707p5719750.html >> >> >> >> >> To start a new topic under SPSSX >> Discussion, email >> >> [hidden >> email] >> To unsubscribe from SPSSX >> Discussion, click >> >> here . >> NAML >> >> >> >> 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/do-repeat-tp5719707p5719763.html >> >> >> To start a new topic under SPSSX Discussion, email >> > >> ml-node+s1045642n1068821h68@.nabble > >> >> To unsubscribe from SPSSX Discussion, click >> here . >> NAML > > > > > > ----- > 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/do-repeat-tp5719707p5719766.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 |
In reply to this post by Art Kendall
Team,
I have one problem on my hand and am running out of options on which statistics to use in SPSS. First, I know that the what I want to do is not advisable but trust me, I have fought my battle on this. This is what I want to achieve: Issue: We did wave 1 survey using 5-point satisfaction scale. The second wave was conducted using 5-point agreement scale. Expectedly, top-box scores from agreement scale when compared to top-box score of satisfaction scale was low by 10% points. For e.g., agreement scale top box in wave 2 came out as 50% while wave 1 it was 60%. Goal: I have compared the historical data and conclude that score difference is purely due to scale change. However, i want to normalize the wave 2 score so that I can compare with wave 1. I know this is not advisable but I have to do this. I googled but could not find any statistics that helps to normalize the scores - indeed I don't know where to begin. I need a scientific method to normalize the scores so that they are comparable. I don't want to conclude that performance dropped by 10% just because scale changed. Your wisdom and help is very much required. Thanks, Mike ===================== 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 |
Mike,
The only thing I can think of is to run the survey on a subset of individuals (preferably a stratified random sample) using both forms of the scale. Then regress one score on the other. You can then apply the regression results to rescore your previous survey into the alternative scale form. Garry Gelade -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of MR Sent: 28 April 2013 01:23 To: [hidden email] Subject: Normalizing scores Team, I have one problem on my hand and am running out of options on which statistics to use in SPSS. First, I know that the what I want to do is not advisable but trust me, I have fought my battle on this. This is what I want to achieve: Issue: We did wave 1 survey using 5-point satisfaction scale. The second wave was conducted using 5-point agreement scale. Expectedly, top-box scores from agreement scale when compared to top-box score of satisfaction scale was low by 10% points. For e.g., agreement scale top box in wave 2 came out as 50% while wave 1 it was 60%. Goal: I have compared the historical data and conclude that score difference is purely due to scale change. However, i want to normalize the wave 2 score so that I can compare with wave 1. I know this is not advisable but I have to do this. I googled but could not find any statistics that helps to normalize the scores - indeed I don't know where to begin. I need a scientific method to normalize the scores so that they are comparable. I don't want to conclude that performance dropped by 10% just because scale changed. Your wisdom and help is very much required. Thanks, Mike ===================== 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 |