Using the chickwts dataframe, compute the 10th, 30th, and 90th percentiles of all the chick weights and then use tapply to determine which feed type is associated with the highest sample variance of weights. Use rStudio and the dataframe provided within rStudio named chickwts
The following codes are run to get the required output:
> attach(chickwts)
The following objects are masked from
chickwts (pos = 3):
feed, weight
The following objects are masked from chickwts (pos = 4):
feed, weight
> data=chickwts
>
quantile(data[,1],c(0.10,0.30,0.90))
10% 30% 90%
153 217 359
>
tapply(data[,1],INDEX=data[,2],FUN=var)
casein horsebean linseed meatmeal
soybean sunflower
4151.720 1491.956 2728.568 4212.091 2929.956 2384.992
Hence, Meatmeal feed type has the highest sample
variance in the data.
I hope this clarifies your doubt. If you're satisfied with the solution, hit the Like button. For further clarification, comment below. Thank You. :)
Get Answers For Free
Most questions answered within 1 hours.