Biology > Solutions Guide > LS 40 (Life Science) Homework 1 Solutions (Lecture 1 W21)updated in Jan 2021 (All)
Homework 1 Solutions By Ashley (Adapted from previous solutions) updated in January 2021 by Ana Gomez points: 21 completion points, 5 accuracy points = 26 points total 1. The age distribution of f... irst-time mothers in the United States has changed greatly over the last forty years, so we’d like you to analyze a representative dataset of ages of first time mothers in 1980 and 2016. If you’d like to know more about this phenomenon, see the New York Times article “ The Age That Women Have Babies: How a Gap Divides America .” For each dataset (provided in the turn-in sheet), do the following steps: a. Use Python to plot a dot plot, beeswarm plot, histogram, violin plot, and boxplot. (5 points for completion) In [1]: # Import Python libraries %matplotlib inline import matplotlib as mat import seaborn as sns import numpy as np import matplotlib.pyplot as plt # for displaying plots side by side in subplots In [2]: # Dataset for Homework 1: Representative dataset of age of first time mothers in USA in 1980 and 2016 ages1980 = [23,32,20,27,28,20,29,25,19,19,19,27,27,25,24,18,17,20,22,17,22,20, ages2016 = [21,29,41,23,35,16,18,19,26,29,33,19,18,28,21,18,24,31,37,31,27,36, 18,40,33,27,25,26,22,29,27,30,29,30,25,28,24,23,17,19,36,18,29,22,25,20,20,34, In [21]: # Dot plots p1 = sns.stripplot(data=ages1980,jitter=True) p1.set(ylabel = "Age of First-Time Mothers", title = "1980") Homework 1 Solutions (Lecture 1 W21) 2/5/21, 1:02 AM file:///Users/ana/Downloads/Assignment%20Solutions%2021W/Homew…0Solutions/Homework%201%20Solutions%20(Lecture%201%20W21).html Page 2 of 13 [Text(0, 0.5, 'Age of First-Time Mothers'), Text(0.5, 0, ''), Text(0.5, 1.0, '1980')] [Text(0, 0.5, 'Age of First-Time Mothers'), Text(0.5, 1.0, '2016')] [Show More]
Last updated: 1 year ago
Preview 1 out of 13 pages
Connected school, study & course
About the document
Uploaded On
Jul 09, 2021
Number of pages
13
Written in
This document has been written for:
Uploaded
Jul 09, 2021
Downloads
0
Views
82
In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Browsegrades · High quality services·