hw03

pdf

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

C8

Subject

Statistics

Date

Feb 20, 2024

Type

pdf

Pages

14

Uploaded by ProfHawk831

Report
Question 5. In the code cell below, create a visualization that will help us determine if there is an association between birth rate and death rate during this time interval. It may be helpful to create an intermediate table containing the birth and death rates for each state. (4 Points) Things to consider: • What type of chart will help us illustrate an association between 2 variables? • How can you manipulate a certain table to help generate your chart? • Check out the Recommended Reading for this homework! In [28]: # In this cell, use birth_rates and death_rates to generate your visualization birth_rates_2015 = pop . column( 'BIRTHS' ) / pop . column( '2015' ) death_rates_2015 = pop . column( 'DEATHS' ) / pop . column( '2015' ) rates_table = Table() . with_columns( 'STATE' , pop . column( 'NAME' ), 'BIRTH RATE' , birth_rates_2015, 'DEATH RATE' , death_rates_2015) rates_table . scatter( 'BIRTH RATE' , 'DEATH RATE' ) 1
2
Question 1. Produce a histogram that visualizes the distributions of all ride times in Boston using the given bins in equal_bins . (4 Points) Hint: See Chapter 7.2 if you’re stuck on how to specify bins. In [32]: equal_bins = np . arange( 0 , 120 , 5 ) boston . hist( 'ride time' , bins = equal_bins) 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
4
Question 2. Now, produce a histogram that visualizes the distribution of all ride times in Manila using the given bins. (4 Points) In [33]: equal_bins = np . arange( 0 , 120 , 5 ) manila . hist( 'ride time' , bins = equal_bins) # Don't delete the following line! plt . ylim( 0 , 0.05 ); 5
6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 6. Identify one difference between the histograms, in terms of the statistical properties. > Hint : Without performing any calculations, can you comment on the average or skew of each histogram? (4 Points) The variance of ride times in Manila is greater than that of Boston, with ride times ranging from 0 to 100 whereas Boston has ride times ranging from just 0 to 50, and we can see that the historgram for Boston is more right-skewed than for Manila. This means that the on average, Manila experiences a greater ride time than Boston. 7
8
Question 7. Why is your solution in Question 6 the case? Based on one of the following two readings, why are the distributions for Boston and Manila different? (4 Points) Boston reading Manila reading Hint: Try thinking about external factors of the two cities that may be causing the difference! The readings provide some potential factors – try to connect them to the ride time data. Manila’s average ride time is greater than Boston’s mainly due to its poor traffc conditions. The reading mentions that there is scarcity in Manila’s transit system, which means that people would more often drive, contributing to traffc. Manila’s roads also have a lot of U-turns that often slow down traffc and hence ride times as well. In general, Manila also has poorly enforced traffc legislations in comparison to Boston, in which Boston’s traffc suffers most from weather conditions. 9
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
10
Question 2. State at least one reason why you chose the histogram from Question 1. Make sure to clearly indicate which histogram you selected (ex: “I chose histogram A because …”). (5 Points) I chose histogram C because it is more right-skewed which reflects the scatter plot, where more data points surround the region between -1 and 0. 11
12
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Question 4. State at least one reason why you chose the histogram from Question 3. Make sure to clearly indicate which histogram you selected (ex: “I chose histogram A because …”). (5 Points) I chose Histor 13
14