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/