WF Rules 2011-04-20 =================== Rule 1: Errors are not the problem; not finding them is. Rule 2: Put active Stata files in the working directory. Rule 2.1: Friends don't let friends click and compute. Rule 2.2: Do not hard code directory information in do-files. Rule 3: It is very hard to have too many comments. Rule 3.1: Used "// #" to number parts of the do-file. Rule 4: If you output wraps, fix it immediately. Rule 5: Do not use abbreviations shorter than three letters. Rule 5.1: Use abbreviations reluctantly. Rule 5.2: A do-files should create a log file with the same name. Rule 5.3: Start do-files with "capture log close" and end them with "exit". Rule 6: If you lose a file. Take your time. Do not make it worse. Rule 7: It is OK to ask for help, but do it carefully and reluctantly. Rule 8: Reflect before hitting the send button. Rule 9: Name do-files so that they run in alphabetical order. Rule 10: Never type anything that you can obtained from a saved result. Rule 11: It is faster to document it today than tomorrow. Rule 12: Document things necessary for replication. Rule 13: The research log only needs essential information, not everything. Rule 14a: Planning saves time. Rule 14b: Organization makes it easier to find things. Rule 14c: Documentation is essential for replication. Rule 15: Preserving files is hard but necessary. Rule 15x: Make at least two copies of important files. Rule 15y: Store the copies at different locations. Rule 15a: Verify that copies are exact duplicates. Rule 16: Only share results after the files are posted. Rule 17: Once a file is posted, never change it. Rule 18: Never name it final. Rule 19: All datasets need "label data". Rule 20: Notes should document the provenance of datasets. Rule 21: All datasets should have datasignatures. Rule 22: Never change a variable unless you give it a new name. Rule 23: Use names that are at most 12 characters long. Rule 24: Original names should be 10 or shorter to allow Vx. Rule 25: Let the name of a 0/1 variable indicates what 1 means. Rule 26: Do not use names that differ only in capitalization. Rule 27: Try names and labels before you decide. Rule 28: Every variable should have a variable label. Rule 29: Put important things in the front of a value label; rarely use more than 30 columns. Rule 30: Test labels before you post the data. Rule 31: Use notes to document the provenance of new variables. Rule 32: Categorical variables should have value labels unless the variable has an inherent metric. Rule 33: Value labels should be 8 or fewer characters in length. Rule 34: If a value label is assigned to only one variable, the label definition should have the same name as the variable. Rule 35: If a value label is assigned to multiple variables, the name of the label definition should begin with L. Rule 36: Carefully evaluate why missing values are missing. Rule 37: Use consistent missing value codes for all variables. Rule 38: Make redundant, verified backups in multiple locations of anything you want to preserve. Rule 39: You must preserve materials necessary to replicate your work. Rule 40: Assume your data is wrong. Prove it is right. Rule 41: Assume data conversion was done incorrectly. Rule 42: Stay as close to the original data as possible rather than converting a converted dataset. Rule 43: Always create new variables. Never change existing variables. Rule 44: When you create a variable, verify that it is correct. Rule 45: When you create a variable, add labels and a note. Rule 46: Almost never delete a source variable. Rule 47: When creating a variable, verify where missing values came from. Rule 48: Change the labels of variables Stata automaticlly creates. Rule 49: Make data changes only once and save them in a dataset. Rule 50: Add two digits to the name of your dataset. Increment the number with each revisions. Rule 51: If a dataset is temporary, start the name with x-. Rule 52: Remember why you are doing what you are doing. Rule 53: Do not create variables in analysis do-files. Rule 54: The provenance of every result must be documented. Rule 99: Enjoy! This too hard if you do not enjoy what you are doing. ===================