Logistic Regression Psy 524 Ainsworth.

Slides:



Advertisements
Similar presentations
Dummy Dependent variable Models
Advertisements

Continued Psy 524 Ainsworth
Linear Regression.
Brief introduction on Logistic Regression
Logistic Regression I Outline Introduction to maximum likelihood estimation (MLE) Introduction to Generalized Linear Models The simplest logistic regression.
Regression analysis Linear regression Logistic regression.
Logistic Regression.
Week 3. Logistic Regression Overview and applications Additional issues Select Inputs Optimize complexity Transforming Inputs.
Logistic Regression Multivariate Analysis. What is a log and an exponent? Log is the power to which a base of 10 must be raised to produce a given number.
LINEAR REGRESSION: Evaluating Regression Models Overview Assumptions for Linear Regression Evaluating a Regression Model.
LINEAR REGRESSION: Evaluating Regression Models. Overview Assumptions for Linear Regression Evaluating a Regression Model.
Maximum likelihood estimates What are they and why do we care? Relationship to AIC and other model selection criteria.
Multiple Linear Regression Model
Introduction to Logistic Regression. Simple linear regression Table 1 Age and systolic blood pressure (SBP) among 33 adult women.
ANCOVA Psy 420 Andrew Ainsworth. What is ANCOVA?
Topic 3: Regression.
An Introduction to Logistic Regression
Structural Equation Modeling Intro to SEM Psy 524 Ainsworth.
Generalized Linear Models
Statistical hypothesis testing – Inferential statistics II. Testing for associations.
MODELS OF QUALITATIVE CHOICE by Bambang Juanda.  Models in which the dependent variable involves two ore more qualitative choices.  Valuable for the.
Logistic Regression- Dichotomous Dependent Variables March 21 & 23, 2011.
Discriminant Function Analysis Basics Psy524 Andrew Ainsworth.
Multinomial Logistic Regression Basic Relationships
ALISON BOWLING THE GENERAL LINEAR MODEL. ALTERNATIVE EXPRESSION OF THE MODEL.
Excepted from HSRP 734: Advanced Statistical Methods June 5, 2008.
HSRP 734: Advanced Statistical Methods June 19, 2008.
Logistic Regression STA2101/442 F 2014 See last slide for copyright information.
Multiple Regression The Basics. Multiple Regression (MR) Predicting one DV from a set of predictors, the DV should be interval/ratio or at least assumed.
April 6 Logistic Regression –Estimating probability based on logistic model –Testing differences among multiple groups –Assumptions for model.
Logistic regression A quick intro. Why Logistic Regression? Big idea: dependent variable is a dichotomy (though can use for more than 2 categories i.e.
University of Warwick, Department of Sociology, 2014/15 SO 201: SSAASS (Surveys and Statistics) (Richard Lampard) Week 7 Logistic Regression I.
Multiple Regression and Model Building Chapter 15 Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
LOGISTIC REGRESSION A statistical procedure to relate the probability of an event to explanatory variables Used in epidemiology to describe and evaluate.
Linear correlation and linear regression + summary of tests
When and why to use Logistic Regression?  The response variable has to be binary or ordinal.  Predictors can be continuous, discrete, or combinations.
April 4 Logistic Regression –Lee Chapter 9 –Cody and Smith 9:F.
Week 5: Logistic regression analysis Overview Questions from last week What is logistic regression analysis? The mathematical model Interpreting the β.
Educational Research Chapter 13 Inferential Statistics Gay, Mills, and Airasian 10 th Edition.
Adjusted from slides attributed to Andrew Ainsworth
Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Model Building and Model Diagnostics Chapter 15.
Logistic Regression. Linear Regression Purchases vs. Income.
Multiple Logistic Regression STAT E-150 Statistical Methods.
Linear Discriminant Analysis and Logistic Regression.
LOGISTIC REGRESSION Binary dependent variable (pass-fail) Odds ratio: p/(1-p) eg. 1/9 means 1 time in 10 pass, 9 times fail Log-odds ratio: y = ln[p/(1-p)]
1 Introduction to Modeling Beyond the Basics (Chapter 7)
Logistic Regression and Odds Ratios Psych DeShon.
Nonparametric Statistics
Multiple Linear Regression An introduction, some assumptions, and then model reduction 1.
Lecturer: Ing. Martina Hanová, PhD.. Regression analysis Regression analysis is a tool for analyzing relationships between financial variables:  Identify.
5. Evaluation of measuring tools: reliability Psychometrics. 2011/12. Group A (English)
LOGISTIC REGRESSION. Purpose  Logistical regression is regularly used when there are only two categories of the dependent variable and there is a mixture.
Logistic Regression: Regression with a Binary Dependent Variable.
Chapter 13 LOGISTIC REGRESSION. Set of independent variables Categorical outcome measure, generally dichotomous.
Nonparametric Statistics
BINARY LOGISTIC REGRESSION
Statistical Modelling
Logistic Regression When and why do we use logistic regression?
Logistic Regression APKC – STATS AFAC (2016).
Generalized Linear Models
Multiple logistic regression
Nonparametric Statistics
Multiple Regression A curvilinear relationship between one variable and the values of two or more other independent variables. Y = intercept + (slope1.
Ass. Prof. Dr. Mogeeb Mosleh
Introduction to Logistic Regression
Checking Assumptions Primary Assumptions Secondary Assumptions
Chapter 6 Logistic Regression: Regression with a Binary Dependent Variable Copyright © 2010 Pearson Education, Inc., publishing as Prentice-Hall.
Logistic Regression.
Structural Equation Modeling
Presentation transcript:

Logistic Regression Psy 524 Ainsworth

What is Logistic Regression? Form of regression that allows the prediction of discrete variables by a mix of continuous and discrete predictors. Addresses the same questions that discriminant function analysis and multiple regression do but with no distributional assumptions on the predictors (the predictors do not have to be normally distributed, linearly related or have equal variance in each group)

What is Logistic Regression? Logistic regression is often used because the relationship between the DV (a discrete variable) and a predictor is non-linear Example from the text: the probability of heart disease changes very little with a ten-point difference among people with low-blood pressure, but a ten point change can mean a drastic change in the probability of heart disease in people with high blood-pressure.

Questions Can the categories be correctly predicted given a set of predictors? Usually once this is established the predictors are manipulated to see if the equation can be simplified. Can the solution generalize to predicting new cases? Comparison of equation with predictors plus intercept to a model with just the intercept

Questions What is the relative importance of each predictor? How does each variable affect the outcome? Does a predictor make the solution better or worse or have no effect?

Questions Are there interactions among predictors? Does adding interactions among predictors (continuous or categorical) improve the model? Continuous predictors should be centered before interactions made in order to avoid multicollinearity. Can parameters be accurately predicted? How good is the model at classifying cases for which the outcome is known ?

Questions What is the prediction equation in the presence of covariates? Can prediction models be tested for relative fit to the data? So called “goodness of fit” statistics What is the strength of association between the outcome variable and a set of predictors? Often in model comparison you want non-significant differences so strength of association is reported for even non-significant effects.

Assumptions The only “real” limitation on logistic regression is that the outcome must be discrete.

Assumptions If the distributional assumptions are met than discriminant function analysis may be more powerful, although it has been shown to overestimate the association using discrete predictors. If the outcome is continuous then multiple regression is more powerful given that the assumptions are met

Assumptions Ratio of cases to variables – using discrete variables requires that there are enough responses in every given category If there are too many cells with no responses parameter estimates and standard errors will likely blow up Also can make groups perfectly separable (e.g. multicollinear) which will make maximum likelihood estimation impossible.

Assumptions Linearity in the logit – the regression equation should have a linear relationship with the logit form of the DV. There is no assumption about the predictors being linearly related to each other.

Assumptions Absence of multicollinearity No outliers Independence of errors – assumes a between subjects design. There are other forms if the design is within subjects.

Background Odds – like probability. Odds are usually written as “5 to 1 odds” which is equivalent to 1 out of five or .20 probability or 20% chance, etc. The problem with probabilities is that they are non-linear Going from .10 to .20 doubles the probability, but going from .80 to .90 barely increases the probability.

Background Odds ratio – the ratio of the odds over 1 – the odds. The probability of winning over the probability of losing. 5 to 1 odds equates to an odds ratio of .20/.80 = .25.

Background Logit – this is the natural log of an odds ratio; often called a log odds even though it really is a log odds ratio. The logit scale is linear and functions much like a z-score scale.

Background LOGITS ARE CONTINOUS, LIKE Z SCORES p = 0.50, then logit = 0 p = 0.70, then logit = 0.84 p = 0.30, then logit = -0.84

Plain old regression Y = A BINARY RESPONSE (DV) 1 POSITIVE RESPONSE (Success) P 0 NEGATIVE RESPONSE (failure) Q = (1-P) MEAN(Y) = P, observed proportion of successes VAR(Y) = PQ, maximized when P = .50, variance depends on mean (P) XJ = ANY TYPE OF PREDICTOR  Continuous, Dichotomous, Polytomous

Plain old regression and it is assumed that errors are normally distributed, with mean=0 and constant variance (i.e., homogeneity of variance)

Plain old regression an expected value is a mean, so The predicted value equals the proportion of observations for which Y|X = 1; P is the probability of Y = 1(A SUCCESS) given X, and Q = 1- P (A FAILURE) given X.

Plain old regression For any value of X, only two errors ( ) are possible, AND . Which occur at rates P|X AND Q|X and with variance (P|X)(Q|X)

Plain old regression Every respondent is given a probability of success and failure which leads to every person having drastically different variances (because they depend on the mean in discrete cases) causing a violation of the homoskedasticity assumption.

Plain old regression Long story short – you can’t use regular old regression when you have discrete outcomes because you don’t meet homoskedasticity.

An alternative – the ogive function An ogive function is a curved s-shaped function and the most common is the logistic function which looks like:

The logistic function

The logistic function Where Y-hat is the estimated probability that the ith case is in a category and u is the regular linear regression equation:

The logistic function

The logistic function Change in probability is not constant (linear) with constant changes in X This means that the probability of a success (Y = 1) given the predictor variable (X) is a non-linear function, specifically a logistic function

The logistic function It is not obvious how the regression coefficients for X are related to changes in the dependent variable (Y) when the model is written this way Change in Y(in probability units)|X depends on value of X. Look at S-shaped function

The logistic function The values in the regression equation b0 and b1 take on slightly different meanings. b0  The regression constant (moves curve left and right) b1 <- The regression slope (steepness of curve)  The threshold, where probability of success = .50

Logistic Function Constant regression constant different slopes v2: b0 = -4.00 b1 = 0.05 (middle) v3: b0 = -4.00 b1 = 0.15 (top) v4: b0 = -4.00 b1 = 0.025 (bottom)

Logistic Function Constant slopes with different regression constants v2: b0 = -3.00 b1 = 0.05 (top) v3: b0 = -4.00 b1 = 0.05 (middle) v4: b0 = -5.00 b1 = 0.05 (bottom)

The Logit By algebraic manipulation, the logistic regression equation can be written in terms of an odds ratio for success:

The Logit Odds ratios range from 0 to positive infinity Odds ratio: P/Q is an odds ratio; less than 1 = less than .50 probability, greater than 1 means greater than .50 probability

The Logit Finally, taking the natural log of both sides, we can write the equation in terms of logits (log-odds): For a single predictor

The Logit For multiple predictors

The Logit Log-odds are a linear function of the predictors The regression coefficients go back to their old interpretation (kind of) The expected value of the logit (log-odds) when X = 0 Called a ‘logit difference’; The amount the logit (log-odds) changes, with a one unit change in X; the amount the logit changes in going from X to X + 1

Conversion EXP(logit) or = odds ratio Probability = odd ratio / (1 + odd ratio)