In: Math
65 68 58 57 71 61 60 67 66 72
60 62 54 57 61 54 55 58 61 55
64 66 56 61 51 83 57 55 58 59
61 55 66 55 58 52 75 67 64 56
55 58 50 62 63 67 57 54 55 63
a. Find the mean, median and mode.
b. Find the range, variance, and standard deviation.
c. Find the lower quartile, upper quartile, and inter-quartile range
2- For the same data set as Problem 1, are there outliers in the data? Justify your conclusion using;
R-Code
x=c(65,68,58,57,71,61,60,67,66,72,60,62,54,57,61,54,55,58,61,55,64,66,56,61,51,83,57,55,58,59,61,55,66,55,58,52,75,67,64,56,55,58,50,62,63,67,57,54,55,63)
summary(x)
OUTPUT
> summary(x)
Min. 1st Qu. Median Mean 3rd Qu. Max.
50.00 55.25 59.50 60.50 64.00 83.00
a) Mean= 60.50, Median= 59.50
code for
mode
Mode = function(x)
{
ta = table(x)
tam = max(ta)
mod = as.numeric(names(ta)[ta == tam])
return(mod)
}
Mode(x)
output
> Mode(x)
[1] 55
b) Range = MAX- MIN = 83- 50 =33 (from summary statistics)
R-Code
var(x)
sd(x)
output
> var(x)
[1] 41.43878
> sd(x)
[1] 6.437296
variance=41.43878
standard deviation= 6.437296
c) From the summary Statistics
lower Quartile: 55.25
upper Quartile: 64.00
Inter-Quartile Range: upper Quartile-lower Quartile = 64.00-55.25= 8.75
2) a) Boxplot
from the boxplot its evident that there is one outlier beyond 80 i.e 83.
b) Empirical Rule: Approximately 99.7% of the data falls within three standard deviations of the mean. The following notation is used to represent this fact: μ ± 3σ
R-Code
length(x)
0.997*length(x)
mean(x)+(3*sd(x))
mean(x)-(3*sd(x))
OUTPUT
> length(x)
[1] 50
> 0.997*length(x)
[1] 49.85
> mean(x)+(3*sd(x))
[1] 79.81189
> mean(x)-(3*sd(x))
[1] 41.18811
again it is
evident that there is only one value beyond this range that is 83.
which can be treated as an outlier.