Other Regression Models

Slides:



Advertisements
Similar presentations
Regression Analysis Module 3. Regression Regression is the attempt to explain the variation in a dependent variable using the variation in independent.
Advertisements

Regression Analysis Once a linear relationship is defined, the independent variable can be used to forecast the dependent variable. Y ^ = bo + bX bo is.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 13 Nonlinear and Multiple Regression.
Regression Analysis. Unscheduled Maintenance Issue: l 36 flight squadrons l Each experiences unscheduled maintenance actions (UMAs) l UMAs costs $1000.
BA 555 Practical Business Analysis
Class 5: Thurs., Sep. 23 Example of using regression to make predictions and understand the likely errors in the predictions: salaries of teachers and.
Lecture 4 Page 1 CS 239, Spring 2007 Models and Linear Regression CS 239 Experimental Methodologies for System Software Peter Reiher April 12, 2007.
Chapter 11 Multiple Regression.
Quantitative Business Analysis for Decision Making Simple Linear Regression.
Introduction to Regression Analysis, Chapter 13,
Forecasting Revenue: An Example of Regression Model Building Setting: Possibly a large set of predictor variables used to predict future quarterly revenues.
Quantitative Business Analysis for Decision Making Multiple Linear RegressionAnalysis.
Inference for regression - Simple linear regression
One-Factor Experiments Andy Wang CIS 5930 Computer Systems Performance Analysis.
Simple Linear Regression Models
1 Least squares procedure Inference for least squares lines Simple Linear Regression.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Forecasting Revenue: An Example of Regression Model Building Setting: Possibly a large set of predictor variables used to predict future quarterly revenues.
© 1998, Geoff Kuenning Linear Regression Models What is a (good) model? Estimating model parameters Allocating variation Confidence intervals for regressions.
© 1998, Geoff Kuenning General 2 k Factorial Designs Used to explain the effects of k factors, each with two alternatives or levels 2 2 factorial designs.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Other Regression Models Andy Wang CIS Computer Systems Performance Analysis.
Multiple Regression and Model Building Chapter 15 Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
© Copyright McGraw-Hill Correlation and Regression CHAPTER 10.
1 Regression Analysis The contents in this chapter are from Chapters of the textbook. The cntry15.sav data will be used. The data collected 15 countries’
Data Analysis Overview Experimental environment prototype real sys exec- driven sim trace- driven sim stochastic sim Workload parameters System Config.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Chapter 10 Correlation and Regression 10-2 Correlation 10-3 Regression.
ANOVA, Regression and Multiple Regression March
Linear Regression Models Andy Wang CIS Computer Systems Performance Analysis.
Multiple Linear Regression
Chapter 4 More on Two-Variable Data. Four Corners Play a game of four corners, selecting the corner each time by rolling a die Collect the data in a table.
Quantitative Methods Residual Analysis Multiple Linear Regression C.W. Jackson/B. K. Gordor.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
Stats Methods at IC Lecture 3: Regression.
Lecture Slides Elementary Statistics Twelfth Edition
The simple linear regression model and parameter estimation
Step 1: Specify a null hypothesis
Regression Analysis.
More on Inference.
Chapter 14 Inference on the Least-Squares Regression Model and Multiple Regression.
Regression Analysis AGEC 784.
Inference for Least Squares Lines
Inference for Regression
What we’ll cover today Transformations Inferential statistics
Chapter 12: Regression Diagnostics
Elementary Statistics
Chapter 6 Predicting Future Performance
Linear Regression Models
Regression and Residual Plots
Lecture Slides Elementary Statistics Thirteenth Edition
Correlation and Regression
Regression Analysis Week 4.
Stats Club Marnie Brennan
CHAPTER 29: Multiple Regression*
More on Inference.
CHAPTER 26: Inference for Regression
Prepared by Lee Revere and John Large
Chapter 12 Review Inference for Regression
Chapter 4, Regression Diagnostics Detection of Model Violation
Simple Linear Regression
Product moment correlation
Replicated Binary Designs
Regression Assumptions
Regression Forecasting and Model Building
Diagnostics and Remedial Measures
Chapter 6 Predicting Future Performance
One-Factor Experiments
Regression Assumptions
Linear Regression and Correlation
Scatterplots contd: Correlation The regression line
Presentation transcript:

