Rolf, Point taken.
However, some of the variables in the experiment simply don't have data for some of the examples. Since I'm training an SVM that will complain about an NA, how do you suggest I handle this. Imagine a model predicting student performance/grades/whatever. One variable might be "past_gpa". If we have some students with no history, what do you put for that column. NA is more "correct", but won't work with an SVM. I'm always happy to learn... Thanks!!! -N On 8/2/09 4:29 PM, Rolf Turner wrote: > > On 3/08/2009, at 11:14 AM, David Winsemius wrote: > >> >> On Aug 2, 2009, at 7:02 PM, Noah Silverman wrote: >> >>> Hi, >>> >>> It seems as if the problem was caused by an odd quirk of the "scale" >>> function. >>> >>> Some of my data have NA entries. >>> >>> So, I substitute 0 for any NA with: >>> rawdata[is.na(rawdata)] <- 0 >> >> Perhaps this would have done what you intended: >> >> rawdata[is.na(rawdata), ] <- 0 > > I don't think this works at all. E.g.: > > set.seed(42) > junk <- matrix(rnorm(60),12,5) > junk[sample(1:60,14)] <- NA > junk[is.na(junk),] <- 0 # Throws an error. > junk[is.na(junk)] <- 0 # Gives the desired result. >> >> # But this is added _only_ as a matter of coding behavior. See below. > > <snip> > >> The notion of adding zeroes for NA seems "so wrong". And the idea that >> you might get the same results of doing so before scale() as after >> scale() seems additionally bizarre. >> >> >>> >>> VERY strange behavior. >>> >> >> Your behavior might be seen as VERY strange by some. > > I concur, heartily. Conflating NA with 0 is a first year student > error > that is almost never anything other than just plain silly. > > cheers, > > Rolf Turner > > ###################################################################### > Attention: This e-mail message is privileged and confidential. If you > are not the intended recipient please delete the message and notify > the sender. Any views or opinions presented are solely those of the > author. > > This e-mail has been scanned and cleared by MailMarshal > www.marshalsoftware.com > ###################################################################### [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.