Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presentation and Data  Short Courses  Regression Analysis Using JMP  Download Data to Desktop 1.

Similar presentations


Presentation on theme: "Presentation and Data  Short Courses  Regression Analysis Using JMP  Download Data to Desktop 1."— Presentation transcript:

1 Presentation and Data http://www.lisa.stat.vt.edu  Short Courses  Regression Analysis Using JMP  Download Data to Desktop 1

2 Mark Seiss, Dept. of Statistics Regression Analysis Using JMP February 28, 2012

3 Presentation Outline 1. Simple Linear Regression 2. Multiple Linear Regression 3. Regression with Binary and Count Response Variables

4 Presentation Outline Questions/Comments Individual Goals/Interests

5 Simple Linear Regression 1.Definition 2.Correlation 3.Model and Estimation 4.Coefficient of Determination (R 2 ) 5.Assumptions 6.Example

6 Simple Linear Regression Simple Linear Regression (SLR) is used to study the relationship between a variable of interest and another variable. Both variables must be continuous Variable of interest known as Response or Dependent Variable Other variable known as Explanatory or Independent Variable Objectives Determine the significance of the explanatory variable in explaining the variability in the response (not necessarily causation). Predict values of the response variable for given values of the explanatory variable.

7 Simple Linear Regression Scatterplots are used to graphically examine the relationship between two quantitative variables. Linear or Non-linear Positive or Negative

8 Simple Linear Regression Positive Linear Relationship Non-Linear RelationshipNo Relationship Negative Linear Relationship

9 Simple Linear Regression Correlation Measures the strength of the linear relationship between two quantitative variables. Pearson Correlation Coefficient Assumption of normality Calculation: Spearman’s Rho and Kendall’s Tau are used for non-normal quantitative variables.

10 Simple Linear Regression Properties of Pearson Correlation Coefficient -1 ≤ r ≤ 1 Positive values of r: as one variable increases, the other increases Negative values of r: as one variable increases, the other decreases Values close to 0 indicate no linear relationship between the two variables Values close to +1 or -1 indicated strong linear relationships Important note: Correlation does not imply causation

11 Simple Linear Regression Pearson Correlation Coefficient: General Guidelines 0 ≤ |r| < 0.2 : Very Weak linear relationship 0.2 ≤ |r| < 0.4 : Weak linear relationship 0.4 ≤ |r| < 0.6 : Moderate linear relationship 0.6 ≤ |r| < 0.8 : Strong linear relationship 0.8 ≤ |r| < 1.0 : Very Strong linear relationship

12 Simple Linear Regression The Simple Linear Regression Model Basic Model: response = deterministic + stochastic Deterministic: model of the linear relationship between X and Y Stochastic: Variation, uncertainty, and miscellaneous factors Model y i = value of the response variable for the i th observation x i = value of the explanatory variable for the i th observation β 0 = y-intercept β 1 = slope ε i = random error, iid Normal(0,σ 2 )

13 Simple Linear Regression Least Square Estimation Predicted Values Residuals

14 Simple Linear Regression Interpretation of Parameters β 0 :Value of Y when X=0 β 1 :Change in the value of Y with an increase of 1 unit of X (also known as the slope of the line) Hypothesis Testing β 0 -Test whether the true y-intercept is different from 0 Null Hypothesis: β 0 =0 Alternative Hypothesis: β 0 ≠0 β 1 -Test whether the slope is different from 0 Null Hypothesis: β 1 =0 Alternative Hypothesis: β 1 ≠0

15 Simple Linear Regression Analysis of Variance (ANOVA) for Simple Linear Regression SourceDfSum of Squares Mean SquareF RatioP-value Model1SSRSSR/1F 1 =MSR/MSEP(F>F 1,1-α,1,n-2) Errorn-2SSESSE/(n-2) Totaln-1SST

16 Simple Linear Regression