Other Regression Models Andy Wang CIS 5930 Computer Systems Performance Analysis

Regression With Categorical Predictors Regression methods discussed so far assume numerical variables What if some of your variables are categorical in nature? If all are categorical, use techniques discussed later in the course Levels - number of values a category can take

Handling Categorical Predictors If only two levels, define bi as follows bi = 0 for first value bi = 1 for second value This definition is missing from book in section 15.2 Can use +1 and -1 as values, instead Need k-1 predictor variables for k levels To avoid implying order in categories

Categorical Variables Example Which is a better predictor of a high rating in the movie database, winning an Oscar, winning the Golden Palm at Cannes, or winning the New York Critics Circle?

Choosing Variables Categories are not mutually exclusive x1= 1 if Oscar 0 if otherwise x2= 1 if Golden Palm x3= 1 if Critics Circle Award y = b0+b1 x1+b2 x2+b3 x3

A Few Data Points Title Rating Oscar Palm NYC Gentleman’s Agreement 7.5 X X Mutiny on the Bounty 7.6 X Marty 7.4 X X X If 7.8 X La Dolce Vita 8.1 X Kagemusha 8.2 X The Defiant Ones 7.5 X Reds 6.6 X High Noon 8.1 X

And Regression Says . . . How good is that? R2 is 34% of variation Better than age and length But still no great shakes Are regression parameters significant at 90% level?

Other Considerations If categories are mutually exclusive, we can use the following X1 = 1, X2 = 0 to represent category 1 X1 = 0, X2 = 1 to represent category 2 X1 = 0, X2 = 0 to represent category 3

Other Considerations Not okay to do the following X1 = 1 for category 1 X1 = 2 for category 2 X1 = 3 for category 3 Remember y = b0 + b1X1 If b1X1 = 3, it can mean b1 = 3, X1 = 1; b1 = 1.5, X1 = 2; or b1 = 1, X1 = 3

Curvilinear Regression Linear regression assumes a linear relationship between predictor and response What if it isn’t linear? You need to fit some other type of function to the relationship

When To Use Curvilinear Regression Easiest to tell by sight Make a scatter plot If plot looks non-linear, try curvilinear regression Or if non-linear relationship is suspected for other reasons Relationship should be convertible to a linear form

Types of Curvilinear Regression Many possible types, based on a variety of relationships: Many others

Transform Them to Linear Forms Apply logarithms, multiplication, division, whatever to produce something in linear form I.e., y = a + b*something Or a similar form

Sample Transformations For y = aebx, take logarithm of y ln(y) = ln(a) + bx y’ = ln(y), b0 = ln(a), b1 = b Do regression on y’ = b0+b1x For y = a+b ln(x), t(x) = ex Do regression on y = a + bln(t(x))

Sample Transformations For y = axb, take log of both x and y ln(y) = ln(a) + bln(x) y’ = ln(y), b0 = ln(a), b1 = b, t(x) = ex Do regression on y’ = b0 + b1ln(t(x))

Corrections to Jain p. 257

Transform Them to Linear Forms If predictor appears in more than one transformed predictor variable, correlation likely! For y = a + b(x_1 . x_2 + x_2) take log of both x and y ln(y) = ln(a) + x_1 x_2 ln(b) + x_2 ln(b)

General Transformations Use some function of response variable y in place of y itself Curvilinear regression is one example But techniques are more generally applicable

When To Transform? If known properties of measured system suggest it If data’s range covers several orders of magnitude If homogeneous variance assumption of residuals (homoscedasticity) is violated

