{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "###
San Jose State University
Department of Applied Data Science
\n", "#
DATA 220
Mathematical Methods for Data Analysis
\n", "###
Spring 2021
Instructor: Ron Mak
\n", "#
Assignment #10
Statistics Problem Set
\n", "####
100 points total (10 points each)

Work together with your lab partner.
You can compute by hand, but try use Python code and Python functions.
You can add your own functions or other support code.
Show your work with comments!
\n", "####
Due Thursday, April 29, 2021 at 6:00 PM
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### PROBLEM 1. A news article discusses the number of promises made by political candidates and the number of promises kept after they are elected. The table below shows the promises made by the candidates X and the promises Y each kept. Create a scatter plot with a linear regression line. Calculate the correlation coefficient. What is the relationship between promises made and promised kept?\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Promises made by candidates, X20303040505060
Promises kept, Y7654321
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "#### PROBLEM 2. Farmer Brown and Farmer Green each plant 100 acres of corn under similar conditions. Farmer Brown's yield was 84 bushels per acre with a standard deviation of 5 bushels. Farmer Green's yield was 80 bushels per acre with a standard deviation of 6 bushels. What is the 90% confidence interval for the mean difference in yield between the two farms?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "#### PROBLEM 3. SJSU bought 36 bulbs for its classroom projectors. The manufacturer claimed that the bulbs should each last more than 800 hours. After using the bulbs, the university discovered that their mean lifetime was 816 hours with a standard deviation of 70 hours. At the 5% level of significance, should the university accept the manufacturer's claim?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "#### PROBLEM 4. A widget making machine is supposed to make widgets that are 0.05 inches thick. Ten widgets are tested each day to ensure the machine is properly calibrated. Today's test averaged 0.053 inches thick with a standard deviation of 0.003. At the 5% level of significance, is the machine properly calibrated?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "#### PROBLEM 5. Farmer Brown's cows have averaged 380 pounds in weight. He selects 50 of his cows to put on a new diet to make them gain weight. After being on the new diet, the selected cows weigh an average of 390 pounds with a standard deviation of 35.2 pounds. What are the null and alternative hypotheses? What is the lowest level of significance at which we can reject the null hypothesis?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "#### PROBLEM 6. Five friends try a new health club to try to lose weight. They record how many pounds each lost and the number of weeks it took. Assume there is a linear relationship between the pounds lost and the number of weeks. What is the slope of the regression line? What is its y-intercept? Create a scatter graph of the data and the regression line.\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Friend #:12345
Weeks:32145
Pounds:654911
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "#### PROBLEM 7. Use the data from Problem 6. Calculate and print:\n", "- the variation in the pounds lost that cannot be explained by the weeks on the diet\n", "- the total variation in the pounds lost\n", "- the percentage of variation that is explained by the weeks on the diet\n", "- the correlation coefficient " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "#### PROBLEM 8. The table below shows annual snowfall. Create a time series graph and plot the linear trend.\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
YearSnowfall
19939.9
199422.2
199511.4
199614.8
199719.7
199814.9
199915.9
200013.4
200112.0
20027.9
200312.9
200416.8
200511.6
200614.9
200713.3
200820.2
200914.3
201020.4
201113.0
201210.0
201315.9
201417.4
201518.7
201614.3
201716.2
201821.1
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "#### PROBLEM 9. Using the table from Problem 8, plot the 3- and 5-year moving averages." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "\n", "#### PROBLEM 10. Using the table from Problem 8, exponentially smooth the data using alpha values 0.3 and 0.1" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.7" } }, "nbformat": 4, "nbformat_minor": 4 }