Logistic Regression. Continued Psy 524 Ainsworth

Similar documents
7. Assumes that there is little or no multicollinearity (however, SPSS will not assess this in the [binary] Logistic Regression procedure).

Basic Medical Statistics Course

Class Notes: Week 8. Probit versus Logit Link Functions and Count Data

Chapter 19: Logistic regression

Correlation and regression

2/26/2017. PSY 512: Advanced Statistics for Psychological and Behavioral Research 2

" M A #M B. Standard deviation of the population (Greek lowercase letter sigma) σ 2

Investigating Models with Two or Three Categories

SOS3003 Applied data analysis for social science Lecture note Erling Berge Department of sociology and political science NTNU.

Lecture 12: Effect modification, and confounding in logistic regression

Analysis of Categorical Data. Nick Jackson University of Southern California Department of Psychology 10/11/2013

Advanced Quantitative Data Analysis

MULTINOMIAL LOGISTIC REGRESSION

Section IX. Introduction to Logistic Regression for binary outcomes. Poisson regression

Hierarchical Generalized Linear Models. ERSH 8990 REMS Seminar on HLM Last Lecture!

Additional Notes: Investigating a Random Slope. When we have fixed level-1 predictors at level 2 we show them like this:

Statistics in medicine

Statistical Modelling with Stata: Binary Outcomes

Logistic Regression: Regression with a Binary Dependent Variable

Chapter 19: Logistic regression

Binary Logistic Regression

8 Nominal and Ordinal Logistic Regression

Linear Regression Models P8111

Multinomial Logistic Regression Models

EDF 7405 Advanced Quantitative Methods in Educational Research. Data are available on IQ of the child and seven potential predictors.

Generalized Models: Part 1

Dependent Variable Q83: Attended meetings of your town or city council (0=no, 1=yes)

Goodness-of-Fit Tests for the Ordinal Response Models with Misspecified Links

Stat 642, Lecture notes for 04/12/05 96

Model Estimation Example

Generalized Linear Models for Non-Normal Data

Time-Invariant Predictors in Longitudinal Models

Ron Heck, Fall Week 3: Notes Building a Two-Level Model

Simple logistic regression

ONE MORE TIME ABOUT R 2 MEASURES OF FIT IN LOGISTIC REGRESSION

Single-level Models for Binary Responses

Introducing Generalized Linear Models: Logistic Regression

Introduction to Generalized Models

Unit 11: Multiple Linear Regression

Ron Heck, Fall Week 8: Introducing Generalized Linear Models: Logistic Regression 1 (Replaces prior revision dated October 20, 2011)

LOGISTICS REGRESSION FOR SAMPLE SURVEYS

Analysing categorical data using logit models

NATIONAL UNIVERSITY OF SINGAPORE EXAMINATION. ST3241 Categorical Data Analysis. (Semester II: ) April/May, 2011 Time Allowed : 2 Hours

Logistic Regression Models for Multinomial and Ordinal Outcomes

Stat/F&W Ecol/Hort 572 Review Points Ané, Spring 2010

Logistic Regression Analysis

Logistic Regression. Interpretation of linear regression. Other types of outcomes. 0-1 response variable: Wound infection. Usual linear regression

Categorical data analysis Chapter 5

Comparing IRT with Other Models

EPSY 905: Fundamentals of Multivariate Modeling Online Lecture #7

Ronald Heck Week 14 1 EDEP 768E: Seminar in Categorical Data Modeling (F2012) Nov. 17, 2012

Assessing the relation between language comprehension and performance in general chemistry. Appendices

Measurement Invariance (MI) in CFA and Differential Item Functioning (DIF) in IRT/IFA

Data-analysis and Retrieval Ordinal Classification

THE PEARSON CORRELATION COEFFICIENT

Example 7b: Generalized Models for Ordinal Longitudinal Data using SAS GLIMMIX, STATA MEOLOGIT, and MPLUS (last proportional odds model only)

