Midterm 1 Extra Questions

Questions from Recent Material

Extra Questions from Chapter 8: 1, 2, 3, 4

Additional Questions

    1. What would be the result from running the following code?

      all( c(1,2,3,4,5) > 0)
    2. Consider the following function

      a_function <- function(n) {
        out <- 0
        for (i in 1:n) {
          out <- out + i^2
        }
        out
      }

      If you run the following code, what will it output?

      a_function(5)
  1. Suppose there are two random variables X and Y.

    1. If you know that X and Y are independent, do you know what their covariance is equal to? Explain. If yes, what is the covariance equal to?

    2. If you know that cov(X,Y)=0, are X and Y independent? Explain.

    3. If you know that cov(X,Y)=1, are X and Y independent? Explain.

  2. Suppose that X1 and X2 are two random variables such that E[X1]=0, E[X2]=5, var(X1)=1, var(X2)=10 and cov(X1,X2)=1. Suppose that Y=X1+X2.

    1. What is E[Y]?

    2. What is var(Y)?

  3. Consider a random variable Y that is equal to a firm’s profits (in thousands of dollars) and another random variable X that is equal to firm’s number of employees. Suppose you know that E[Y|X=x]=50+10x

    1. Explain how to interpret E[Y|X=x].

    2. What is E[Y|X=10]?

    3. Suppose that var(Y)=40, E[X]=30, and var(Y)=20, calculate E[Y].

  4. Suppose that we have a random sample of n observations of X and Y.

    1. Suppose that you want to estimate the covariance between X and Y using the data that we have. Propose an estimator for the covariance. Hint: Try using the analogy principle and the expression cov(X,Y)=E[XY]E[X]E[Y].

    2. Alternatively, the definition of covariance is cov(X,Y)=E[(XE[X])(YE[Y])]. Propose an estimator for the covariance based on this expression. Would you expect this to give you the same estimate of the covariance as in part a?