Introduction to Stata 8 - (GRIPS
Introduction to Stata 8 - (GRIPS
Introduction to Stata 8 - (GRIPS
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
10. Modifying data<br />
Don't misinterpret the title of this section: Never modify your original data, but add<br />
modifications by generating new variables from the original data. Not documenting<br />
modifications may lead <strong>to</strong> serious trouble. Therefore modifications:<br />
• should always be made with a do-file with a name reflecting what it does:<br />
gen.alfa2.do generates alfa2.dta.<br />
• The first command in the do-file reads data (eg. use, infix).<br />
• The last command saves the modified data set with a new name (save).<br />
• The do-file should be 'clean', ie. not include commands irrelevant <strong>to</strong> the modifications.<br />
See examples of modifying do-files in section 16 and in Take good care of your data.<br />
10.1. Calculations<br />
Opera<strong>to</strong>rs in expressions [GSW] 12; [U] 16.2<br />
Arithmetic Relational Logical<br />
^ power > greater than ! not<br />
* multiplication < less than ~ not<br />
/ division >= > or equal | or<br />
+ addition