# 8 Exercise 4: Transformation of the response and predicator

The Animals data set which pertains to Brain and Body Weights for 28 Species. You can get this data set using the library(Mass)

In this dataset there are three outliers which are the dinosaurs.
(a) Sort the data by body and remove the last three dinosaur elements using the following code:

SA <- Animals[order(Animals\$body), ] #sorted by body weight
NoDINO <- SA[-c(28:26), ] #remove dinosaurs

Now treating the data as we done in the previous exercise transform both the response and predictor:
(b) Define a linear model for the transformed response and transformed predictor .

model1 <- lm(log(brain) ~ log(body), data = NoDINO)

(c) Use the function coef() to answer the below questions:

coef(model1)
## (Intercept)   log(body)
##   2.1504121   0.7522607

i. What is the predicted brain weight of the jaguar whose weight is listed as 100 kg?

Log(Brain weight) = + ( $$\cdot$$ log()) = .

This must be back transformed to get the units of original brain measurement (grams).
Brain weight = $$exp($$$$)$$ = g

Log(Brain weight) = $$2.1504$$ + ($$0.7523$$ $$\cdot$$ $$log(100) = 5.6149$$. Back-transforming with exponential menas Brain weight = $$exp(5.6149)$$ = $$274.48$$g

ii. If said jaguar were to increase its weight by 10%, what would the expected increase in brain weight be?

"With the coefficient of , an increase in body weight of 1% would lead to % increase in brain weight. * = g"

"With the coefficient of $$0.7523$$, an increase in body weight of 1% would lead to $$7.523$$% increase in brain weight. so $$1.07523 * 274.48$$ = $$295.0634$$g