I need help doing this I'm really bad at getting the a and be. can you answer and explain
a)
R software is used
x is Area and y is Number of Species
> x=c(3,13,104,8816,11669,77793,103723)
> y=c(3,5,9,40,39,84,76)
> plot(x,y,type='l')
Make log transformation on both x and y i.e. Area and Number of Species respectively.
> log_y = log(y)
> log_x=log(x)
> plot(log_x,log_y,type='l')
>
This shows there is linear relationship between log(x) and log(y).
b)
Fit linear regression model on log(x) and log(y).
log(x) is independent variable i.e. regressor.
log(y) is dependent variable i.e. response.
> model=lm(log_y~log_x)
> model
Call:
lm(formula = log_y ~ log_x)
Coefficients:
(Intercept) log_x
0.7615 0.3165
Linearizable function for this model is
From this we conclude that our model is log(y) = log() + *log(x)
> predict=predict(model,data.frame(log_x=log(436)))
> predict
2.685127 This is value for log(y) i.e. log(Martinique)
For finding value of Martinique
exponential(log(Martinique))
> exp(predict)
14.66007
Therefore For Martinique number of Species = 14.66007
I need help doing this I'm really bad at getting the a and be. can you...