In: Statistics and Probability
The following table contains cholesterol levels of 32 people. Determine if the sample comes from a population that is normally distributed. Draw a histogram, identify potential outliers, and draw the normality plot.
160 |
200 |
172 |
196 |
170 |
181 |
190 |
185 |
210 |
180 |
162 |
184 |
185 |
212 |
186 |
182 |
260 |
175 |
203 |
181 |
190 |
203 |
184 |
193 |
199 |
160 |
210 |
204 |
198 |
188 |
201 |
190 |
Sol:
load the data a vector in R.
use mean,median functions to get the mean and median of sample.
use hist function in R to get the histogram.
qqnorm and qqline to get the normal probbaility plot.
use boxplot function to know whether outliers exists
Rcode is
cholesterollevels <- c(160, 200,
172 ,196 ,170, 181
,190 ,185,
210 ,180, 162 ,184,
185 ,212, 186, 182,
260 ,175, 203, 181
,190, 203, 184 ,193,
199 ,160 ,210, 204
,198, 188 ,201, 190)
mean(cholesterollevels)
median(cholesterollevels)
hist(cholesterollevels)
qqnorm(cholesterollevels)
qqline(cholesterollevels)
boxplot(cholesterollevels,col="darkgreen",main="boxplot")
fivenum(cholesterollevels)
Output:
> mean(cholesterollevels)
[1] 190.4375
> median(cholesterollevels)
[1] 189
fivenum(cholesterollevels)
[1] 160.0 181.0 189.0 200.5 260.0
Intrepretation:
For the given sample
mean=190.4375
median=189
mean>median
distribution is positively skewed.
frm qqplot alos we can see that the sample point are not exactly conforms to straight line.
There are deviations and confroms to skewed distribution .
sample does not follow normal distribution
From box plt we get fivenumber summary as
minimum value=160
Q1=181.0
Q2=189.0
Q3= 200.5
maximum=260
There exists one outlier and is at 260