In: Statistics and Probability
8. What are the species in the event that the ratio of brain weight to body weight is greater than 0.02? Remember that brain weight is recorded in grams and body weight in kilograms, so body weight must be multiplied by 1000 to make the two weights comparable. The species belonging to this event can be obtained with the R command > subset(mammals,brain/body/1000 > 0.02) What is the probability of that event?
ANSWER::
8) R code with comments
---
#part 8)
#the species in the event that the ratio of brain weight to body
weight is greater than 0.02
subset(mammals,brain/(body*1000) > 0.02)
#the probability of that event
prob<- sum(brain/(body*1000) > 0.02)/length(body)
sprintf('The probability that randomly selected species has a ratio
of brain to body weight greater than 0.02 is %.4f',prob)
---
get this
ans: the species in the event that the ratio of brain weight to body weight is greater than 0.02 are
ans:
---All code (for this parts
#load the library MASS
library(MASS)
#load the dataset mammals
data(mammals,package='MASS')
#attach the dataset mammals
attach(mammals)
#part 8)
#the species in the event that the ratio of brain weight to body
weight is greater than 0.02
subset(mammals,brain/(body*1000) > 0.02)
#the probability of that event
prob<- sum(brain/(body*1000) > 0.02)/length(body)
sprintf('The probability that randomly selected species has a ratio
of brain to body weight greater than 0.02 is %.4f',prob)
NOTE:: I HOPE YOUR HAPPY WITH MY ANSWER....***PLEASE SUPPORT ME WITH YOUR RATING...
***PLEASE GIVE ME "LIKE"...ITS VERY IMPORTANT FOR ME NOW....PLEASE SUPPORT ME ....THANK YOU