Re: Bad ways to code data #6 133935

  • Permalink
  • submit to reddit
  • Email
  • Follow


Ron  wrote

>Proc Format library = Library fmtlib;
>
>value NoYes 1 = 'No'
>            2 = 'Yes';
>*...;
>
>value TrueFalse
>            0 = 'false'
>            1 = 'true';
>
>value YesNo 1 = 'Yes'
>            2 = 'No';
>
>value YesNoMissing
>            1 = 'Yes'
>            2 = 'No'
>          0,. = 'missing';
>
>"Q: What's with the NoYes and YesNo?"
>
>"A: That's the order in which the choices appeared on the data
>collection form."
>

Hehe

Reminds me of the guy who was seen reading a newspaper upside down.  When asked why, he said
"that's how they sold it to me"

Happy TG.

Peter

Peter L. Flom, PhD
Statistical Consultant
Website: www DOT peterflomconsulting DOT com
Writing; http://www.associatedcontent.com/user/582880/peter_flom.html
Twitter:   @peterflom
0
Reply peterflomconsulting 11/24/2009 3:49:30 PM

See related articles to this posting

comp.soft-sys.sas 131432 articles. 30 followers. Post

0 Replies
376 Views

Similar Articles

[PageSpeed] 5


Reply:

Similar Artilces:

Re: Bad ways to code data #6 280807
Oh yes, that's called 100% of the data I deal with. 1-5 scale... 1 is best, 5 is best, surprised I don't see data where 3 is best [on a 1-5 scale]. Every time the same answer... "that's how the data is on the screen/survey/etc." ... -Joe On Tue, Nov 24, 2009 at 8:52 AM, Fehd, Ronald J. (CDC/CCHIS/NCPHI) < rjf2@cdc.gov> wrote: > > From: Peter Flom > > Sent: Friday, November 20, 2009 4:00 PM > > Subject: Bad ways to code data > > > > Nat Wooding just wrote a post on the perils of using a > > numeric ID that had a ...

Re: Bad ways to code data 131744
Peter, My vote is for the VIN or Vehicle Information Number (see: http://en.wikipedia.org/wiki/Vehicle_Identification_Number ), particularly the choice for model year. And we were all so concerned about the Y2K problem with 2-digit years! Art -------- On Fri, 20 Nov 2009 15:59:41 -0500, Peter Flom <peterflomconsulting@MINDSPRING.COM> wrote: >Nat Wooding just wrote a post on the perils of using a numeric ID that had a decimal, pointing out that such data can be subject to rounding error .... > >That gave me an idea for a fun thread - bad ways to code data. &g...

Re: Bad ways to code data 280797
At least he didn't use colors to indicate it... -Joe On Fri, Nov 20, 2009 at 2:59 PM, Peter Flom < peterflomconsulting@mindspring.com> wrote: > Nat Wooding just wrote a post on the perils of using a numeric ID that had > a decimal, pointing out that such data can be subject to rounding error .... > > That gave me an idea for a fun thread - bad ways to code data. > > The worst one I've seen recently is a guy who created an Excel file in > which a blank could mean either 0 OR n/a, depending on which column it was > in. Oy vey! > > P...

Re: Bad ways to code data #3 269998
I just spit coke all over my keyboard thanks! That is too funny. :) ~J DiGennaro On Nov 20, 4:14=A0pm, digen...@GMAIL.COM (Josh Di Gennaro) wrote: > I just spit coke all over my keyboard thanks! =A0That is too funny. :) > > ~J DiGennaro 1. Leaving and endsas statement in the mddle of your code 2. Single line program calling macro %create_ae with mprint turned off so log is basically empty to. FDA submission dataset creation. 3. Lots of dead code 4. Macros that rely on undocumented global variables ...

