Ya, I did that a few times but I need to run the same operation on a bunch
of different datasets, which makes the process a little tedious.....
Thanks,
Nirmala
On Thu, 16 Jan 2003, Ryan Thomas Moore wrote:
Nirmala:
One thing I've done (for different reasons, though): If the number of
cases is small, you can use Stata command
list <var>
then cut and paste into a notepad document, then use R's read.table and do
the operation in R. Admittedly, a simple Stata command sounds like a
better solution in this case, but this technique should work!
Ryan
------------------------------------------
Ryan T. Moore ~ Government & Social Policy
Ph.D. Candidate ~ Harvard University
On Thu, 16 Jan 2003, Nirmala Ravishankar wrote:
I have a question about Stata I am hoping one of you can answer. Is there
some way of calculating the mean or the median of a variable that does not
involve using the command "collapse (mean)" or "collapse (median). Once
I
use collapse, stata clears the original data out of the work space,
which is annoying.
I have a variable dpi, which stores household income. First I want
to calculate the median income for the entire dataset. Then I want to
disaggregate the households by region and calculate the regional medians.
Lastly, I want to calculate the ratio of the regional medians to the
national median.
I have tried:
collapse (median) natm = dpi
collapse (median) regm = dpi, by(region)
But after the first command, Stata doesn't seem to recognize the variable
name dpi anymore. I could load the original dataset again, but that
seems so cumbersome for a relative simple operation (I can do it easily
in R!!). Any ideas?
Thanks,
Nirmala
_______________________________________________
gov1000-list mailing list
gov1000-list(a)fas.harvard.edu
http://www.fas.harvard.edu/mailman/listinfo/gov1000-list
_______________________________________________
gov1000-list mailing list
gov1000-list(a)fas.harvard.edu
http://www.fas.harvard.edu/mailman/listinfo/gov1000-list