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

RE: st: Regressing with variables with missing values


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: Regressing with variables with missing values
Date   Sun, 6 Nov 2005 22:56:26 -0000

I've not used -ice- myself: I just recommend it! 

However, a quick glance suggests that you 
are misunderstanding the syntax. It may be 
that what you want is something more like

uvis regress happy ln_pcy02 r_health male divorced widowed, 
gen(HAPPY) 

Nick 
[email protected] 

Ramani Gunatilaka

> I have been following up on all the useful comments I got and have
> been working on that ice thing to replace missing values.
> Unfortunately the programme goes through the motions but doesn't
> replace any missing values. I am at my wit's end. The dependent
> variable and the one that has missing values is happy (which takes the
> values 1-5 depending on level of happiness (the data set as a whole
> has 6805 observations), and my code runs like this.
> 
> use uphvar02, clear
> 
> . ice happy ln_pcy02 r_health male divorced widowed using uricevar02,
> cmd(regress) eq(happy: ln_pcy02 r _health male divorced widowed)
> genmiss(M1) id(flag1) replace
> 
> This is my output:
> 
>     Variable | Command     | Prediction equation
> -------------+-------------+----------------------------------
> ----------------
>        happy | regress     | ln_pcy02 r_health male divorced widowed
>     ln_pcy02 | regress     | [No missing data in estimation sample]
>     r_health | regress     | [No missing data in estimation sample]
>         male | regress     | [No missing data in estimation sample]
>     divorced | regress     | [No missing data in estimation sample]
>      widowed | regress     | [No missing data in estimation sample]
> 
> Imputing
> [Only 1 variable to be imputed, therefore no cycling needed.]
> 1..file uricevar02.dta saved
> 
> . sort city province hhid
> 
> . compress
> 
> . save uricevar02, replace
> file uricevar02.dta saved.
> end of do-file
> 
> But when I check - here's what I get. Missing values still there.
> 
> . count if happy==.
>    65
> 
> Does anybody have any ideas as to what might be going wrong?

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