HW1 - 3.30 a colPercents(ex3.30 1 2 3 1 23.7 21.1 21.4 2...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
3.30 a. colPercents(ex3.30) 1 2 3 1 23.7 21.1 21.4 2 60.5 60.6 49.6 3 15.8 18.3 29.0 Total 100.0 100.0 100.0 Count 76.0 71.0 131.0 > rowPercents(ex3.30) 1 2 3 Total Count 1 29.5 24.6 45.9 100.0 61 2 29.9 27.9 42.2 100.0 154 3 19.0 20.6 60.3 99.9 63 > ex3.30 [,1] [,2] [,3] [1,] 18 15 28 [2,] 46 43 65 [3,] 12 13 38 > x=scan() 1: 61 154 63 4: Read 3 items > x = matrix(x,ncol=3) > rowPercents(x) 1 2 3 Total Count 1 21.9 55.4 22.7 100 278 a. percent of mothers who did not receive adequate medical care during pregnancy= 22.7% b. scanned in preterm totals from book into a matrix and found their relative percentages, and added pre term percentages z=scan() 1: 76 71 131 4: Read 3 items > z=matrix(z,ncol=3) > > z [,1] [,2] [,3] [1,] 76 71 131 > rowPercents(z)
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
1 2 3 Total Count 1 27.3 25.5 47.1 99.9 278 Percent of all births that were preterm = 52.8% c. read mothers who received inadequate medical care into a matrix and then added the relative percentages of mothers who did not receive adequate medical care. > ex3.30 [,1] [,2] [,3] [1,] 18 15 28 [2,] 46 43 65 [3,] 12 13 38 > ex3.30c=ex3.30[c(3,6,9)] > ex3.30c [1] 12 13 38 > ex3.30c=matrix(ex3.30c,ncol=3) > > ex3.30c [,1] [,2] [,3] [1,] 12 13 38 > rowPercents(ex3.30c) 1 2 3 Total Count 1 19 20.6 60.3 99.9 63 % of mothers who did not receive adequate medical care that were pre term = 39.6%. d. attached > barplot(colPercents(ex3.30)[1:3]) > ex3.30 [,1] [,2] [,3] [1,] 18 15 28 [2,] 46 43 65 [3,] 12 13 38 > barplot(colPercents(ex3.30) e. It seems that the more care a mother was given the more likely they were to have their children pre-term rather than Term or post term. Of the mothers who received inadequate care, 60.3% were term or post term babies, for all babies 52.8% were pre-term, and the number of mothers that received inadequate care was 22.7%. This leads me to believe that either in case of twins it is safer for a mother to deliver twins, or that if a mother received care, she was more likely to unnecessarily deliver her child early.
Image of page 2
3.36. b Used function colPercents to find the % of all male drivers.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern