Practice Set 01

Exercise: Properties of summations

Let \(X\) and \(Y\) be variables indexed by \(t=1,\ldots,n\). Let \(a\) and \(b\) be constants. Then, it can be proven that (but you don’t have to for this exercise):

\[ \sum_{t=1}^n b = nb \tag{1}\]

\[ \sum_{t=1}^n aX_t = a\sum_{t=1}^n X_t \tag{2}\]

\[ \sum_{t=1}^n \left(X_t+Y_t\right) = \sum_{t=1}^n X_t + \sum_{t=1}^n Y_t \tag{3}\]

In the following, make sure to cite which of the properties you have used (labels for the properties are available).

  1. Prove that \[ \sum_{t=1}^n \left(aX_t+bY_t\right) = a\sum_{t=1}^n X_t + b\sum_{t=1}^n Y_t \]

  2. Let \(\overline{X}\) and \(\overline{Y}\) be the corresponding means of both sets of variables. Prove that you have three ways of expressing the following sum: \[ \begin{eqnarray} \sum_{t=1}^n \left(X_t-\overline{X}\right)\left(Y_t-\overline{Y}\right) &=& \sum_{t=1}^n \left(X_t-\overline{X}\right)Y_t \\ &=& \sum_{t=1}^n X_t\left(Y_t-\overline{Y}\right) \\ &=& \sum_{t=1}^n X_tY_t -n\overline{X}\cdot\overline{Y} \end{eqnarray} \]

Exercise: Effects of linear transformations

Suppose we have a variable represented by \(X\) and the \(t\)th observation is given by \(X_t\) for \(t=1, 2,\ldots, n\). Let \(Y_t=aX_t+b\), where \(a\) and \(b\) are constants. Let \(\overline{X}\) and \(\overline{Y}\) be the corresponding means of both sets of variables.

  1. Is \(Y_t\) a linear transformation of \(X_t\)? Explain.
  2. If \(Y_t\) is obtained by standardizing \(X_t\), what would \(a\) and \(b\) be equal to?
  3. Show that, in general, we must have \[\begin{eqnarray}\overline{Y} &=& a\cdot \overline{X} + b \\ \frac{1}{n}\sum_{t=1}^n \left(Y_t-\overline{Y}\right)^2 &=& a^2\cdot \frac{1}{n} \sum_{t=1}^n \left(X_t-\overline{X}\right)^2\end{eqnarray}\]
  4. If \(Y_t\) is obtained by standardizing \(X_t\), use the previous items to find the mean and the standard deviation of the \(Y_t\)’s.

Exercise: Regression with only an intercept

You are going to be working out the details of regression with only an intercept. Let \(Y_t\) be the \(t\)th observation of the regressand.

Since our regression line for this case is just \(\widehat{Y}_t=\widehat{\beta}_0\), where \(\widehat{\beta}_0\) is just some constant to be determined, you should be able to use what you learned in mathematical economics to minimize \[\sum_{t=1}^n \left(Y_t-\widehat{Y}_t\right)^2=\sum_{t=1}^n \left(Y_t-\widehat{\beta}_0\right)^2=\sum_{t=1}^n Y_t^2-2\widehat{\beta}_0\sum_{t=1}^n Y_t+n\widehat{\beta}_0^2 \tag{4}\] with respect to \(\widehat{\beta}_0\).

  1. Provide the details as to how to obtain the expression after the second equality sign in Equation 4.
  2. Find the optimal value of \(\widehat{\beta}_0\).
  3. Given #2, what is the minimized value of Equation 4? Is there a known name for this quantity?
  4. What will be the fitted values for each observation in this case?
  5. What will be the residuals for each observation in this case?
  6. What will be the average of the fitted values? Prove your finding.
  7. What will be the average of the residuals? Prove your finding.

Exercise: Linear regression with linearly transformed variables

Suppose a linear regression of \(Y\) on \(X\) (with an intercept) was computed. As always, let \(X_{t}\) and \(Y_t\) be the \(t\)th observation of the regressand and the regressor, respectively, for \(t=1, 2,\ldots, n\).

Suppose we linearly transformed the data. Let \(W_t=aX_{t}+b\), where \(a\) and \(b\) are constants. In addition, let \(Z_t=cY_t+d\), where \(c\) and \(d\) are constants.

  1. Write down the formula or expression for the regression slope for the linear regression of \(Y\) on \(X\) in this context. There is no need to derive it.
  2. After transforming both \(X_1\) and \(Y\) to \(W\) and \(Z\), respectively, write down the formula or expression for the regression slope for the linear regression of \(Z\) on \(W\) in this context. There is no need to derive it.
  3. Focus on the formulas in items #1 and #2. Which of the results from the previous exercises can you use and modify appropriately to determine, after transforming both \(X_1\) and \(Y\) to \(W\) and \(Z\), respectively, how the regression slope in #2 is related to the regression slope in #1.

Exercise: True or false.

If the statement is true, provide an argument as to why the statement is true. If the statement is false, provide an argument or an example which will demonstrate that the statement is indeed false.

  1. Regression analysis requires several values of the response for each value of the predictor so that we can calculate averages for each \(x\).
  2. If the correlation between the regressor and the regressand is zero, then the slope will also be zero.
  3. The use of a linear regression to describe the relationship between price and sales implies that we expect equal differences in sales when comparing periods with prices 10 dollars and +11 dollars and periods with prices 20 dollars and 21 dollars.
  4. The horizontal distance between \(y\) and \(\widehat{y}\) is known as the residual and so takes its units from the regressor.
  5. In a plot of income (the regressand) versus education (the regressor) for managers, managers with the lowest levels of education are at the right-hand side of the figure.
  6. An accountant at a retail shopping chain accidentally calculated the correlation between the phone number of customers and their outstanding debt. He should expect to find a substantial positive correlation.
  7. The boxplot shows the mean plus or minus one standard deviation of the data.
  8. Any data outside the box of the boxplot are outliers and should be removed from the data.
  9. If data are right skewed, the mean is larger than the median.
  10. The Empirical Rule indicates that the range from \(\overline{y} - s_y\) up to \(\overline{y} + s_y\) holds two-thirds of the distribution of any numerical variable.
  11. If a distribution is bell shaped, then about 5% of the \(z\)-scores are larger than \(1\) or less than \(-1\).
  12. The removal of an outlier with \(z = 3.3\) causes both the mean and the SD of the data to decrease.
  13. The interquartile range of a distribution is half the range from the smallest to largest value.
  14. If the standard deviation of a variable is 0, then the mean is equal to the median.
  15. The variance of a variable increases as the number of observations of the variable increases.
  16. The median and the average of any list of numbers are always close together.
  17. Half of a list of numbers is always below average.
  18. If two lists of numbers have exactly the same average of 50 and the same standard deviation of 10, then the percentage of entries between 40 and 60 must be exactly the same for both lists.

Exercise: Short response questions

  1. An analyst estimated the regression line \(\widehat{y}=4-3x\). True or false or uncertain, and then give a short explanation of your choice.

    1. \(x\) and \(y\) are negatively correlated.
    2. \(x\) and \(y\) have a correlation coefficient of \(-0.8\).
  2. Suppose \(x\) and \(y\) have a correlation coefficient of \(-0.8\).

    1. Does the scatter diagram slope up or down?
    2. If you multiply all the values of \(y\) by -1, would the new scatter diagram slope up or down?
    3. If you multiply all the values of \(y\) by -1, what happens to the correlation?
  3. An analyst finds that years of education and age have a correlation coefficient of \(-0.2\) in his dataset. The average age is 48 years and the average years of education is 12 years. With this information, can the analyst predict the years of education of someone who is one standard deviation below the average age? If he can, find the predicted years of education. If he cannot, what is the most that he can conclude from the information available to him and what additional information will he need to make the prediction?

  4. A study is made of the age at entrance of college freshmen. The standard deviation turned out to be one of the following: 1 month, 1 year, or 5 years. Which was it and why?

  5. A printout contains 80 numbers that have been standardized. The first ten numbers were \[-6.2,3.5,1.2,-0.13,4.2,-5.1,-7.2,-11.3,1.8,6.3\] Is anything wrong?

Exercise: Histograms and the information they contain

The figure below is a histogram for the scores on the final exam in a certain class. The histogram was drawn on a density scale. The vertical axis is not marked with numbers at all but is divided into 8 equal parts. Observe that the horizontal axis is not divided into equal parts, but this should not be a hurdle.

  1. What is the length of each equal part of the vertical axis?

  2. Compute the exact IQR for the scores.

  3. Pick the SD of the scores: 5, 15, 25. Explain your choice. (You do not need to actually compute the exact SD to select from these three choices.)

Exercise: Airplay and sales

Each week the music industry magazine Billboard publishes lists of the most popular songs from the last week. The songs are ranked in various categories of interest to radio station DJs, music recording industry executives and, of course, the general public.

The “Hot 100 Airplay” list ranks the songs in terms of the amount of airplay that they receive at radio stations over the last week. The data are compiled based on a national sample of 194 stations electronically monitored 24 hours per day.

The “Hot 100 Singles Sales” list ranks the songs in terms of the number of sales of singles (records and compact disks) in the last week. The data are compiled from a national sample of point-of-sales equipped retail stores. Both lists provide the ranking of the song on the list from the previous week and the number of weeks that the song has been on the list. The music industry (i.e., recording, radio and television) uses this information to track trends and guide airplay.

Despite the names of these lists, each contains only the highest ranked 75 songs.

As we wish to compare the songs in terms of airplay and sales, we will only consider the songs that are on both lists. The data are the 44 songs on both lists for the week ending September 10, 1994.

One useful measure of the change in sales of a song is the change in ranking of the song on the “Hot 100 Singles Sales” list this week from last week (positive values mean that the song is ranked higher this week than last week). Similarly we can measure the change in airplay of a song by the change in ranking of the song on the “Hot 100 Airplay” list this week from last week.

The variables are:

  • Title: Title of the song
  • Sales: Rank in terms of “Hot 100 Singles Sales” list in the week of September 10, 1994
  • SalesLst: Rank in terms of “Hot 100 Singles Sales” list in the previous week
  • Play: Rank in terms of “Hot 100 Airplay” list in the week of September 10, 1994
  • PlayLst: Rank in terms of “Hot 100 Airplay” list in the previous week
  • SalesWk: The number of weeks the song is in the “Hot 100 Singles Sales” list, as of September 10, 1994
  • PlayWk: The number of weeks the song is in the “Hot 100 Airplay” list, as of September 10, 1994

The data can be downloaded here.

Use R (or at least figure out what commands will be most useful) in order to answer the following questions1:

  1. Explore the data and explain how the variables XPlay and XSales were created given the information in this exercise.
  2. Describe the relationship between the amount of airplay a song receives and the retail sales of that song in a given week.
  3. Do songs that receive more airplay in a previous week sell more this week? Support your claim.
  4. Is there a relationship between the change in sales of a song and the change in airplay? Do some songs appear to be different? Support your claims.
  5. How does the change in sales of a song depend on the number of weeks that it has been on the chart? How does the change in airplay of a song depend on the number of weeks that it has been on the chart?

Footnotes

  1. In an exam, you may be given a list of commands with some output. You may also be asked to supply the appropriate commands in order to conduct a requested analysis or an analysis which is appropriate for the exercise.↩︎