Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Amherst College Department of Economics Economics 360 Fall 2012 Problem Set Solutions: Monday, September 10 1. Consider the inches of precipitation in Amherst, MA during 1964 and 1975: Year 1964 1975 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 5.18 2.32 2.71 2.72 0.83 1.84 3.02 3.01 0.94 1.32 1.68 3.98 4.39 3.04 3.97 2.87 2.10 4.68 10.56 6.13 8.63 4.90 5.08 3.90 Precipitation Histogram for 1964 Number of Months 3 2 1 0-1 1-2 2-3 3-4 4-5 5-6 6-7 7-8 8-9 9-10 10-11 8-9 9-10 10-11 Inches Precipitation Histogram for 1975 Number of Months 3 2 1 0-1 a. 1-2 2-3 3-4 4-5 5-6 6-7 7-8 Inches Focus on the two histograms you constructed in exercise 1. Based on the histograms, in which of the two years is the distribution 1) center greater (further to the right)? 1975 2) spread greater? 1975 b. For each of the two years, use your statistical software to find the mean and the sum of squared deviations. Report your answers in the table below: 1964 1975 Mean 2.46 5.02 Sum of Squared Deviations 17.73 64.91 2 Getting Started in EViews The Amherst weather data are stored in the EViews Amherst Weather workfile that is posted on our course web site. To open the workfile and access these data: • First, click inside the EViewsLink red box: [Link to MIT-AmherstWeather-1901-2000.wf1 goes here.] and then: • In the File Download window: Click Open. (Note that different browsers may present you with a slightly different screen to open the workfile.) Instruct EViews to calculate the means and sum of squared deviations: • In the Workfile window: Highlight year by clicking on it; then, while depressing <Ctrl>, click on month and precip to highlight them also. • In the Workfile window: Double click on any of the highlighted variables. • A new list now pops up: Click Open Group. A spreadsheet including the variables Year, Month, and Precip for all the months appears. • In the Group window: Click View; then click Descriptive Stats, and then Individual 1 Samples. Descriptive statistics for all the months of the twentieth century now appear. We only want to consider one year at a time. We want to compute the statistics for 1964 and then for 1975. Let us see how to do this: o In the Group window: Click Sample. In the Sample window: Enter year=1964 in the “If condition (optional)” text area to restrict the sample to 1964 only. Click OK. Descriptive statistics for 1964 appear in the Group window. Record the mean and sum of squared deviations for 1964. o In the Group window: Click Sample. In the Sample window: Enter year=1975 in the “If condition (optional)” text area to restrict the sample to 1975 only. Click OK. Descriptive statistics for 1975 appear in the Group window. Record the mean and sum of squared deviations for 1975. Last, do not forget to close the file: • In the EViews window: Click File, then Exit. • In the Workfile window: Click No in response to the save changes made to workfile. 1 Common sample eliminates all observations in which there is one or more missing value in one of the variables; the individual samples option does not do so. Since no values are missing for 1964 and 1975, the choice of common or individual has no impact. 3 c. Using your answers to part b and some simple arithmetic (division), compute the variance for each year: 1964 1975 Variance 1.48 5.41 d. Are your answers to parts b and c consistent with your answer to part a? Explain. Yes, the answers are consistent. The histogram reveals that the • center of the distribution was higher in 1975 which is consistent with a higher mean for 1975. • spread of the distribution was higher in 1975 which is consistent with a higher variance for 1975. 3. Focus on precipitation in Amherst, MA in 1975. Consider a new variable, TwoPlusPrecip, that equals two plus each month’s precipitation: TwoPlusPrecip = 2 + Precip. 1975 Precip TwoPlusPrecip a. Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec 4.39 3.04 3.97 2.87 2.10 4.68 10.56 6.13 8.63 4.90 5.08 3.90 6.39 5.04 5.97 4.87 4.10 6.68 12.56 8.13 10.63 6.90 7.08 5.90 The histograms of each variable Precip and TwoPlusPrecip, appear below: Precipitation Histogram for 1975 Number of Months 3 2 1 0-1 1-2 2-3 3-4 4-5 5-6 6-7 7-8 8-9 9-10 10-11 Inches Two Plus Precipitation Histogram for 1975 Number of Months 3 2 1 0-1 1-2 2-3 3-4 4-5 5-6 6-7 7-8 8-9 9-10 10-11 11-12 12-13 Inches 4 1) How are the histograms related? The histograms have identical shape. The TwoPlusPrecip histogram is just “slided” 2 inches to the right. 2) What happened to the distribution center? The center has risen (shifted to the right) by 2 inches. 3) What happened to the distribution spread? The spread is unchanged. b. Consider the equations that describe mean and variance of a constant plus a variable: Mean[c + x] = c + Mean[x] Var[c + x] = Var[x] Based on these equations and the mean and variance of Precip in 1975, what is the 1) mean of TwoPlusPrecip in 1975? 7.02 Mean[TwoPlusPrecip] = Mean[2 + Precip] = 2 + Mean[Precip] = 2 + 5.02 = 7.02 2) variance of TwoPlusPrecip in 1975? 5.41 Var[TwoPlusPrecip] = Var[2 + Precip] = Var[Precip] = 5.41 c. Using your statistical package, generate a new variable: TwoPlusPrecip = 2 + Precip. What is the 1) mean of TwoPlusPrecip in 1975? 7.02 2) sum of squared deviations of TwoPlusPrecip in 1975? 64.91 Getting Started in EViews Access the Amherst weather data by clicking inside the red link box below: [Link to MIT-AmherstWeather-1901-2000.wf1 goes here.] After opening the workfile, instruct EViews to generate the new variable: • In the Workfile window: Click Genr in the toolbar. • In the Generate Series by Equation window; enter the formula for the new variable: TwoPlusPrecip = 2 + Precip • Click OK. Instruct EViews to calculate the mean and sum of squared deviations of TwoPlusPrecip: • In the Workfile window: Double click on twoplusprecip. • A spreadsheet displaying the value of TwoPlusPrecip for all the months appears. • In the Series window: Click View; then click Descriptive Statistics & Tests, and then Stats Table. Descriptive statistics for all the months of the twentieth century now appear. • In the Series window: Click Sample. o In the Sample window: Enter year=1975 in the “If condition (optional)” text area to restrict the sample to 1975 only. o Click OK. Descriptive statistics for 1975 appear in the Group window. Record the mean and sum of squared deviations for 1975. Using the sum of squared deviations and a calculator compute the variance of TwoPlusPrecip in 1975. 5.41 64.91 12 = 5.41 5 d. Are your answers to parts a, b, and c consistent? Explain. Yes, the answers are consistent. The histogram reveals that the • center of the TwoPlusPrecip distribution was higher which is consistent with its higher mean. • spread of the two distributions is the same which is consistent with their equal variances. The appropriate equation and statistical software provide the same answers. 3. Focus on precipitation in Amherst, MA in 1975. Suppose that we wish to report precipitation in centimeters rather than inches. To do this, just multiply each month’s precipitation by 2.54. Consider a new variable, PrecipCm, which equals 2.54 times each month’s precipitation as measured in inches: PrecipCm = 2.54×Precip. a. Consider the equations that describe mean and variance of a constant times a variable: Mean[cx] = cMean[x] 2 Var[cx] = c Var[x] Based on these equations and the mean and variance of Precip in 1975, what is the 1) mean of PrecipCm in 1975? 12.75 Mean[2.54×Precip] = 2.54×Mean[Precip] = 2.54×5.02 = 12.75 2) variance of PrecipCm in 1975? 34.90 2 2 Var[2.54×Precip] = 2.54 ×Var[Precip] = 2.54 ×5.41 = 34.90 b. Using your statistical package, generate a new variable: PrecipCm = 2.54×Precip. What is the 1) mean of PrecipCm in 1975? 12.75 2) sum of squared deviations of PrecipCm in 1975? 418.79 Getting Started in EViews Access the Amherst weather data by clicking inside the red link box below: [Link to MIT-AmherstWeather-1901-2000.wf1 goes here.] After opening the workfile, we instruct EViews to generate the new variable: • In the Workfile window: Click Genr in toolbar. • In the Generate Series by Equation window; enter the formula for the new variable: PrecipCm = 2.54*Precip NB: The asterisk, *, is the EViews multiplication symbol. • Click OK. Instruct EViews to calculate the mean and sum of squared deviations of PrecipCm: • In the Workfile window: Double click on precipcm. • A spreadsheet now appears. • In the Series window: Click View; then click Descriptive Statistics & Tests, and then Stats Table. • In the Group window: Click Sample. o In the Sample window: Enter year=1975 in the “If condition (optional)” text area to restrict the sample to 1975 only. o Click OK. Descriptive statistics for 1975 appear in the Group window. Record the mean and sum of squared deviations for 1975. 6 Using the sum of squared deviations and a calculator compute the variance of PrecipCm in 1975. 34.90 418.79 12 = 34.90 c. Are your answers to parts a and b consistent? Explain. Yes, the answers are consistent. The appropriate equations and statistical software provide the same answers. 7 4. Focus on thirty students who enrolled in an economics course during a previous semester. Student SAT Data: Cross section data of student math and verbal high school SAT scores from a group of 30 students. SatMatht Math SAT score for student t SatVerbalt Verbal SAT score for student t 1 if student t is male; 0 if female SexMt The table below reports their SAT scores and sex: Student SatMath SatVerbal SexM 1 670 760 0 2 780 700 0 3 720 700 0 4 770 750 0 5 610 620 0 6 790 770 0 7 740 800 0 8 720 710 0 9 700 680 0 10 750 780 0 11 800 750 1 12 770 690 1 13 790 750 1 14 700 620 1 15 730 700 1 Student SatMath SatVerbal SexM 16 680 580 1 17 750 730 1 18 630 610 1 19 700 730 1 20 730 650 1 21 760 730 1 22 650 650 1 23 800 800 1 24 680 750 1 25 800 740 1 26 800 770 1 27 770 730 1 28 750 750 1 29 790 780 1 30 780 790 1 8 Consider the equations that describe the mean and variance of the sum of two variables: Mean[x + y] = Mean[x] + Mean[y] Var[x + y] = Var[x] + 2Cov[x, y] + Var[y] a. Focus on SatMath and SatVerbal. On a sheet of graph paper, construct the scatter diagram. b. Based on the scatter diagram, do SatMath and SatVerbal appear to be correlated? Explain. Yes, SatMath and SatVerbal appear to be correlated. As SatVerbal increases, SatMath tends to increase also. c. Use your statistical package to compute the following descriptive statistics for SatMath and SatVerbal; then fill in the blanks: SatMath SatVerbal Mean Variance Covariance Correlation Coefficient 737.0 719.0 2,774.3 3,402.3 2,103.7 .6847 9 Getting Started in EViews We can use EViews to calculate the covariance. The student data are stored in an EViews workfile that is posted on our web site. To open the workfile and access these data: • First, click inside the EViewsLink red box: [Link to MIT-StudentData.wf1 goes here.] and then: • In the File Download window: Click Open. (Note that different browsers may present you with a slightly different screen to open the workfile.) • In the Workfile window: Highlight satmath by clicking on it; then while depressing <Ctrl> click on satverbal to highlight it also. • In the Workfile window: Double click on any of the highlighted variables. • A new list now pops up: Click Open Group. A spreadsheet including the variables SatMath and SatVerbal for all the students appears. Now, instruct EViews to calculate the means: 2 • In the Group window: Click View; then click Descriptive Stats, and then Individual Samples. Descriptive statistics now appear. Record the SatMath and SatVerbal means. Next, instruct EViews to calculate the variances and covariance: • In the Group window: Click View, and then click Covariance Analysis… • In the Covariance Analysis window: Note that the Covariance checkbox is selected; then, click OK. The covariance matrix now appears. Record the variances and covariance. Last, instruct EViews to calculate the correlation coefficient: • In the Group window: Click View, and then click Covariance Analysis… • In the Covariance Analysis window: Clear the Covariance box and Select the Correlation box; then, click OK. The correlation matrix now appears. Record the correlation coefficient. • Close the Group window to return to the Workfile window. NB: Copying and Pasting EViews Text It is often convenient to copy and paste EViews results into a word processing document such as Microsoft Word. In the long run, this can save you much time because you can reproduce your results quickly and accurately: • In EViews, highlight the text you wish to copy and paste. • Right click on the highlighted area. • Unless you have a good reason to do otherwise, accept the default choice by clicking OK. • In your word processor: click Paste. Do these calculations support your answer to part b? Yes 2 Common sample eliminates all observations in which there is one or more missing value in one of the variables; the individual samples option does not do so. Since no values are missing, the choice of common or individual has no impact. 10 Focus on the sum of each student’s SAT scores: SatSum = SatMath + SatVerbal d. Consider the equations that describe mean and variance of the sum of two variables: Mean[x + y] = Mean[x] + Mean[y] Var[x + y] = Var[x] + 2Cov[x, y] + Var[y] Based on these equations and the mean and variance of SatMath and SatVerbal, what is the 1) mean of SatSum? 1,456.0 Mean[SatSum] = Mean[SatVerbal] + Mean[SatMath] = 737.0 + 719.0 = 1,456.0 2) variance of SatSum? 10,384.0 Var[x + y] = Var[x] + 2Cov[x, y] + Var[y] = 2,774.3 + 2×2,103.7 + 3,402.3 = 10,384.0 e. Using your statistical package, generate a new variable: SatSum = SatMath + SatVerbal. What is the 1) mean of SatSum? 1,456.0 2) sum of squared deviations of SatSum? 311,520 Getting Started in EViews Generate SatSum in EViews: • In the Workfile window: Click Genr in toolbar • In the Generate Series by Equation window. Enter the formula for the new variable: SatSum = SatMath + SatVerbal • Click OK Using a calculator compute the variance of SumSat. 10,384.0 f. Are your answers to parts d and e consistent? Yes 11 5. 6. Consider a standard deck of 52 cards: 13 spades, 13 hearts, 13 diamonds, and 13 clubs. Thoroughly shuffle the deck and then randomly draw one card. Do not look at the card. Fill in the following blanks: a. There are 13 chances out of 52 that the card drawn is a heart; that is, the probability that the 13 1 card drawn will be a heart equals 52 = 4 . b. There are 4 chances out of 52 that the card drawn is an ace; that is, the probability that the 4 1 card drawn will be an ace equals 52 = 13 . c. There are 26 chances out of 52 that the card drawn is a red card; that is, the probability that 26 1 the card drawn will be a red card equals 52 = 2 . Consider the following experiment: • Thoroughly shuffle a standard deck of 52 cards. • Randomly draw one card and note whether or not it is a heart. • Replace the card drawn. a. 1 What is the probability that the card drawn will be a heart? 4 b. If you were to repeat this experiment many, many times, what portion of the time would you 1 expect the card drawn to be a heart? 4 7. Using algebra, show that the expression: 2 2 (1−p) p + p (1−p) simplifies to p(1−p). 2 2 (1−p) p + p (1−p) = [ p(1−p) (1−p) + p ] Factoring out p(1−p) from each term [ ] = p(1−p) 1 − p + p = p(1−p) Simplifying