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

Info iconThis 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)
Background image of page 1

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

View Full DocumentRight 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.
Background image of page 2
3.36. b Used function colPercents to find the % of all male drivers.
Background image of page 3

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

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

This homework help was uploaded on 10/07/2007 for the course ORF 245 taught by Professor Richardd.deveaux during the Spring '07 term at Princeton.

Page1 / 8

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

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online