{VERSION 5 0 "SUN SPARC SOLARIS" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal " -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Plot" 0 13 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 13 258 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 11 "" 1 "" {TEXT 256 13 "ACCESS - MATH" }}{PARA 257 "" 0 "" {TEXT -1 9 "July 2003" }}{PARA 256 "" 0 "" {TEXT -1 49 "Notes on \+ Body Mass Index and actual national data" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 258 28 "W hat is the Body Mass Index?" }}{PARA 0 "" 0 "" {TEXT -1 383 " If y ou read newspapers and magazines it is likely that once or twice a yea r you run across an article about the body mass index (B.M.I.) , and i ts use in determining health risk factors for overweight and underweig ht people. If you search the internet for \"body mass index\" you wil l find many sites which let you compute your B.M.I., and which tell yo u a little bit about it. " }}{PARA 0 "" 0 "" {TEXT -1 1192 " A p erson's B.M.I. is computed by dividing their weight by the square of t heir height, and then multiplying by a universal constant. If you mea sure weight in kilograms, and height in meters, this constant is the n umber one. Thus, the proponants of the B.M.I index are claiming that \+ for adults at equal risk levels (but different heights), weight should be proportional to the square of height. As we have discussed in cla ss, if people were to scale equally in all directions (\"self-similar \") when they grew, volume and hence weight would scale as the cube of height. That particular power law seems a little high, since adults don't look like uniformly expanded versions of babies; we seem to get relatively stretched out when we grow taller. One might expect the b est predictive power for weight as a function of height to be somewher e between 2 and 3, if one expected a power law at all. If there is a \+ predictive power, and if it is much larger than 2, then one could argu e that the body mass index might need to be modified to reflect this f act. (In fact, when you find body mass index tables, they often explai n that you should modifiy the acceptable BMI values for children.)" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 330 " We \+ have all collected several heights and weights, and hopefully in aggre gate we will have a good number of representative measurements, from b aby-sized to adult. Each group will use this data, see if it is cons istent with a power law relating weights to heights, and decide whethe r the B.M.I. power of 2 is a good choice. " }}{PARA 0 "" 0 "" {TEXT -1 725 " I often do this experiment with my linear algebra classes as well as with the Accessors, and we have gotten powers between 2.3 \+ and 2.7. Also, several years ago I found a national data base at the \+ U.S. Center for Disease Control web site. It contained a wide variety of body measurements collected between 1976 and 1980, including natio nal median heights and weights for boys and girls, age 2-19. By using only the national medians a lot of the variance has been taken out of the data, compared to what yours will look like. The national data is very consistent with a power law, with power = 2.6. If any of you ca n figure out a valid mathematical model which explains this power law, you'll have a publishable paper." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT 260 31 "How do you test for power laws?" }} {PARA 0 "" 0 "" {TEXT -1 217 " When you studied logarithms in high school you might have wondered what they were good for. Well, as Nan cy showed you yesterday, one application is in looking for power laws. Remember how the discussion went: " }}{PARA 0 "" 0 "" {TEXT -1 148 " Suppose we have a set of \"n\" data points, which you can think of as your height-weight data, but which could really be any set of p aired data:" }}{EXCHG {PARA 11 "" 1 "" {XPPMATH 20 "6#7'7$&%\"xG6#\"\" \"&%\"yGF'7$&F&6#\"\"#&F*F-7$&F&6#\"\"$&F*F2%$...G7$&F&6#%\"nG&F*F8" } }}{PARA 0 "" 0 "" {TEXT -1 68 "We want to see if there is a power m an d a proportionality constant " }{XPPEDIT 18 0 "b;" "6#%\"bG" }{TEXT -1 21 " so that the formula" }}{EXCHG {PARA 11 "" 1 "" {XPPMATH 20 "6 #/%\"yG*&%\"bG\"\"\")%\"xG%\"mGF'" }}}{EXCHG {PARA 11 "" 1 "" {TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 36 "effectively mirrors the real d ata. " }{TEXT 259 60 "Taking (natural) logarithms of the proposed pow er law yields" }}{EXCHG {PARA 11 "" 1 "" {XPPMATH 20 "6#/-%#lnG6#%\"yG ,&-F%6#%\"bG\"\"\"*&%\"mGF,-F%6#%\"xGF,F," }}}{PARA 0 "" 0 "" {TEXT -1 15 "So if we write " }{XPPEDIT 18 0 "Y = ln(y);" "6#/%\"YG-%#lnG6#% \"yG" }{TEXT -1 7 " and " }{XPPEDIT 18 0 "X = ln(x);" "6#/%\"XG-%#ln G6#%\"xG" }{TEXT -1 3 ", " }{XPPEDIT 18 0 "B = ln(b);" "6#/%\"BG-%#ln G6#%\"bG" }{TEXT -1 59 ", this becomes the equation of a line in the n ew variables " }{XPPEDIT 18 0 "X;" "6#%\"XG" }{TEXT -1 5 " and " } {XPPEDIT 18 0 "Y;" "6#%\"YG" }{TEXT -1 1 ":" }}{EXCHG {PARA 11 "" 1 " " {XPPMATH 20 "6#/%\"YG,&%#mXG\"\"\"%\"BGF'" }}}{PARA 0 "" 0 "" {TEXT -1 5 "Thus," }{TEXT 263 1 " " }{TEXT 264 321 "in order for there to be a power law for the original data, the ln-ln data should (approximate ly) satisfy the equation of a line. Furthermore, this process is reve rsible; if the ln-ln data lies on a line with slope m and intercept B, then the original data satisfies a power law with power m and proport ionality constant" }{TEXT 265 1 " " }{XPPEDIT 18 0 "b = exp(B);" "6#/% \"bG-%$expG6#%\"BG" }{TEXT 262 1 "." }{TEXT -1 43 " That's because of the rules of exponents:" }}{EXCHG {PARA 11 "" 1 "" {XPPMATH 20 "6#/% \"YG,&%\"BG\"\"\"*&%\"mGF'%\"XGF'F'" }}{PARA 11 "" 1 "" {XPPMATH 20 "6 #/-%$expG6#%\"YG-F%6#,&%\"BG\"\"\"*&%\"mGF,%\"XGF,F," }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/-%$expG6#%\"YG*&-F%6#%\"BG\"\"\")-F%6#%\"XG%\"mGF, " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/%\"yG*&%\"bG\"\"\")%\"xG%\"mGF'" }}}{PARA 0 "" 0 "" {TEXT -1 138 "In real experiments, it is not too ha rd to see if data is well approximated by a line, so this trick with t he logarithm is quite useful. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 261 24 "National data example: \+ " }{TEXT -1 162 "I used colons after most of these commands to suppres s the output. If you want to go back and see what each command is doi ng, replace the colons with semicolons." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 257 0 "" }{TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(plo ts):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 334 "boyhw:=[[35.9,29.8 ],[38.9,34.1],[41.9,38.8],[44.3,42.8],\n [47.2,48.6],[49.6,54.8 ],[51.4,60.8],[53.6,66.5],\n [55.7,76.8],[57.3,82.3],[59.8,93.8 ],[62.8,106.8],\n [66.0,124.3],[67.3,132.6],[68.4,142.4],[68.9, 145.1],\n [69.6,155.3],[69.6,153.2]]:\n#boy heights (inches) we ights (pounds): Ntl medians for ages 2-19" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 336 "girlhw:=[[35.4,28.0],[38.4,32.6],[41.1,36.8],[43.9 ,41.8],\n [46.6,47.0],[48.9,52.5],[51.4,60.8],[53.1,65.5],\n \+ [55.7,76.1],[58.2,89.0],[61.0,100.1],[62.6,108.1],\n [63.3 ,117.1],[64.2,117.6],[64.3,122.6],[64.2,128.8],\n [64.1,124.5], [64.5,126]]:\n#girl heights(inches) weights (pounds): Ntl medians for \+ ages 2-19 " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 138 "boys:=point plot(boyhw):\ngirls:=pointplot(girlhw):\ndisplay(\{boys,girls\},\n \+ title=`plot of [height,weight], National medians ages 2-19`);\n" }} {PARA 13 "" 1 "" {TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 29 "And now for the ln-ln data. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "wi th(linalg): #linear algebra package\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 219 "B:=evalm(boyhw): #evaluate matrix, this will\n #t urn our list of points into a matrix, which will\n #be easiser to ma nipulate in Maple\nG:=evalm(girlhw):\nBG:=stackmatrix(B,G): #stack th e matrices on top of eachother." }}}{EXCHG {PARA 11 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 240 "lnBGa:=map(ln,BG): \+ #take ln of the boy and girl height-weights\nlnBG:=map(evalf,lnBGa): \+ #Get decimal (floating point) values.\n #This speeds up computations later in the\n #least squares fit - otherwise Maple tries working\n \+ #symbolically." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 65 "lnlnplot :=pointplot(lnBG):\ndisplay(lnlnplot,title=`ln-ln data`);\n" }}{PARA 13 "" 1 "" {TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 0 "" }{TEXT 266 58 "How do I find the best line fit to a collection of points?" }} {PARA 0 "" 0 "" {TEXT -1 37 " From Calculus, there is a slope " } {XPPEDIT 18 0 "m;" "6#%\"mG" }{TEXT -1 15 " and intercept " }{XPPEDIT 18 0 "B;" "6#%\"BG" }{TEXT -1 151 " yielding a line which minimizes th e sum of the squared vertical distances between your data points and t he points on a line. If the n data points are" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 11 "" 1 "" {XPPMATH 20 "6#7'7$&%\"XG6#\" \"\"&%\"YGF'7$&F&6#\"\"#&F*F-7$&F&6#\"\"$&F*F2%$...G7$&F&6#%\"nG&F*F8 " }}}{PARA 0 "" 0 "" {TEXT -1 5 "then " }{XPPEDIT 18 0 "m" "6#%\"mG" } {TEXT -1 5 " and " }{XPPEDIT 18 0 "B" "6#%\"BG" }{TEXT -1 30 " solve t he system of equations" }}{EXCHG {PARA 11 "" 1 "" {XPPMATH 20 "6#/*&-% 'matrixG6#7$7$-%$SumG6$*$)&%\"XG6#%\"iG\"\"#\"\"\"/F2;F4%\"nG-F+6$F/F5 7$F8F7F4-F&6#7$7#%\"mG7#%\"BGF4-F&6#7$7#-F+6$*&F/F4&%\"YGF1F4F57#-F+6$ FIF5" }}}{PARA 11 "" 1 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 706 "You could solve this system with several \"do-loops\" to compute the matrix entries, followed by a \"solve\" command to solve \+ the system, but the method is so common that every decent mathematical software or graphing calculator already has a command to do all of th at work for you. In statistics this procedure is called linear regres sion as well as the method of least squares. If you looked through th e help directory in your menu bar you would eventually find MAPLE's ve rsion of this command living in the stats library packag, and called \+ \"fit[leastsquare]\". Here's how the command works. I've used it to \+ check the example we worked by hand in class. You must be careful wit h brackets and parantheses." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(stats):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 293 "fit[le astsquare[[X,Y]]]([[0,2,4],[1,2,1]]);#the syntax here is\n#to first na me your variables, then give two lists, one of the first variable\n#va lues, and the second with the corresponding second variable values. T hus\n#we are trying to find the best line fit for the points [0,1],[2, 2],[4,1].\n" }}{PARA 11 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 70 "Now that we've tested the command, we can use it on the national data:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 264 "Xs:=con vert(col(lnBG,1),list): #convert the first column of\n #the ln-ln dat a into a list of the \"x's\" The least squares\n #command wants to h ave lists input, not matrix columns, even\n #though it's hard for us \+ to see any difference\nYs:=convert(col(lnBG,2),list):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "fit[leastsquare[[X,Y]]]([Xs,Ys]); \+ \n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/%\"YG,&$\"+.LqQg!\"*!\"\"*&$\"+ /!GQf#F(\"\"\"%\"XGF-F-" }}}{EXCHG {PARA 258 "" 0 "" {TEXT -1 65 "We c an paste in the equation of the line and see how well we did." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 132 "line:=plot(-6.038703303+2.5 93828004*X, X=3.4..4.5,Y=2.7..5.7,\n color=black):\ndisplay(\{line,l nlnplot\}, title=`least squares fit`);\n" }}{PARA 13 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 70 "Finally, we can go back from the least squares lin e fit to a power law" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "m:= 2.593828004; #power\nb:=exp(-6.038703303); #proportionality constant \n" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"mG$\"+/!GQf#!\"*" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"bG$\"+x!\\YQ#!#7" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 254 "powerplot:=plot(b*h^m,h=0..80,w=0..200,color= black):\ndisplay(\{powerplot,boys,girls\},title=\n `power law approxi mation for national height-weight data`);\n#by calling the variables h and w, and giving their ranges, I\n#get Maple to label the axes as I \+ want\n" }}{PARA 13 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{PARA 11 "" 1 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{MARK "62" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }