4-Graphics2013

# 20 010 000 proportion alterna9ve bar width has no

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 110 108 129 141 110 118 111 160 [1117] 120 121 113 117 158 128 158 133 163 128 126 127 134 140 102 100 120 98 130 104 122 137 114 63 98 99 89 117 143 106 99 156 72 75 97 106 [1153] 91 117 117 112 112 141 131 130 132 114 160 106 84 112 139 104 130 71 82 119 123 115 124 138 88 146 128 82 100 114 97 126 122 152 116 132 [1189] 84 119 104 106 124 139 103 112 96 102 120 102 97 113 130 97 116 114 127 87 141 144 116 75 138 99 118 152 97 146 81 110 135 114 124 115 [1225] 143 113 109 103 118 127 132 113 128 130 125 117 Rug plot Each baby’s weight is represented as a 9ckmark. The thicker lines are from mul9ple babies with similar weights. I added a liUle random noise to the weights to keep them from falling on top of each other. What can you see now? How are birth weights distributed? 60 80 100 120 Birth Weight 140 160 180 Distribu9on of Birth Weight •  The distribu5on is the paUern of varia9on in the birth weights. •  It provides the numerical values for birth weight and how oien each value occurs. •  A histogram/density plot shows the shape of the distribu9on Histogram: hist(infants\$bwt) hist(infants\$bwt , freq = FALSE, xlab = "Birth Weight (oz)", main = "Male Babies, Oakland Kaiser 1960s") Histograms •  Are a special case of density plots •  AREA = Propor9on (or percent) •  The area of a bar: Height * Width = Area (Propor9on/oz) * oz = Propor9on •  Histograms are not the same as bar charts •  With bar charts, it is only the height that maUers. Bar charts are for qualita5ve data Density plot – smoothed histogram plot(density(infants\$bwt)) 0.020 0.015 0.010 0.005 0.000 Density (proportion per oz) Male babies born at Oakland Kaiser in the 1960s 50 100 150 Birth Weight (oz) plot(density(infants\$bwt), ! xlab = "Birth Weight (oz)", ! main = "Male Babies, Oakland Kaiser…") Babies birth weight plot(density(infants\$bwt, bw = 1)) 0.000 0.005 0.010 0.015 0.020 0.025 Density (proportion per oz) Male babies born at Oakland Kaiser in the 1960s 60 80 100 120 Birth Weight (oz) 140 160 180 Selec9ng a bandwidth •  R chooses a bandwith for you, but you can specify one if you like. •  The goal is to see the overall shape of the distribu9on, not the individual poi...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online