Using the same data as before, here is part of the output we get in Stata when we do a logistic regression of Grade on Gpa, Tuce and Psi.

Basic IRT Concepts, Models, and Assumptions

ESP 178 Applied Research Methods. 2/23: Quantitative Analysis

Generalized Linear Models 1

Statistics 262: Intermediate Biostatistics Model selection

Time-Invariant Predictors in Longitudinal Models

LOGISTIC REGRESSION. Lalmohan Bhar Indian Agricultural Statistics Research Institute, New Delhi

Chapter 14 Logistic and Poisson Regressions

Procedia - Social and Behavioral Sciences 109 ( 2014 )

ST3241 Categorical Data Analysis I Multicategory Logit Models. Logit Models For Nominal Responses

Generalized linear models

Tables Table A Table B Table C Table D Table E 675

Single and multiple linear regression analysis

Can you tell the relationship between students SAT scores and their college grades?

Generalized linear models

Chapter 1. Modeling Basics

Binary Choice Models Probit & Logit. = 0 with Pr = 0 = 1. decision-making purchase of durable consumer products unemployment

Glossary for the Triola Statistics Series

Bivariate Relationships Between Variables

ECLT 5810 Linear Regression and Logistic Regression for Classification. Prof. Wai Lam

A note on R 2 measures for Poisson and logistic regression models when both models are applicable

NATIONAL UNIVERSITY OF SINGAPORE EXAMINATION (SOLUTIONS) ST3241 Categorical Data Analysis. (Semester II: )

Machine Learning Linear Classification. Prof. Matteo Matteucci

NELS 88. Latent Response Variable Formulation Versus Probability Curve Formulation

Logistic Regression. Building, Interpreting and Assessing the Goodness-of-fit for a logistic regression model

176 Index. G Gradient, 4, 17, 22, 24, 42, 44, 45, 51, 52, 55, 56

Review. Timothy Hanson. Department of Statistics, University of South Carolina. Stat 770: Categorical Data Analysis

Chapter 14. Multiple Regression Models. Multiple Regression Models. Multiple Regression Models

i PASW Regression 18

Psych 230. Psychological Measurement and Statistics

Categorical Predictor Variables

A COEFFICIENT OF DETERMINATION FOR LOGISTIC REGRESSION MODELS

Correlation and Regression Bangkok, 14-18, Sept. 2015

Utilization of Addictions Services

STA 303 H1S / 1002 HS Winter 2011 Test March 7, ab 1cde 2abcde 2fghij 3

DETAILED CONTENTS PART I INTRODUCTION AND DESCRIPTIVE STATISTICS. 1. Introduction to Statistics

Structural Equation Modeling and Confirmatory Factor Analysis. Types of Variables

Exam Applied Statistical Regression. Good Luck!

ECON 5350 Class Notes Functional Form and Structural Change

22s:152 Applied Linear Regression

MULTILEVEL MODELS. Multilevel-analysis in SPSS - step by step

Longitudinal Modeling with Logistic Regression

Binary Dependent Variables

Review of Multiple Regression

Transcription:

Logistic Regression Continued Psy 524 Ainsworth

Equations Regression Equation Y e = 1 + A+ B X + B X + B X 1 1 2 2 3 3 i A+ B X + B X + B X e 1 1 2 2 3 3

Equations The linear part of the logistic regression equation is used to find the probability of being in a category based on the combination of predictors Programs like SPSS and SAS separate discrete predictors with more than two levels into multiple dichotomous variables.

Equations Fall (0 = no, 1 = yes); Difficulty is continuous; season (1 = autumn, 2 = winter, 3 = spring) Fall Difficulty Season 1 3 1 1 1 1 0 1 3 1 2 3 1 3 2 0 2 2 0 1 2 1 3 1 1 2 3 1 2 1 0 2 2 0 2 3 1 3 2 1 2 2 0 3 1

