07.02.2014 Views

Introduction to Stata 8 - (GRIPS

Introduction to Stata 8 - (GRIPS

Introduction to Stata 8 - (GRIPS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!