17 Coefficient of Determination (R 2 ) Percent variation in the response variable (Y) that is explained by the least squares regression line 0 ≤ R 2 ≤ 1 Calculation:

18 Simple Linear Regression Assumptions of Simple Linear Regression 1.Independence Residuals are independent of each other Related to the method in which the data were collected or time related data Tested by plotting time collected vs. residuals Parametric test: Durbin-Watson Test 2.Constant Variance Variance of the residuals is constant Tested by plotting predicted values vs. residuals Parametric test:Brown-Forsythe Test

19 Simple Linear Regression Assumptions of Simple Linear Regression 3.Normality Residuals are normally distributed Tested by evaluating histograms and normal-quantile plots of residuals Parametric test: Shapiro Wilkes test

20 Simple Linear Regression Constant Variance: Plot of Fitted Values vs. Residuals Good Residual Plot: No Pattern Bad Residual Plot: Variability Increasing Predicted Values

21 Simple Linear Regression Normality: Histogram and Q-Q Plot of Residuals Normal Assumption Appropriate Normal Assumption Not Appropriate

22 Simple Linear Regression Some Remedies Non-Constant Variance: Weight Least Squares Non-normality:Box-Cox Transformation Dependence:Auto-Regressive Models

23 Simple Linear Regression Example Dataset: Chirps of Ground Crickets Pierce (1949) measure the frequency (the number of wing vibrations per second) of chirps made by a ground cricket, at various ground temperature. Filename: chirp.jmp

24 Simple Linear Regression Questions/Comments about Simple Linear Regression

25 Multiple Linear Regression 1.Definition 2.Categorical Explanatory Variables 3.Model and Estimation 4.Adjusted Coefficient of Determination 5.Assumptions 6.Model Selection 7.Example

26 Multiple Linear Regression Explanatory Variables Two Types: Continuous and Categorical Continuous Predictor Variables Examples – Time, Grade Point Average, Test Score, etc. Coded with one parameter – β # x # Categorical Predictor Variables Examples – Sex, Political Affiliation, Marital Status, etc. Actual value assigned to Category not important Ex) Sex - Male/Female, M/F, 1/2, 0/1, etc. Coded Differently than continuous variables

27 Multiple Linear Regression Categorical Explanatory Variables Consider a categorical explanatory variable with L categories One category selected as reference category Assignment of Reference Category is arbitrary Variable represented by L-1 dummy variables Model Identifiability Effect Coding (Used in JMP) x k = 1 if explanatory variable is equal to category k 0 otherwise x k = -1 for all k if explanatory variable equals category I

28 Multiple Linear Regression Similar to simple linear regression, except now there is more than one explanatory variable, which may be quantitative and/or qualitative. Model y i = value of the response variable for the i th observation x #i = value of the explanatory variable # for the i th observation β 0 = y-intercept β # = parameter corresponding to explanatory variable # ε i = random error, iid Normal(0,σ 2 )

29 Multiple Linear Regression Least Square Estimation Predicted Values Residuals

30 Multiple Linear Regression Interpretation of Parameters β 0 :Value of Y when X=0 Β # :Change in the value of Y with an increase of 1 unit of X # in the presence of the other explanatory variables Hypothesis Testing β 0 -Test whether the true y-intercept is different from 0 Null Hypothesis: β 0 =0 Alternative Hypothesis: β 0 ≠0 Β # -Test of whether the value change in Y with an increase of 1 unit in X# is different from 0 in the presence of the other explanatory variables. Null Hypothesis: β # =0 Alternative Hypothesis: β # ≠0

31 Multiple Linear Regression Adjusted Coefficient of Determination (R 2 ) Percent variation in the response variable (Y) that is explained by the least squares regression line with explanatory variables x 1, x 2,…,x p Calculation of R 2 : The R 2 value will increase as explanatory variables added to the model The adjusted R 2 introduces a penalty for the number of explanatory variables.

