X hits on this document

# click on “Load Preferences”; (4) click on “Factory Settings.” If the ... - page 6 / 44

401 views

0 shares

6 / 44

that particular year) to convert monthly minimum wage data to an annual average minimum wage the following commands were used:

collapse (mean) minwage, by(year)

tsset year

Square Root: square root of variable pop or spop type: gen spop =  sqrt(pop)

(no space between sqrt and (pop)

Logarithms: to convert variable X to a log: gen lnx = ln(x)

Descriptive Statistics - type: summarize cons party stinc (to get the median –

i.e., 50th percentile – type: summarize cons party stinc, detail)

If you have missing data and want the statistics based on only those cases used in a regression do the following: (1) run the regression/logit, etc.; (2) after receiving the results type the following in the command line: estat summarize

Z Scores: to standardize cons type: egen consst = std (cons) (i.e., the new variable name is consst or: (1) download “center” command: ssc install center (2) to standardize cons type: center cons (which produces a new variable called c_cons) (3) then type: summarize cons (to obtain the standard deviation) (4) then type: gen consst=c_cons/standard deviation from step 3

Frequencies: to obtain the frequencies on one variable (e.g. ada94) type:

range of observation (e.g., 1 through 10) by:

Addition/Summation Over Time:  given a dataset stacked by state (e.g.,, obs.

1-47 are 47 consecutive years for Alabama, with obs. 48 being the first year for Alaska, etc.) and variable year telling the year and stnum the number of the state, to find the mean on variable lhdem over the 1985-2002 period for each state type:

tabulate stnum if year>1984 & year<2003, summ (lhdem)

Note: If you want to make every observation for a particular year have the average value, 63.21, for variable statepop for that year type:

gen statepop = 63.21 if year==1985

Cross Tabulation and Measures of Association:

type: tabulate grh85 par85, row column all   (“row” and

“column” yield row and column percentages, “all” yields statistics – Kendall’s tau, gamma and Cramer’s V - you can ask for either row or column percentages, or as above, both – if you want Fischer’s Exact test, add “exact” after “all”). If an error message says “too many values” you may need to recode one or both variables.  For a three variable table either: tabulate tax1 cons1 if party==1, row column all

or you need to “sort” by the control variable.  For example, to use the two variables above controlling for party type: sort par85 (press “enter”)

by par85: tabulate grh85 grh87, row column all exact (press “enter”)

Correlation: correlate tax cons (to correlate tax and cons – can add more

 Document views 401 Page views 464 Page last viewed Sat Dec 03 17:49:41 UTC 2016 Pages 44 Paragraphs 843 Words 17107