perhaps this may work:
gen varnameAVE = varname
su varnameAVE, meanonly
replace varnameAVE=r(mean) if varname==.
hope this helps,
--clint
> 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==.
>
> Thanks
> Tina
>
> *
> * 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/