Showing posts with label Tutorial. Show all posts
Showing posts with label Tutorial. Show all posts

Nov 8, 2011

Using Postfile in Stata (+2 examples)

Postfile can be used to generate new, computed datasets and to subset data into new datasets in Stata.

There is an awesome command in Stata you may not yet have heard of called postfile. It lets you create Stata datasets. It can be used for a variety of tasks:

  • For creating subsets of your data.
  • For building datasets of generated statistics.
  • For Monte Carlo-type experiments.

Nov 6, 2011

Using _n and _N in Stata

This article is all about using _n and _N in Stata. The functions mod() and round() are also covered at the end for your reference. They are particularly useful when using _n and _N

Nov 5, 2011

Using the Return List in Stata

Whether you are programming or trying to retrieve values calculated in Stata, your best bet is probably to use the return list command in Stata. For many of Stata's commands (particularly statistical ones), statistics generated or other data are saved in scalars, matrices, or macros. You may want access to this data for a variety of reasons:

  • To return more precise statistics, because Stata sometimes truncates values in output, but not in return values.
  • To reorganize data output to make it easier to read, copy, or interpret.
  • To build programs in Stata.