Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: question about svy commands

From   Anant Thaker <>
Subject   st: question about svy commands
Date   Tue, 7 Mar 2006 00:48:48 -0500

Hello all,

New to the list and a Stata SE/8 user. I have survey data that is organized at
the individual level, roughly like this:

Var1  Var2  State  Weight

I want to create a new variable, Var4, that has the mean of Var1 for whatever
state the individual is in. For example, if the first observation is in New
York, I want the new variable to have a Var4 that has the mean value of Var1
for NY. However, I need to incorporate the weights, so I was wondering if I
should use the survey commands? Is there a way to do this? Is it something
along the lines of egen var4 = svymean var1 [if var1==...

Not too sure how to do this, so please help! Thanks!

Anant Thaker

Anant Thaker

*   For searches and help try:

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