Using RStudio, find the range, variance, standard deviation, and coefficient of variation of the following data set on the total weight, in kilograms, of ready-to-cook chicken inasal leg quarters sold by a frozen foods retail store during selected days of June and July. Does the sample have outliers? Data: 35.2, 7.0, 24.0, 42.4, 33.0, 27.5, 24.0, 21.0, 8.0, 45.6, 25.9, 14.8, 29.8, 21.0, 17.5, 9.7, 40.0, 18.8, 57.9, 21.0, 12.0, 12.0, 19.6, 51.5, 12.0, 36.8, 13.7, 32.8, 12.0, 10.5, 22.5, 19.5, 37.5, 35.0, 10.5, 33.6, 14.5, 36.5, 17.9, 26.9, 12.0, 41.5

\(~\)

Create the data vector:

totwt <- c(35.2, 7.0, 24.0, 42.4, 33.0, 27.5, 24.0, 21.0, 8.0, 45.6, 25.9, 14.8, 29.8, 21.0, 17.5, 9.7, 40.0, 18.8, 57.9, 21.0, 12.0, 12.0, 19.6, 51.5, 12.0, 36.8, 13.7, 32.8, 12.0, 10.5, 22.5, 19.5, 37.5, 35.0, 10.5, 33.6, 14.5, 36.5, 17.9, 26.9, 12.0, 41.5)

\(~\)

Solving for the range:

Range <- max(totwt)-min(totwt)
pander(Range)

50.9

The range is 50.9 kg.

\(~\)

Generating the variance of the sample:

Variance <- var(totwt)
pander(Variance)

160.7

The variance of the sample of weight measurements is 160.7 \(kg^{2}\).

\(~\)

Generating the standard deviation:

StdDevn1 <- sqrt(Variance)
pander(StdDevn1)

12.68

or, by using the sd function:

StdDevn2 <- sd(totwt)
pander(StdDevn2)

12.68

The standard deviation of the sample of weight measurements is 12.68 kg.

\(~\)

Solving for the Coefficient of Variation:

library(formattable)
meantotwt<- mean(totwt)
CVtotwt <-percent(StdDevn1/meantotwt)
CVtotwt
  [1] 50.95%

The Coefficient of Variation of the sample of weight measurements is 50.95%.