... is one paragraph at the bottom of page 80.
It tells you that you don't need to type the whole variable name. Just give it two-three letters, and hit the tab key. If you have variable names that have more than that many characters in common, Stata will fill out as much as it can [...]
Archives for the Month of January, 2009
Section 10.6 in the User’s Guide
Tuesday, 27 January 2009
Dummy variables
Monday, 19 January 2009
There are two straightforward ways to turn string variables into corresponding dummies -- also known as categorical variables -- using Stata. One is an extension of the tab command:
tab stringvar, gen(dummy)
Another makes use of the fact that you seldom need dummies for their own sake. Usually you want them used in some sort of regression [...]
Dealing with unhelpful .csv files
Friday, 16 January 2009
The easiest way to get your .csv (comma-separated values) text files into Stata is this:
insheet using myfile.csv, comma names
This assumes that your .csv file is well-behaved: names are on the first row, and any commas really are field separators.
This is sometimes not the case. Recently I got a set of .csv files that were likely [...]
Gems from the User’s Guide
Friday, 9 January 2009
A little over a year into my Stata 10 license, I can see some usage patterns over the two feet's worth of Stata documentation: Data Management and Programming are pretty well worn, the rest not so much. User's Guide, [U], has been among the least popular, which is a pity, because chapter 18, Programming Stata, [...]
I’ve got Samba!
Sunday, 4 January 2009
I finally got around to configuring the Samba server on the FreeBSD machine. The instructions are here and they couldn't be clearer. One thing didn't work the way the book described it, not big enough to be worth investigating. That's the syntax of Samba commands. Rather than
# smbpasswd -a username
I had to do
# /usr/local/bin/smbpasswd -a username
But [...]
Do-file rules — one suggestion
Saturday, 3 January 2009
I've gone through several iterations with my idea of best do-file practices, and I'm sure I'll go through some more before I retire. But right now, here's where I stand:
My do-files start with a handful of header commands that I found useful at various times. They might look something like this:
clear
set more off
set type double
set [...]
Do-file rules — a justification
Saturday, 3 January 2009
There's apparently a programming principle going by the acronym DRY -- Don't Repeat Yourself. Somebody needs to teach it to Stata users.
See, Stata is so flexible and easy to use that it's perverse in a way. Take for example the ability to generate new variables on the fly, either in interactive mode or wherever in [...]