Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Calculating means not using "collapse"


From   "Ronnie Babigumira" <[email protected]>
To   <[email protected]>
Subject   st: RE: Calculating means not using "collapse"
Date   Fri, 17 Jan 2003 09:10:42 +0100

Hi
Hoping I havent misinterpreted your question, two ways around this, you can
use .means to get the mean of whatever variable u want and or .tabstat
<varname> to get more statistics. You can then save or use these for ur
subsquent analysis.

see
help means
help tabstat

Ronnie

-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of Nirmala
Ravishankar
Sent: 17. januar 2003 06:16
To: [email protected]
Subject: st: Calculating means not using "collapse"


I am a first-time Stata user, and have a relatively basic question.  Is
there some way to calculate the weighted mean and median of a variable
without using the "collapse" command?  As part of a program, I need to
calculate the weighted mean and median to perform other operations on the
dataset, but using "collapse" clears the original variables from the
workspace. I tried "egen" but that doesn't allow for weighted means.

Here are the specifics:  I have household income data for US 1994, from
which I want to calculate the median income. Then I want to disaggregate
households by state and calculate the regional medians. Finally, I want to
calculate the ratio of the regional medians to the national median. Using
"collapse" to calculate the national median removes the original
observations from the working space.


Thanks,
Nirmala





*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index