Chapter 3 Quiz 1 (Quiz on Feb 3rd.)

The data on maximum temperature (in Fahrenheit) for 16 days in Santa Cruz are provided below.

\(37.8,52.9,43.7,46,27,81,14,48.5,43.7,45.9,50.3,56,46,43.7,31.2,36.4\)

Exercise 3.1 What is the mean temperature?

By definiction, the sample mean is \[\begin{equation} \bar{X}=\frac{\sum_{i=1}^nx_i}{n}=\frac{37.8+52.9+\cdots+36.4}{16}=44.00625\approx 44.01 \tag{3.1} \end{equation}\]

Exercise 3.2 What is the median temperature?
## [1] 14.0 27.0 31.2 36.4
## [1] 37.8 43.7 43.7 43.7
## [1] 45.9 46.0 46.0 48.5
## [1] 50.3 52.9 56.0 81.0

Therefore, the median is by definition \[\begin{equation} \frac{43.7+45.9}{2}=44.8 \tag{3.2} \end{equation}\]

Exercise 3.3 What is the mode of the sample?
## x
##   14   27 31.2 36.4 37.8 43.7 45.9   46 48.5 50.3 52.9 
##    1    1    1    1    1    3    1    2    1    1    1 
##   56   81 
##    1    1

The mode is 43.7 because it shows up three times.

Exercise 3.4 What is the variance of the sample

By definition, the variance is \[\begin{equation} \begin{split} S^2&=\frac{\sum_{i=1}^n(x_i-\bar{x})^2}{n-1}=\frac{(37.8-44.01)^2+(52.9-44.01)^2+\cdots+(36.4-44.01)^2}{16-1}\\ &\approx 207.538 \end{split} \tag{3.3} \end{equation}\]

Exercise 3.5 What is the coefficient of variation?

By definition, it is

\[\begin{equation} \frac{s}{\bar{x}}\times 100\% = \frac{\sqrt{207.38}}{44.01}\times 100\%\approx 32.73\% \tag{3.4} \end{equation}\]

Exercise 3.6 What is the interquartile range of the sample?

First, compute the first quartile as \[\begin{equation} 1QR=\frac{36.4+37.8}{2}=37.1 \tag{3.5} \end{equation}\] then the third quartile is \[\begin{equation} 3QR=\frac{48.5+50.3}{2}=49.4 \tag{3.6} \end{equation}\] Hence, the interquartile range is \[\begin{equation} IQR=3QR-1QR=49.4-37.1=12.3 \tag{3.7} \end{equation}\]

Exercise 3.7 Using either of the outlier detection method, check if the temperature value 81 is an outlier of this sample.

Method 1: Z-score First compute the z-score as \[\begin{equation} Z=\frac{X-\bar{X}}{S}=\frac{81-44.01}{\sqrt{207.538}}\approx 2.568>2 \tag{3.8} \end{equation}\] This is an outlier!

Method 2: LF/UF The LF is given by \[\begin{equation} LF=Q1−1.5\times IQR=37.1-1.5\times 12.3=18.65 \tag{3.9} \end{equation}\] and the UF is given by \[\begin{equation} UF=Q3+1.5\times IQR=49.4+1.5\times 12.3=67.85 \tag{3.10} \end{equation}\] Because \(81>67.85\), this is an outlier!

Exercise 3.8 Find the correct option in the following multiple choice questions.

  • If a doctor records pain of a patient in the scale of 1-5, he is measuring a variable that is

    1. ordinal

    2. nominal

    3. interval

  • In a city every household has between 1-5 people. The number of people in a household is a variable that is

    1. ordinal

    2. nominal

    3. interval