32 Multiple Linear Regression Other Model Evaluation Statistics Akaike Information Criterion (AIC or AICc) Schwartz Information Criterion (SIC) Bayesian Information Criterion (BIC) Mallows’ C p Prediction Sum of Squares (PRESS)

33 Multiple Linear Regression Model Selection 2 Goals:Complex enough to fit the data well Simple to interpret, does not overfit the data Study the effect of each explanatory variable on the response Y Continuous Variable – Graph Y versus X Categorical Variable - Boxplot of Y for categories of X

34 Multiple Linear Regression Model Selection cont. Multicollinearity Correlations among explanatory variables resulting in an increase in variance Reduces the significance value of the variable Occurs when several explanatory variables are used in the model

35 Multiple Linear Regression Algorithmic Model Selection Backward Selection: Start with all explanatory variables in the model and remove those that are insignificant Forward Selection:Start with no explanatory variables in the model and add best explanatory variables one at a time Stepwise Selection:Start with two forward selection steps then alternate backward and forward selection steps until no variables to add or remove

36 Multiple Linear Regression Example Dataset:Discrimination in Salaries A researcher was interested in whether there was discrimination in the salaries of tenure track professors at a small college. The professor collected six variables from 52 professors. Filename: Salary.xls Reference: S. Weisberg (1985). Applied Linear Regression, Second Edition. New York: John Wiley and Sons. Page 194.

37 Multiple Linear Regression Other Multiple Linear Regression Issues Outliers Interaction Terms Higher Order Terms

38 Multiple Linear Regression Questions/Comments about Multiple Linear Regression

39 Regression with Non-Normal Response 1.Logistic Regression with Binary Response 2. Poisson Regression with Count Response

40 Logistic Regression Consider a binary response variable. Variable with two outcomes One outcome represented by a 1 and the other represented by a 0 Examples: Does the person have a disease? Yes or No Who is the person voting for?McCain or Obama Outcome of a baseball game? Win or loss

41 Logistic Regression Consider the linear probability model where y i = response for observation i x i = quantitative explanatory variable Predicted values represent the probability of Y=1 given X Issue: Predicted probability for some subjects fall outside of the [0,1] range.

42 Logistic Regression Consider the logistic regression model Predicted values from the regression equation fall between 0 and 1

43 Logistic Regression Interpretation of Coefficient β – Odds Ratio The odds ratio is a statistic that measures the odds of an event compared to the odds of another event. Say the probability of Event 1 is π 1 and the probability of Event 2 is π 2. Then the odds ratio of Event 1 to Event 2 is: Value of Odds Ratio range from 0 to Infinity Value between 0 and 1 indicate the odds of Event 2 are greater Value between 1 and infinity indicate odds of Event 1 are greater Value equal to 1 indicates events are equally likely

44 Logistic Regression Example Dataset: A researcher is interested how GRE exam scores, GPA, and prestige of a students undergraduate institution affect admission into graduate school. Filename: Admittance.csv Important Note:JMP models the probability of the 0 category

45 Poisson Regression Consider a count response variable. Response variable is the number of occurrences in a given time frame. Outcomes equal to 0, 1, 2, …. Examples: Number of penalties during a football game. Number of customers shop at a store on a given day. Number of car accidents at an intersection.

46 Poisson Regression Consider the model where y i = response for observation i x i = quantitative explanatory variable for observation i Issue: Predicted values range from -∞ to +∞

47 Poisson Regression Consider the Poisson log-linear model Predicted response values fall between 0 and +∞ In the case of a single predictor, An increase of one unit of x results an increase of exp(β) in μ

48 Poisson Regression Example Data Set: Researchers are interested in the number of awards earned by students at a high school. Other variables measured as possible explanatory variables include type of program in which the student was enrolled (vocational, general, or academic), and the final score on their math final exam. Filename: Awards.csv

49 Attendee Questions If time permits


Download ppt "Presentation and Data  Short Courses  Regression Analysis Using JMP  Download Data to Desktop 1."

Similar presentations


Ads by Google