Equations Season is a discrete variable with three levels that would be turned into 2 separate variables season 1 and season 2. Season 1 is coded 1 for autumn and 0 otherwise; season 2 is coded 1 if winter and 0 otherwise; spring is coded when both are 0.

Fall DifficultySeasonSeason1Season2 1 3 1 1 0 1 1 1 1 0 0 1 3 0 0 1 2 3 0 0 1 3 2 0 1 0 2 2 0 1 0 1 2 0 1 1 3 1 1 0 1 2 3 0 0 1 2 1 1 0 0 2 2 0 1 0 2 3 0 0 1 3 2 0 1 1 2 2 0 1 0 3 1 1 0

Interpreting coefficients Good news regression coefficients and their standard errors are found through advanced calculus methods of maximum likelihood (e.g. derivatives, etc.), so we re not getting into it.

Interpreting coefficientss Each coefficient is evaluated using a Wald test (really just a Z-test) W j = B SE j B j

Interpreting coefficients Term Coefficient Standard Error Wald Test (Z) (Constant) -1.776 1.89-0.88 Difficulty 1.01 0.9 1.27 Season (1) 0.927 1.59 0.34 Season (2) -0.418 1.39-0.09

Interpreting coefficients The tests of the coefficients are approximate z-scores so they are tested as z-scores. None of the coefficients are significant in the sample data. The coefficients are placed into the model like in regular multiple regression in order to predict individual subjects probabilities.

Goodness of fit Log-likelihood N log likelihood = [ Yiln( Y ) i) + (1 Yi)ln(1 Y ) i)] i= 1

Goodness of fit Models are compared by taking 2 times the difference between the models loglikelihoods. 2 χ = 2[(log-likelihood for bigger model) - (log-likelihood for smaller model)] Note: models must be nested in order to be compared. Nested means that all components of the smaller model must be in the larger model.

Goodness of fit Often a model with intercept and predictors is compared to an intercept only model to test whether the predictors add over and above the intercept only. This is usually noted as χ2=2[ll(b)-ll(0)]

