i dont think it works. is there any function in any package?
--
View this message in context:
http://r.789695.n4.nabble.com/Impute-missing-data-by-regression-in-R-tp2996520p4675516.html
Sent from the R help mailing list archive at Nabble.com.
__
R-he
I assume you mean regression of x on y...
here's the code:
missing = is.na(x)
predicted = predict(lm(x~y))
x[missing] = predicted[missing];
Should work but please check.
Peter
On Thu, Oct 14, 2010 at 10:14 PM, Jumlong Vongprasert
wrote:
> Dear all
> I have data (x,y) with data x is missing i
Dear all
I have data (x,y) with data x is missing in 5 record of 100 record.
I want to impute data x by use regression.
How I can do this.
THX
Jumlong
--
Jumlong Vongprasert Assist. Prof.
Institute of Research and Development
Ubon Ratchathani Rajabhat University
Ubon Ratchathani
THAILAND
34000
3 matches
Mail list logo