990 likes | 1.17k Views
Chapter 4: More about Relationships Between Two Variables. 4.1 – Transforming to Achieve Linearity Exponential Growth. Not all data can be expressed with a linear model.
E N D
4.1 – Transforming to Achieve Linearity Exponential Growth
PROBLEM! We cannot use least-squares regression for nonlinear data because least-squares regression depends upon correlation, which only measures the strength of linear relationships. SOLUTION! Transform the data into a linear set, then use the least-squares regression to determine the best fitting line for the transformed data. Finally, do a reverse transformation equation which will model our original nonlinear data.
Properties of Logarithms 1. log ab = log a + log b a b 2. log = log a – log b 3. log xp = p log x Remember: log has a base of 10 and natural logs (ln) have a base of e. It doesn’t matter which one you use.
Linearizing Exponential Functions: We want to write an exponential function of the form y = abx as a linear model. (where x, y are variables and a,b are constants) y = abx log y = log (abx) log y = log a + log bx log y = log a + xlog b
CONCLUSIONS: 1. If the graph of (x, y) is exponential, then the graph of (x, log y) is linear. 2. If the graph of (x, log y) is linear, then the graph of (x, y) is exponential.
Example #1 Transform the exponential data to a linear model using logs and then natural logs. y = 5(2)x ln y = ln (5 2x) log y = log (5 2x) ln y = ln 5 + log 2x log y = log 5 + log 2x ln y = ln 5+ xln 2 log y = log 5+ xlog 2 ln y = 1.6094+ 0.6931x log y = 0.69897+ 0.3010x
Example #2 Convert the equation back to an exponential function. ln y = 16 + 9x e e y = e(16 + 9x) y = e(16) e(9x) y = e(16) e(9)x y = 8,886,110.521 8103.0839x
Example #3 Convert the equation back to an exponential function. log y = 4 + 2x 10 10 y = 10(4 + 2x) y = 10(4) 10(2x) y = 10(4) 10(2)x y = 10,000 100x
Calculator Tip: Exponential Functions L1: x L2: y L3: leave blank for now! L4: log y LinReg(L1, L4, Y1) - (x, log y, Y1) To prevent Overload error: convert years to a smaller number
Calculator Tip: Residual Plot After calculating the line of regression: L5: Y1(L1) (predicted y’s) L6: L4 – L5 (residuals) Scatterplot of L1 and L6
Calculator Tip: Exponential Equation ExpReg(L1, L2, Y2) - (x, y, Y2)
Exponential to Linear Change: 1. The ratio of the y’s should be fairly constant 2. Graph x and y and look at the pattern 3. Calculate the transformed linear model 4. Describe the r value and the residual plot
Example#4: Consider the following data representing the population for Asian and Pacific Islander. 1. Make a scatterplot of the data and describe the graph.
D: Positive, as year increases, population increases F: Nonlinear S: Strong
2. Describe the pattern of change and find the percent of change for each y (ratio of y’s). The ratios of the y’s are fairly consistent, suggesting an exponential model
4. Find the least squares regression line of the transformed data. log y = 2.27095 + 0.0156432x OR Log(Population) = 2.27095 + 0.0156432(Year)
5. Find the value of r and describe its meaning. r = 0.999999 D: Positive S: Strong
6. Construct the residual plot and describe its meaning. No pattern, so good linear model
7. Perform the inverse transformation to express y-hat as an exponential equation. 10 10 y = 10(2.27095 + 0.0156432x) y = 10(2.27095) 10(0.0156432x) y = 10(2.27095) 10(0.0156432)x y = 186.6162 1.0367x
9. Make a prediction for the population in 2010 using your linear equation. log y = 2.27095 + 0.0156432(110) log y = 3.991697 10 10 y = 9810.6342
10. Make a prediction for the population in 2010 using your exponential equation. y = 186.6162 1.0367x y = 186.6162 1.0367(110) y = 9,810.6342
Example#4: Consider the following data representing an account balance over time: 1. Make a scatterplot of the data and describe the graph.
D: Positive, as time increases, account balance increases F: Nonlinear S: Strong
2. Describe the pattern of change and find the percent of change for each y (ratio of y’s).
3. Take the natural log of the y-values and make a new scatterplot.
4. Find the least squares regression line of the transformed data. ln y = 4.60516 + 0.00995047x OR ln(Account Balance) = 4.60516 + 0.00995047(Months)
5. Find the value of r and describe its meaning. r = 0.999999 D: Positive S: Strong
6. Construct the residual plot and describe its meaning. No pattern, so good linear model
7. Perform the inverse transformation to express y-hat as an exponential equation. e e y = e(4.60516 + 0.00995047x) y = e(4.60516) e(0.00995047x) y = e(4.60516) e(0.00995047)x y = 99.9988 1.01x
9. Make a prediction for the account balance in 60 months using your linear equation. ln y = 4.60516 + 0.00995047(60) ln y = 5.20218656728 e e y = $181.67
10. Make a prediction for the account balance in 60 months using your exponential equation. y = 99.9988 1.01x y = 99.9988 1.01(60) y = $181.67
A power model is in the form y = axp. To transform this equation into a linear model you must apply the log transformation to both variables x and y. y = axp log y = log (axp) log y = log a + log xp log y = log a + plog x How is this different than exponential functions? You have to take the log of both x and y to make a linear model.
Example #1 Find the LSRL by taking the logs and then the natural logs. y = 4x5 y = 4x5 log y = log (4x5) ln y = ln (4x5) log y = log 4 + log x5 ln y = ln 4 + ln x5 log y = log 4 + 5log x ln y = ln 4 + 5ln x log y = 0.6021 + 5log x ln y = 1.3863 + 5ln x
Example #2 Convert the equation back to a power equation. ln y = -5 + 9ln x e e y = e(-5 + 9lnx) y = e(-5) e(9lnx) y = e(-5) e(lnx)9 y = 0.0067x9
Example #2 Convert the equation back to a power equation. log y = 0.5 + 2log x 10 10 y = 10(0.5 + 2logx) y = 10(0.5) 10(2logx) y = 10(0.5) 10(logx)2 y = 3.1623x2
Calculator Tip: Power Functions L1: x L2: y L3: log x L4: log y LinReg(L3, L4, Y1) - (log x, log y, Y1)
Calculator Tip: Residual Plot After calculating the line of regression: L5: Y1(L3) (predicted y’s) L6: L4 – L5 (residuals) Scatterplot of L3 and L6
Calculator Tip: Power Equation PwrReg(L1, L2, Y2) - (x, y, Y2)
Example#4 The distances from our sun and the periods of the 9 planets in the solar system are given below. 1. Make a scatterplot of the data and describe the graph.
D: Positive, as distance increases, period increases F: Nonlinear S: Strong
2. Describe the pattern of change and find the percent of change for each y (ratio of y’s). Ratio of y’s are not similar, perhaps not exponential
3. Transform the data to a linear model by taking the log of the x’s and the y’s. Make a sketch of the new scatterplot.
4. Find the least squares regression line of the transformed data. log y = 0.002916 + 1.49627x OR log(Period) = 0.002916 + 1.49627(Distance)
5. Find the value of r and describe its meaning. r = 0.9999765 D: Positive S: Strong