Thursday, January 24, 2008

Stupid Monkey Commands

In which I finally sort of start understanding how to do basic commands in STATA:

My task:

1. Figure out the path to the sampledataset.dta file
2. Compute the Mean and Standard Deviation of the sample_variable
3. Figure out how many standard deviation units below the mean the figure 19 is
4. Use command "normal" to compute the answer

How this translates to STATA:

clear

capture log closelog using sampledataset, text replace
use sampledataset

summarize sample_variable
local SDunits=(19-r(mean))/r(sd)

display normal(`SDunits')
display `SDunits'

log close


This is so lame.

To think, I might pimp out my doctrinal analysis skills to code cases into variables for my stats teacher this semester.