Regression II - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Regression II

Description:

Comparing the slope (intercept) to an expected value ... To get Sxx, divide the standard error (se) for the regression by the standard ... – PowerPoint PPT presentation

Number of Views:122
Avg rating:3.0/5.0
Slides: 16
Provided by: cheserver
Category:
Tags: regression | sxx

less

Transcript and Presenter's Notes

Title: Regression II


1
Regression II
  • Engineering Experimental Design
  • Winter 2003

2
Outline
  • Comparing the slope (intercept) to an expected
    value
  • Estimating a value from the slope or intercept
  • Placing an uncertainty on a calculated
    (predicted) value of y
  • Nonlinear regression using Matlab

3
Problem Vapor-Liquid Eq.
  • The relative volatility, ?, is the molar ratio of
    components i and j in the gas phase divided by
    the molar ratio of the two components in the
    liquid phase.
  • Assuming ? is a constant, it can be found
    experimentally from the mole fractions of one
    component in the gas phase (y) and the liquid
    phase using this equation
  • y ?x / (1 (?-1)x)
  • Taking both sides to the power 1 linearizes the
    equation
  • Data for methanol in water is shown to the left
  • x mole fraction methanol in liquid
  • y mole fraction methanol in gas phase

4
Problem, ctd.
  • Linearize the equation and perform least-squares
    linear regression using Excel.
  • You should get a slope of roughly 1.24 and an
    intercept of roughly 0.11
  • Evaluate how well the linearized equation fits
    the transformed data.
  • Use r-squared, ANOVA, residual plot, and line fit
    plot

5
Comparing the Slope or Intercept to an Expected
Value
  • Excel gives you the t-statistic and confidence
    interval on the slope and intercept
  • 95 significance level by default
  • Can also specify other significance level
  • If the expected value is included in the
    confidence interval, then the slope (intercept)
    is not significantly different from the expected
    value.
  • If t-statistic lt t-critical, then the slope
    (intercept) is not significantly different from
    the expected value.
  • To get t-critical, use table with n-2 (two less
    than number of data points) degrees of freedom

6
Estimating a Value from the Slope or Intercept
  • Use the confidence interval
  • Example ln(y) A(Re) ln(B)
  • Regression gives ln(B) 0.90 0.15
  • eln(B) e0.9 2.4596
  • ?(ex) (dex/dx) ?x ex ?x e0.9 ? 0.15 0.4
  • Or
  • ?(ex) exmax ex or ex exmin e1.05-e0.9 or
    e0.9-e0.75 0.4 or 0.3
  • B 2.5 0.4

7
Estimating a Value from the Slope or Intercept
  • Example ln(y) A(Re) ln(B)
  • Regression gives ln(B) 0.09 0.15
  • eln(B) e0.09 1.094
  • ?(ex) (dex/dx) ?x ex ?x e0.09 ? 0.15 0.16
  • Or
  • ?(ex) exmax ex or ex exmin e0.24-e0.9
    or e0.9-e-0.06 0.18 or 0.15
  • B 1.00 0.16

8
Why didnt I throw out the intercept?
  • 0.09 0.15 spans zero, so why didnt I just set
    the intercept to zero and regress again?
  • ln(y) A(Re) ln(B) is a linearized form of y
    B(Re)A
  • When ln(B) 0, B 1.0
  • You cannot evaluate the significance of B
    directly by looking at the size of ln(B)

9
Back to the Problem
  • Calculate the value of ? using the slope for the
    linearized equation.
  • Calculate the value of ? using the intercept for
    the linearized equation.
  • Do these values of ? agree at the 5
    significance level? What value of ? would you
    report?

10
Problem, ctd.
  • In fact, ? is not constant for the methanol-water
    system over this whole range.
  • The 1/x, 1/y transformation of the data weights
    points at higher temperature (low x and y values)
    very heavily in the least-squares regression.
  • The slope gives a value of ? similar to the true
    values at high temperatures (low x and y)
  • Linearization usually gives different values for
    parameters than nonlinear regression, because the
    data transformation weights points differently

11
Placing an Uncertainty on a Predicted Value of y
Quick Dirty
  • Under Regression Statistics Excel gives a
    Standard Error
  • This is an estimate of the standard deviation of
    the normally-distributed random error in y
  • As a first approximation, you can be 65 certain
    that if you go to the lab and measure a value of
    y, you will be within 1 standard error of the
    value you would predict from the regression
    equation

12
Placing an Uncertainty on a Predicted Value of y
Right Way
  • Check out the equations on pages 479, 487, 490
  • To get Sxx, divide the standard error (se) for
    the regression by the standard error for the
    slope (sb) and then square the result.
  • Find the mean of all the x-values.
  • Calculate sy-hat
  • Look up t-critical for your significance level
  • Degrees of freedom samples - 2

13
Prediction vs. Confidence Interval
  • Look at Figure 11.11
  • The confidence interval on the true value of y
    is narrower than the prediction interval, and
    narrower for values of x in the middle than for
    values on the ends
  • The prediction interval is about the same for all
    values of x
  • Usually, you want to predict a value of y for a
    given value of x
  • This is why the quick-n-dirty method is not too
    bad for putting an uncertainty on a predicted y

14
Back to the Problem
  • Using the linear regression results, what mole
    fraction of methanol in the gas phase do you
    expect to measure for a liquid phase mole
    fraction of 0.30? What about for 0.60?
  • Use the quick-n-dirty method for uncertainty
    first, assuming that 2 standard deviations covers
    95 of the data.
  • Calculate the 95 prediction interval the right
    way for each y second

15
Nonlinear Regression with Matlab
  • Refer to the solution to exam 1 for an example
  • Use the function nlinfit
  • Make one vector of dependent variable values and
    one of independent variable values
  • Define your model equation as an inline function
  • Dont forget the confidence interval on the
    relative volatility
Write a Comment
User Comments (0)
About PowerShow.com