Geoscience Reference
In-Depth Information
ans =
5.9741
v(find(n == max(n)))
ans =
6.5800
h e mean of the data is lower than the median, which is in turn lower than
the mode. We can observe a strong negative skewness, as expected from our
data.
skewness(sodium)
ans =
-1.1086
We now introduce a signii cant outlier to the data and explore its ef ect on
the statistics of the sodium content. For this we will use a dif erent data set
that is better suited to this example than the previous data set. h e new data
set contains higher sodium values of around 17 wt% and is stored in the i le
sodiumcontent_two.txt .
clear
sodium = load('sodiumcontent_two.txt');
h is data set contains only 50 measurements, in order to better illustrate the
ef ects of an outlier. We can use the same script used in the previous example
to display the data in a histogram with seven classes, and to compute the
number of observations n in each of the classes v .
h = histogram(sodium,7)
v = h.BinWidth * 0.5 + h.BinEdges(1:end-1)
n = h.Values
v =
Columns 1 through 4
13.5500 14.2500 14.9500 15.6500
Columns 5 through 7
16.3500 17.0500 17.7500
n =
1 3 3 6 6 15 16
mean(sodium)
ans =
16.6379
Search WWH ::




Custom Search