title: R Notebook
output: html_notebook
`{r include=FALSE}
if(!require(tidyverse)) install.packages(tidyverse)
if(!require(car)) install.packages(car)
library(tidyverse)
library(car)
`
# Question [10 marks]
Suppose the average weight of cats (in grams) is approximated well by the normal distribution N(=478,=23). Also, suppose that the average weight of dogs (in grams) is approximated well by the normal distribution N(=1450,=153). Two animals are selected at random, a cat C weighing 432 grams, and a dog D weighing 1123 grams. State, showing your working out, which one of these two animals have more unusual weight.
# Solutions
`{r}
calc_animal_z_score <- function(X,,) {animal_nd <- (X-) / return (animal_nd)}# comparisonC <- calc_animal_z_score(X=432, =478, =23)D <- calc_animal_z_score(X=1123, =1450, =153)print(C)print(D)“`Conclusion:According to the calculate above, because |D| = 2.137255 > |Z_1| = 2,we can found that *the dog D* is more unusual than *the cat C*
Reviews
There are no reviews yet.