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

Re: st: Averages for missing values


From   Richard Williams <[email protected]>
To   [email protected]
Subject   Re: st: Averages for missing values
Date   Thu, 08 Sep 2005 17:28:18 -0500

At 03:45 PM 9/8/2005, TinnaLaufey Asgeirsdottir wrote:
Hello Statalist.

Before I give myself carpal tunnel syndrome I might ask:

Is there a command to replace missing values with averages?

What I am currently doing is:

generate varnameAVE=varname
summarize varnameAVE
replace varnameAVE=[here I use the mouse to copy from the results
window to the command window] if varnameAVE==.
Adding to your list of suggestions: try the -impute- command, e.g.

gen one = 1
impute varname one, gen(varnameAVE)

For other variations (e.g. subgroup means) see p. 10 and later of

http://www.nd.edu/~rwilliam/stats2/l12.pdf

Let me add that this may be showing you how to do evil, however; most of these sorts of methods are now frowned upon. See Paul Allison's Sage book entitled "Missing Data". You may wish to check out Patrick Royston's -ice- package, which is also discussed in Stata Journal, V. 5 # 2, pp. 188-201.


-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc
*
* 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