Re: Bad ways to code data #2 131745
On Fri, 20 Nov 2009 18:08:32 -0500, Peter Flom <peterflomconsulting@MINDSPRING.COM> wrote: >Arthur Tabachneck <art297@NETSCAPE.NET> wrote >>Peter, >> >>My vote is for the VIN or Vehicle Information Number (see: >>http://en.wikipedia.org/wiki/Vehicle_Identification_Number ), >>particularly the choice for model year. >> Hi, How about using an email address as a primary key to a table? Cheers, Chang ...

Re: Bad ways to code data #5 114832
Tom Abernathy <tom.abernathy@GMAIL.COM> wrote >I would shorten the example to >"The worst one I've seen recently is a guy who created an Excel >file ... PERIOD." > Well, that would be about 95% of my clients. Once in a while, I get something that was entered in SPSS Later today, for the first time in at least a year, someone has a file already coded in SAS (not by him). Peter Peter L. Flom, PhD Statistical Consultant Website: www DOT peterflomconsulting DOT com Writing; http://www.associatedcontent.com/user/582880/peter_flom.html Twitter: ...

Re: Bad ways to code data #3 131748
I am going to go with the following: 1. Over-writing consecutive Datasets using the same name but with different data. 2. Using multiple Platforms for code within the same process. 3. Using multiple static changes throughout the code that need to be updated before each run of the code instead of Macro-variables. 4. Not memoing code. 5. No descrete run statements. 6. Repeating the same blocks of code over and over again instead of Macrotizing them and writing it once but with variables that can iterate. 7. Not using dataset/Variable names that have meaning. Ok ...

Re: Bad ways to code data #4 131755
your 6th point was just criticized by 'seasoned' SAS programmers... On Fri, 20 Nov 2009 19:31:46 -0500, Norman Weston <nweston@AMGEN.COM> wrote: >I am going to go with the following: > >1. Over-writing consecutive Datasets using the same name but with >different data. > >2. Using multiple Platforms for code within the same process. > >3. Using multiple static changes throughout the code that need to be >updated before each run of the code instead of Macro-variables. >>4. Not memoing code. > >5. No descrete run statemen...

Re: Bad ways to code data #2 150689
Arthur Tabachneck <art297@NETSCAPE.NET> wrote >Peter, > >My vote is for the VIN or Vehicle Information Number (see: >http://en.wikipedia.org/wiki/Vehicle_Identification_Number ), >particularly the choice for model year. > Augh!!!!! But at least that has the excuse of trying to code a lot of information into one number (albeit doing it very badly). Another couple of bad ideas that I've run into.... Using multiple rows of an Excel file to write variable names Mixing numbers and letters in represent values of the same variable - e.g., one person re...

Re: Bad ways to code data #4 196990
> From: Peter Flom > Sent: Friday, November 20, 2009 4:00 PM > Subject: Bad ways to code data > > Nat Wooding just wrote a post on the perils of using a > numeric ID that had a decimal, pointing out that such data > can be subject to rounding error .... > > That gave me an idea for a fun thread - bad ways to code data. > > The worst one I've seen recently is a guy who created an > Excel file in which a blank could mean either 0 OR n/a, > depending on which column it was in. Oy vey! > > Peter Proc Format library = Library fmtlib...

Re: Bad ways to code data #5 196991
> From: Peter Flom > Subject: Re: Bad ways to code data > > Hehe > > Reminds me of the guy who was seen reading a newspaper upside > down. When asked why, he said > "that's how they sold it to me" > > Happy TG. thanks, and you with yours, too. "Ours not to wonder why, Ours but to ... crunch the numbers!" http://answers.yahoo.com/question/index?qid=1006021002270 see also: poem containing that line. http://en.wikipedia.org/wiki/The_Charge_of_the_Light_Brigade_(poem) Ron Fehd the macro maven CDC Atlanta GA USA R...

Re: Elegant way to re-write this code? #6
Jack: One of the important reasons for differences in database terminology (table vs. relation and rows vs. tuples) has to do with logical operations as opposed to physical implementation. A projection of an attribute from relation A yields another relation of the same cardinality as A (same number of tuples). The relation A could be a view that restricts selection of tuples from a physical file A to those where a delete flag is null. In that case the view A may have fewer tuples than the physical file A. SQL typically does the right thing and reports the cardinality of view A, not the physic...

Bad ways to code data
Nat Wooding just wrote a post on the perils of using a numeric ID that had a decimal, pointing out that such data can be subject to rounding error .... That gave me an idea for a fun thread - bad ways to code data. The worst one I've seen recently is a guy who created an Excel file in which a blank could mean either 0 OR n/a, depending on which column it was in. Oy vey! Peter Peter L. Flom, PhD Statistical Consultant Website: www DOT peterflomconsulting DOT com Writing; http://www.associatedcontent.com/user/582880/peter_flom.html Twitter: @peterflom I would shorten t...

Re: Bad Code -Followup #6
The enhanced editor lacks a lot of features found in modern editors like Visual Studios. Management of indents is one, automatic correction of all code is another, and Intellisense is the biggest. Parts of SAS can be Intellisensed such as proc and functions. Additionally, there needs to be a way to auto-indent on context. There may be some primitive parts but it doesn't replicate the functionality I am trying to shoot for. I wish it was faster but we don't have access to SAS's parsers so we have to build a parsing engine to enable the specific functionality I think is needed. Ala...

Re: How to transpose the data in my way? #6
Does do over actually allow you to do that (iterate through two arrays at once)? If so, that's pretty interesting and useful to know :) If not, you would just use: do i = 1 to 3; .... end; (or 1 to whatever your upper limit of variable is). -Joe On Tue, Dec 2, 2008 at 2:27 PM, Akshaya Nathilvar < akshaya.nathilvar@gmail.com> wrote: > One possible solution: > Data have; > input ID $ A1 A2 A3 B1 B2 B3; > cards; > QQ 1 2 3 5 2 4 > GG 3 8 3 6 7 4 > WW 4 5 6 6 1 8 > ; > > Data want; > set have; > array abc a1-a3; > array xyz b1-b3; ...

Re: How to code my problem in an efficient way? #6
On Thu, Sep 25, 2008 at 8:15 PM, Paul Dorfman <sashole@bellsouth.net> wrote: > Muthia, > > Yes, but only under the assumption that GROUP and TYPE are the only input > variables. I suspect it may be not an entirely safe assumption. > > Kind regards > -------------- > Paul Dorfman > Jax, FL > -------------- > > Paul D. Yes. I agree. Muthia Kachirayan ...

Re: how to rewrite my codes in a efficient way? #6
Try using the compress function: If Compress(x,'0') = '' THEN... There's a variety of modifiers you can use if need be. ...

Re: What is wrong with my data step code #6
Is there something similar to this while doing datalines ?? because I am creating the dataset with in the program itself. thanks SL On Sat, Aug 29, 2009 at 2:08 PM, Data _null_; <iebupdte@gmail.com> wrote: > TERMSTR is and INFILE statement option > > INFILE CARDS TERMSTR=CRLF; > > On 8/29/09, SAS_learner <proccontents@gmail.com> wrote: > > hello data_null_ , > > > > So is this way I need to create the dataset ?? > > > > Options Termstr = crlf ; > > data t; > > Input a ; > > datalines; > > 0.5 > > .2 >...

Re: Conditaional coding in data step #6
Muthia, Thank you so much for helping me. I am still slowly digest your program and have questions: What is this part do, to inflat the follow ups so everybody got 3 followups? I am sorry to ask with your comments already provided. >* initialize the array at the id-break; >do i = 1 to 3; > k[i] = ' '; >end; Where does 'continue' take me to? I am not fully understand your code and my real data is more compliated than the example I provided, so I have to really understand your programming stratege in order to apply to my real data. Again, I really appreciate ...

Data Recovery SOURCE CODE ( SOURCE CODES of Professional Data Recovery Software ) #6
Hi, I am a Data Recovery Specialist and Professional Data Recovery Software Developer in New Delhi. I've placed the Complete SOURCE CODE of One of my Data Recovery Software for Sale (for Educational Purpose) on the following link of my website: http://www.datadoctor.biz/3.htm I'd like to inform you that I am the author of World's First Book on Professional Data Recovery Programming titled, "Data Recovery with & without Programming". You can see the contents of the book on following link of my website: http://www.datadoctor.biz/author.htm I also have many other Pr...

Re: Need a way of quality checking data #6
William, The quick answer to your solution question is - do the same with E as you did with D. However the original question hints at a more interesting problem. How can data requirements be set up in such a manner that they can generate the code needed to apply the requirements to the data automatically? Several people suggested formats for range checking and that is good as far as it goes, but you wanted a more general method that could require any sort of relationship between variables on one record. The first thing to do is separate the data from the requirements. Your variables A an...

Re: what is wrong with my code for %length of a data set #6
It may be important to note that the value set by NOBS= will be correct only for native format data sets with no deleted observations. -- Jack Hamilton jfh@alumni.stanford.org Tots units fem for´┐Ża! On May 13, 2009, at 2:03 pm, Choate, Paul@DDS wrote: > Sure thing, glad it helped - > > "IF 0 THEN SET THREE NObs=NObs;" is a SET statement that never > executes > because "IF 0" is always false. What happens is that the SAS compiler > reads the statement and fetches the number of observations of dataset > THREE at compile time, but then during executi...

Re: Data Step Recode: Is there a better way?? #6
On Wed, 30 Jan 2008 12:09:51 -0800, Paul Miller <pjmiller_57@YAHOO.COM> wrote: > Hi Howard, > > I absolutely love your approach to this recode. I was a little surprised to see that this worked though. My impression was that the max() function would look for the exposure category that came first in the alphabet. Instead it seems to tell SAS to look within all the rows of a given ohtn_id to see if a category or combination of categories is present. Was I just wrong in my impression about how the max() function treats character variables? And is there any clever point about how...

Re: help re-coding data
Without looking at your data I can't say, but this may work for you. data have; input id val1 ; cards; 1 5 2 -6 3 7 4 4 5 -1 ; run; data want; set have; if substr(left(val1),1,1) = '-' then val2 = 'missing'; else val2 = 'ok'; run; On Dec 3, 5:17=A0pm, nwes...@AMGEN.COM (Norman Weston) wrote: > Without looking at your data I can't say, but this may work for you. > > data have; > input id val1 ; > cards; > 1 5 > 2 -6 > 3 7 > 4 4 > 5 -1 > ; > run; > > data want; > =A0set have; ...