Re: [R] Impute missing data by regression in R

2013-09-06 Thread gaofield
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

Re: [R] Impute missing data by regression in R

2010-10-14 Thread Peter Langfelder
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

[R] Impute missing data by regression in R

2010-10-14 Thread Jumlong Vongprasert
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