outliers may sometimes make a scatter plot less understandable. when using scatterplotMatrix, is it possible to automatically remove them? [[alternative HTML version deleted]]
Dear Roberto, This is, I assume, the scatterplotMatrix() function in the car package. There is no option for automatically removing outliers, although the various options for labeling points should help you identify them. If you want to remove outliers once identified, you could use the subset argument to scatterplotMatrix(), much as you would for a statistical modeling function, as long as the variables in the scatterplot matrix are specified in a formula. For example, scatterplotMatrix(~ income + education + prestige, data=Duncan, id.n=2) identifies the two most noteworthy points in each panel (as explained in ?scatterplotMatrix), while scatterplotMatrix(~ income + education + prestige, data=Duncan, subset= -c(6, 16)) removes cases 6 and 16. I hope this helps, John ------------------------------------------------------- John Fox, Professor McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/> -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Pagliari, > Roberto > Sent: March-19-15 11:07 AM > To: r-help at r-project.org > Subject: [R] remove outliers with scatterplotMatrix > > outliers may sometimes make a scatter plot less understandable. > > when using scatterplotMatrix, is it possible to automatically remove them? > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.--- This email has been checked for viruses by Avast antivirus software. http://www.avast.com
Thank you John, I will try that one. Bob, ________________________________________ From: John Fox [jfox at mcmaster.ca] Sent: Thursday, March 19, 2015 2:08 PM To: Pagliari, Roberto Cc: r-help at r-project.org Subject: RE: [R] remove outliers with scatterplotMatrix Dear Roberto, This is, I assume, the scatterplotMatrix() function in the car package. There is no option for automatically removing outliers, although the various options for labeling points should help you identify them. If you want to remove outliers once identified, you could use the subset argument to scatterplotMatrix(), much as you would for a statistical modeling function, as long as the variables in the scatterplot matrix are specified in a formula. For example, scatterplotMatrix(~ income + education + prestige, data=Duncan, id.n=2) identifies the two most noteworthy points in each panel (as explained in ?scatterplotMatrix), while scatterplotMatrix(~ income + education + prestige, data=Duncan, subset= -c(6, 16)) removes cases 6 and 16. I hope this helps, John ------------------------------------------------------- John Fox, Professor McMaster University Hamilton, Ontario, Canada http://socserv.mcmaster.ca/jfox/> -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Pagliari, > Roberto > Sent: March-19-15 11:07 AM > To: r-help at r-project.org > Subject: [R] remove outliers with scatterplotMatrix > > outliers may sometimes make a scatter plot less understandable. > > when using scatterplotMatrix, is it possible to automatically remove them? > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.--- This email has been checked for viruses by Avast antivirus software. http://www.avast.com
On Mar 19, 2015, at 8:06 AM, Pagliari, Roberto wrote:> outliers may sometimes make a scatter plot less understandable. > > when using scatterplotMatrix, is it possible to automatically remove them?I've known people who set values to NA that are outside some predefined threshold such as less than the .05th percentile (the .0005th quantile) and the 99.95th percentile at the high end. I'm not so eager to "erase" values at either end, but there would be automated ways of doing that on a copy of the data. Post a better description of the data problem.> > > [[alternative HTML version deleted]]And learn to configure your email client to post in plain text. and read the material mentioned below.> > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.David Winsemius Alameda, CA, USA