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

st: assigning calculated values to other groups (was: Data problem again)


From   Ernest Berkhout <[email protected]>
To   [email protected], [email protected]
Subject   st: assigning calculated values to other groups (was: Data problem again)
Date   Fri, 14 Nov 2003 13:38:04 +0100

At 07:36 14-11-2003, Lok Wong wrote:
I have "area,education,gender,wage"in my dataset...Now I want to calculate the mean and GINI coefficient of only male wage by area and education...and assign these values to females in the same area-education group..How could I do that?

First, let me point out that you might learn something from the collection of FAQs on
http://www.stata.com/support/faqs/

In a quick scan, I think that this one might be of interest to you http://www.stata.com/support/faqs/data/weighted.html but ofcourse thare may be other as well.

Apart from that, your questions sounds like the following approach to me:

egen group=(area education)
levels group
foreach x of local group {
summ wage if sex=="male" [aw=weight]
replace wage = r(mean)
}


Ernest Berkhout
SEO Amsterdam Economics
University of Amsterdam

Room 3.08
Roetersstraat 29
1018 WB Amsterdam
The Netherlands

tel.:+ 31 20 525 1657
fax:+ 31 20 525 1686
http://www.seo.nl
===========================
A statistician: someone who insists
on being certain about uncertainty
===========================

*
* 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