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

st: Generating a new variable


From   Fernando Augusto Proietti <[email protected]>
To   STATA Lista Discussao <[email protected]>
Subject   st: Generating a new variable
Date   Tue, 12 Apr 2005 16:01:34 -0300

Dear all,

I have a large data set, with 15,000 observations, nested within 500
census tract. Something like that:

Census Tract    Age    Sex
1                        23       Male
1                        65       Female
1                        68       M
2                        35       F
2                        48       F
2                        56       M

I want to generate two new variables, mean age and female proportion
for each census tract. I was able to use egen and created the new
variable mean age. However, I could not figure out how to create the new

female proportion variable.

Thanks in advance,

Fernando





begin:vcard 
n:Proietti;Fernando 
tel;fax:55-31-3248-9675
tel;work:55-31-3248-9949 / 3248-9102
x-mozilla-html:FALSE
org:Dep de Medicina Preventiva e Social - UFMG
version:2.1
email;internet:[email protected]
title:Professor Adjunto - Epidemiologia
adr;quoted-printable:;;Faculdade de Medicina - UFMG=0D=0AAv Prof Alfredo Balena, 190;Belo Horizonte;Minas Gerais;30130-100;Brasil
x-mozilla-cpt:;17392
fn:Fernando  Proietti
end:vcard



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