Loglikelihood for intercept only model (Yhat = e.405 /1 + e.405 ) Fall Yhat 1-Yhat Y*lnYhat (1-Y)*(1-Yhat) Σ[YlnYhat + (1 Y)ln(1 Yhat) 1.60.40 -.51 0 -.51 1.60.40 -.51 0 -.51 0.60.40 0 -.92 -.92 1.60.40 -.51 0 -.51 1.60.40 -.51 0 -.51 0.60.40 0 -.92 -.92 0.60.40 0 -.92 -.92 1.60.40 -.51 0 -.51 1.60.40 -.51 0 -.51 1.60.40 -.51 0 -.51 0.60.40 0 -.92 -.92 0.60.40 0 -.92 -.92 1.60.40 -.51 0 -.51 1.60.40 -.51 0 -.51 0.60.40 0 -.92 -.92 Sum= -10.11

Loglikelihood for intercept only model (Yhat = e -1.776 + seas1(.927) + seas2(-.418) / 1 + e -1.776 + seas1(.927) + seas2(-.418) ) Fall Yhat 1-Yhat Y*lnYhat (1-Y)*(1-Yhat) Σ[YlnYhat + (1 Y)ln(1 Yhat) 1.899 0.101-0.106 0-0.106 1.540 0.460-0.616 0-0.616 0.317 0.683 0-0.381-0.381 1.561 0.439-0.578 0-0.578 1.698 0.302-0.360 0-0.360 0.457 0.543 0-0.611-0.611 0.234 0.766 0-0.267-0.267 1.899 0.101-0.106 0-0.106 1.561 0.439-0.578 0-0.578 1.764 0.236-0.269 0-0.269 0.457 0.543 0-0.611-0.611 0.561 0.439 0-0.823-0.823 1.698 0.302-0.360 0-0.360 1.457 0.543-0.783 0-0.783 0.899 0.101 0-2.293-2.293 Sum= -8.74

Goodness of Fit 2[-8.74 - (-10.11)] = 2.74 the constant only model has one degree of freedom (for the constant) and the full model has 4 degrees of freedom (1 for the constant, and one for each predictor), the DF for the test is 4 1 = 3. The test of the chi-square is not significant at 3 DFs so the null is retained. Models with different numbers of predictors (nested) can also be compared in the same fashion.

Standardized Residuals Given a model you can calculate the standardized residual of each persons predicted probability (using the rather scary matrix formula on page 527) You can have SPSS save the standardized residuals and once this is done you can analyze them to see if any are above 3.3 and if they are the subject is an outlier according to the given model.

Types of Logistic Regression Direct or Simultaneous Sequential or User defined Stepwise or Statistical Probit vs. Logistic Logistic assumes a categorical (qualitative) underlying distribution Probit assumes a normal distribution and uses Z- scores to estimate the proportion under the curve. Near.5 the analyses are similar they only differ at the extremes.

Inferential Tests Assessing goodness of fit for the model There are many goodness of fit indices, so you need to keep in mind what is being compared to know whether a significant difference is good or not. Some tests significance means fit and others significance means lack of fit.

Inferential Tests Also consider sample sized when evaluating goodness of fit. Chi-square statistics are heavily influenced by sample size so that with a very large sample even minute differences will be significant. If the sample size is large and the chi-square is significant this may not be important Though if there is significance and the sample is relatively small than the effect is notable.

Inferential Tests Constant only vs. full model here you want there to be a significant improvement to the prediction when all of the predictors are added to the model. Perfect model vs. proposed model some programs test the proposed model against a perfect model (one that predicts perfectly) in this case you want the chi-square to be non-significant.

Inferential Tests Deciles of risk Step 1: Subjects are ordered on there predicted probability Step 2: Subjects are divided into 10 groups based on the probabilities (all subjects with.1or lower in lowest decile,.9 or higher in the highest decile, etc.) Step 3: Divide subjects into groups according to their actual outcome (e.g. fall or no fall) creating a 2 X 10 matrix of observed frequencies for the example data. Step 4: Expected frequencies are calculated and the observed frequencies are compared to the expected frequencies in a chi-square test. Fit is indicated by a nonsignificant chi-square. In SPSS this is given by the Hosmer-Lemeshow test.

Test of individual predictors The Wald test is usually used to assess the significance of prediction of each predictor The Wald test is known to be overly conservative (increased type II error) and when a predictor is multinomial it does not give a test of the whole predictor but only the dummy coded versions of the predictor.

Number and type of outcomes Logistic regression with more than two outcome categories If the response are ordered polytomous than k 1 equations are made (k being the number of categories) which predicts the probability that a case is above a given category. Defines thresholds point in the data that separates category one form two, two from three, etc. Calculates the probability that a person passes a given threshold This is done for all categories except the last because the probability of being in a category above the highest is zero.

Number and type of outcomes If the responses are non-ordered multinomial than again k 1 equations are created but the equations are predicting whether a person belongs to a category or not. An equation is made for all categories except the last. SPSS ordinal (plum) is used for ordered polytomous and SPSS multinomial (nomreg) is used for un-ordered multinomial data.

Strength of association (pseudo R-square) There are several measures intended to mimic the R-squared analysis, but none of them are an R-squared. The interpretation is not the same, but they can be interpreted as an approximate variance in the outcome accounted for by the

Strength of association (pseudo R-square) McFadden s LL( B) ρ 2 = 1 LL(0) this value tends to be smaller than R- square and values of.2 to.4 are considered highly satisfactory.

Strength of association (pseudo R-square) Cox and Snell is also based on loglikelihood but it takes the sample size into account: R = 1 exp [ LL( B) LL(0)] n 2 2 CS but it cannot reach a maximum of 1 like we would like so

Strength of association (pseudo R-square) The Nagelkerke measure adjusts the C and S measure for the maximum value so that 1 can be achieved: R R, where R 1 exp[2( n ) LL(0)] 2 2 2 CS 2 1 N = MAX = RMAX