Two questions related to boxplot
:
na.action
? The documentation doesn't list them.Sample size (n) The sample size can affect the appearance of the graph. For example, although these boxplots seem quite different, both of them were created using randomly selected samples of data from the same population.
Box plots are used to show distributions of numeric data values, especially when you want to compare them between multiple groups. They are built to provide high-level information at a glance, offering general information about a group of data's symmetry, skew, variance, and outliers.
Extreme outliers are marked with an asterisk (*) on the boxplot. Mild outliers are data points that are more extreme than than Q1 - 1.5 * IQR or Q3 + 1.5 * IQR, but are not extreme outliers.
A possible approach is to thicken appropriate vertical lines in the box. Thus, if a distribution is right skewed, replace the edge of the box denoting the lower quartile by a thick line. If it is left skewed, thicken the edge corresponding to the upper quartile. If it is bimodal, thicken both edges.
In general, I find the built-in help to be pretty good. You're right though that the help page for boxplot
mentions na.action
without stating what the options are.
In this instance, ?na.action
and -- following on from there -- ?na.omit
explain the possibilities (these are quite general and also apply to things other than boxplot
.)
Handle Missing Values in Objects
Description:
These generic functions are useful for dealing with ‘NA’s in e.g.,
data frames. ‘na.fail’ returns the object if it does not contain
any missing values, and signals an error otherwise. ‘na.omit’
returns the object with incomplete cases removed. ‘na.pass’
returns the object unchanged.
Usage:
na.fail(object, ...)
na.omit(object, ...)
na.exclude(object, ...)
na.pass(object, ...)
Arguments:
object: an R object, typically a data frame
...: further arguments special methods could require.
Details:
At present these will handle vectors, matrices and data frames
comprising vectors and matrices (only).
If ‘na.omit’ removes cases, the row numbers of the cases form the
‘"na.action"’ attribute of the result, of class ‘"omit"’.
‘na.exclude’ differs from ‘na.omit’ only in the class of the
‘"na.action"’ attribute of the result, which is ‘"exclude"’. This
gives different behaviour in functions making use of ‘naresid’ and
‘napredict’: when ‘na.exclude’ is used the residuals and
predictions are padded to the correct length by inserting ‘NA’s
for cases omitted by ‘na.exclude’.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With