Transforming Due To Homoscedasticity If spread of scatter plot of residual vs. predicted response isn’t homogeneous, Then residuals are still functions of the predictor variables Transformation of response may solve the problem

What Transformation To Use? Compute standard deviation of residuals at each y_hat Assume multiple residuals at each predicted value Plot as function of mean of observations Assuming multiple experiments for single set of predictor values Check for linearity: if linear, use a log transform

Other Tests for Transformations If variance against mean of observations is linear, use square-root transform If standard deviation against mean squared is linear, use inverse (1/y) transform If standard deviation against mean to a power is linear, use power transform More covered in the book

General Transformation Principle For some observed relation between standard deviation and mean, let transform to and regress on w

Example: Log Transformation If standard deviation against mean is linear, then So

Confidence Intervals for Nonlinear Regressions For nonlinear fits using general (e.g., exponential) transformations: Confidence intervals apply to transformed parameters Not valid to perform inverse transformation on intervals (which assume normality) Must express confidence intervals in transformed domain This belongs in the advanced regression lecture.

Outliers Atypical observations might be outliers Measurements that are not truly characteristic By chance, several standard deviations out Or mistakes might have been made in measurement Which leads to a problem: Do you include outliers in analysis or not?

Deciding How To Handle Outliers 1. Find them (by looking at scatter plot) 2. Check carefully for experimental error 3. Repeat experiments at predictor values for each outlier 4. Decide whether to include or omit outliers Or do analysis both ways Question: Is first point in last lecture’s example an outlier on rating vs. age plot?

Rating vs. Age

Common Mistakes in Regression Generally based on taking shortcuts Or not being careful Or not understanding some fundamental principle of statistics

Not Verifying Linearity Draw the scatter plot If it’s not linear, check for curvilinear possibilities Misleading to use linear regression when relationship isn’t linear

Relying on Results Without Visual Verification Always check scatter plot as part of regression Examine predicted line vs. actual points Particularly important if regression is done automatically

Some Nonlinear Examples

Attaching Importance To Values of Parameters Numerical values of regression parameters depend on scale of predictor variables So just because a parameter’s value seems “large,” not an indication of importance E.g., converting seconds to microseconds doesn’t change anything fundamental But magnitude of associated parameter changes

Not Specifying Confidence Intervals Samples of observations are random Thus, regression yields parameters with random properties Without confidence interval, impossible to understand what a parameter really means

Not Calculating Coefficient of Determination Without R2, difficult to determine how much of variance is explained by the regression Even if R2 looks good, safest to also perform an F-test Not that much extra effort

Using Coefficient of Correlation Improperly Coefficient of determination is R2 Coefficient of correlation is R R2 gives percentage of variance explained by regression, not R E.g., if R is .5, R2 is .25 And regression explains 25% of variance Not 50%!

Using Highly Correlated Predictor Variables If two predictor variables are highly correlated, using both degrades regression E.g., likely to be correlation between an executable’s on-disk and in-core sizes So don’t use both as predictors of run time Means you need to understand your predictor variables as well as possible

Using Regression Beyond Range of Observations Regression is based on observed behavior in a particular sample Most likely to predict accurately within range of that sample Far outside the range, who knows? E.g., regression on run time of executables < memory size may not predict performance of executables > memory size

Using Too Many Predictor Variables Adding more predictors does not necessarily improve model! More likely to run into multicollinearity problems So what variables to choose? Subject of much of this course

Measuring Too Little of the Range Regression only predicts well near range of observations If you don’t measure commonly used range, regression won’t predict much E.g., if many programs are bigger than main memory, only measuring those that are smaller is a mistake

Assuming Good Predictor Is a Good Controller Correlation isn’t necessarily control Just because variable A is related to variable B, you may not be able to control values of B by varying A E.g., if number of hits on a Web page correlated to server bandwidth, but might not boost hits by increasing bandwidth Often, a goal of regression is finding control variables

White Slide