a) Seed value is used to make sure that the random numbers which
are generated can be reproduced.
The runif function is used to generate 60 random numbers which are
nothing but time values in the range from 0 to 19 which we guess is
for the year from 2000 to 2019.
yvals stores the popularity of movies and it contains the input
from time values i.e. tvals which is multiplied by 2.1, there is a
uniform 50 value added according to the equation( 50 +2.1) which
means that every popularity value will be at least more than 50.
Also rnorm function is used to generate 60 normal numbers with mean
value equal to 0 and a standard deviation equal to 2 and this value
is added to the rest of equation.
b) Code for finding the correlation
cor(tvals,yvals)
The correlation value is 0.9819379
c) No information about the ideas discussed in the course, so skipping this part.
d) For decreasing the correlation values between the two
vectors, the standard deviation value in rnorm function should be
increased. Increasing the standard deviation value in rnorm
function increases the range of data in resultant vector i.e.
yvals.
We uniformly increased the standard variation value in rnorm
argument, the standard deviation value of 16 in rnorm function
generated a correlation value near 0.6.
***New Code***
yvals= 50+ 2.1*tvals +rnorm(60,0,16)
****Output for Correlation**
cor(tvals,yvals)
0.6157614
3. You've just landed an amazing statistics internship at Marvel Comics for the summer. Since everything they...