Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: destringing


From   "Daniel Egan" <heteroskedastic@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Re: destringing
Date   Sat, 28 Aug 2004 12:08:00 -0400

Hi Suzy,
A couple of points:
1) instead of
tab dxcode1 if dxcode1==V3000
use
tab dxcode1 if dxcode1=="V3000"

this tells stata that what it is tabulating is a string variable. This is
true for all of your string variables, i.e. any one that was read in as
"strX".

2) I would highly suggest taking about 1 hour to go through the relevant
modules at http://www.ats.ucla.edu/stat/stata/modules/default.htm . This
will give you a very useful overview of Stata datatypes, and how to
manipulate them as well as do various things

3) I would also strongly suggest that when doing analyses, you have your
"raw" dataset (i.e. what you -infiled- and saved), which is NEVER saved
over. Doing a "save-as" on the datasets once you have put them in analytic
format, like "Foo-A.dta". This prevents the over writing, and ties in with
my next point.

4) Look into using .do files for all of this - it allows you to 1) keep
track of what you have done, and look through your code quickly for problems
fix them, and rerun what you have done on the "raw" dataset, and 2) gives a
very easy replication file for anyone who is looking to proof your work.

5) Once comfortable with it, look into using -encode-.

All things which I learned painfully on my own....

Dan
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index