{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 2004" }}{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 518 " Mos t of us have collected several heights and weights, and hopefully in a ggregate we will have a good number of representative measurements, fr om baby-sized to adult. (Actually, I added 21 extra data points for b aby size through 49 inches in height - this data came from earlier ACC ESS groups and helps give us a more balanced selection of heights.) E ach group will use this data, see if it is consistent with a power la w relating weights to heights, and decide whether the B.M.I. power of \+ 2 is a good choice. " }}{PARA 0 "" 0 "" {TEXT -1 746 " I often do \+ this experiment with my linear algebra classes as well as with the Acc essors, 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 co llected between 1976 and 1980, including national median heights and w eights for boys and girls, age 2-19. By using only the national media ns a lot of the variance has been taken out of the data, compared to w hat yours will look like. The national data is very consistent with a \+ power law, with power = 2.6. If any of you can figure out a valid mat hematical model which explains this power law (or one close to it), yo u'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 239 " When you studied logarithms in high school you might have wondered what they were good for. Well, as bot h Fred and Ken showed you this week, one important application is in l ooking for power laws. Remember how the discussion goes: " }}{PARA 0 "" 0 "" {TEXT -1 148 " Suppose we have a set of \"n\" data poin ts, which you can think of as your height-weight data, but which could really be any set of paired 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 and 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 data. " }{TEXT 259 60 "Taking (na tural) logarithms of the proposed power 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-%#lnG6#%\"xG" }{TEXT -1 3 ", " } {XPPEDIT 18 0 "B = ln(b);" "6#/%\"BG-%#lnG6#%\"bG" }{TEXT -1 59 ", thi s becomes the equation of a line in the new 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 (approximately) satisfy the equation of a \+ line. Furthermore, this process is reversible; if the ln-ln data lies on a line with slope m and intercept B, then the original data satisf ies a power law with power m and proportionality 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#,&%\"B G\"\"\"*&%\"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 hard to see if data i s well approximated by a line, so this trick with the logarithm is qui te 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 suppress the output. If you w ant to go back and see what each command is doing, 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(plots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 334 "boyhw:=[[35.9,29.8],[38.9,34.1],[4 1.9,38.8],[44.3,42.8],\n [47.2,48.6],[49.6,54.8],[51.4,60.8],[5 3.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) weights (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,1 17.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:=pointplot(boyhw):\ng irls:=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 da ta. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "with(linalg): #lin ear algebra package\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 219 "B :=evalm(boyhw): #evaluate matrix, this will\n #turn our list of poi nts into a matrix, which will\n #be easiser to manipulate in Maple\n G:=evalm(girlhw):\nBG:=stackmatrix(B,G): #stack the matrices on top o f eachother." }}}{EXCHG {PARA 11 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 240 "lnBGa:=map(ln,BG): #take ln of th e 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(lnB G):\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#%\"B G" }{TEXT -1 151 " yielding a line which minimizes the sum of the squa red vertical distances between your data points and the points on a li ne. 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 the system of equa tions" }}{EXCHG {PARA 11 "" 1 "" {XPPMATH 20 "6#/*&-%'matrixG6#7$7$-%$ SumG6$*$)&%\"XG6#%\"iG\"\"#\"\"\"/F2;F4%\"nG-F+6$F/F57$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 co uld 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 graphin g calculator already has a command to do all of that work for you. In statistics this procedure is called linear regression as well as the \+ method of least squares. If you looked through the help directory in \+ your menu bar you would eventually find MAPLE's version of this comman d 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 with brackets and parant heses." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "with(stats):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 293 "fit[leastsquare[[X,Y]]]([[0 ,2,4],[1,2,1]]);#the syntax here is\n#to first name your variables, th en give two lists, one of the first variable\n#values, and the second \+ with the corresponding second variable values. Thus\n#we are trying t o 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 th at we've tested the command, we can use it on the national data:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 264 "Xs:=convert(col(lnBG,1),lis t): #convert the first column of\n #the ln-ln data into a list of the \"x's\" The least squares\n #command wants to have lists input, not matrix columns, even\n #though it's hard for us to see any differenc e\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(\"\"\"%\"X GF-F-" }}}{EXCHG {PARA 258 "" 0 "" {TEXT -1 65 "We can paste in the eq uation of the line and see how well we did." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 132 "line:=plot(-6.038703303+2.593828004*X, X=3.4..4.5 ,Y=2.7..5.7,\n color=black):\ndisplay(\{line,lnlnplot\}, title=`leas t squares fit`);\n" }}{PARA 13 "" 1 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "F inally, we can go back from the least squares line 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(\{p owerplot,boys,girls\},title=\n `power law approximation for national \+ height-weight data`);\n#by calling the variables h and w, and giving t heir 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 "13 0" 236 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }