Analysis of Categorical and Ordinal Data: Binomial and Logistic Regression Lecture 6.

Slides:



Advertisements
Similar presentations
Dummy Dependent variable Models
Advertisements

Continued Psy 524 Ainsworth
Logistic Regression Psy 524 Ainsworth.
3.2 OLS Fitted Values and Residuals -after obtaining OLS estimates, we can then obtain fitted or predicted values for y: -given our actual and predicted.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 13 Nonlinear and Multiple Regression.
1 BINARY CHOICE MODELS: LOGIT ANALYSIS The linear probability model may make the nonsense predictions that an event will occur with probability greater.
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.
Chapter 13 Multiple Regression
Maximum likelihood estimates What are they and why do we care? Relationship to AIC and other model selection criteria.
x – independent variable (input)
Binary Response Lecture 22 Lecture 22.
Introduction to Logistic Regression. Simple linear regression Table 1 Age and systolic blood pressure (SBP) among 33 adult women.
Log-linear and logistic models Generalised linear model ANOVA revisited Log-linear model: Poisson distribution logistic model: Binomial distribution Deviances.
Log-linear and logistic models
Topic 3: Regression.
An Introduction to Logistic Regression
Regression Model Building Setting: Possibly a large set of predictor variables (including interactions). Goal: Fit a parsimonious model that explains variation.
Unit 4b: Fitting the Logistic Model to Data © Andrew Ho, Harvard Graduate School of EducationUnit 4b – Slide 1
MODELS OF QUALITATIVE CHOICE by Bambang Juanda.  Models in which the dependent variable involves two ore more qualitative choices.  Valuable for the.
Regression and Correlation Methods Judy Zhong Ph.D.
Categorical Data Prof. Andy Field.
Day 7 Model Evaluation. Elements of Model evaluation l Goodness of fit l Prediction Error l Bias l Outliers and patterns in residuals.
1 G Lect 11W Logistic Regression Review Maximum Likelihood Estimates Probit Regression and Example Model Fit G Multiple Regression Week 11.
Lecture 3: Inference in Simple Linear Regression BMTRY 701 Biostatistical Methods II.
Excepted from HSRP 734: Advanced Statistical Methods June 5, 2008.
Basic Probability (Chapter 2, W.J.Decoursey, 2003) Objectives: -Define probability and its relationship to relative frequency of an event. -Learn the basic.
Mechanism vs. phenomenology in choosing functional forms: Neighborhood analyses of tree competition Case Study 3 Likelihood Methods in Ecology April 25.
Lecturer: Kem Reat, Viseth, PhD (Economics)
Multiple regression models Experimental design and data analysis for biologists (Quinn & Keough, 2002) Environmental sampling and analysis.
University of Warwick, Department of Sociology, 2014/15 SO 201: SSAASS (Surveys and Statistics) (Richard Lampard) Week 7 Logistic Regression I.
April 4 Logistic Regression –Lee Chapter 9 –Cody and Smith 9:F.
Assessing Binary Outcomes: Logistic Regression Peter T. Donnan Professor of Epidemiology and Biostatistics Statistics for Health Research.
Chapter 5 Demand Estimation Managerial Economics: Economic Tools for Today’s Decision Makers, 4/e By Paul Keat and Philip Young.
Lecture 5 Model Evaluation. Elements of Model evaluation l Goodness of fit l Prediction Error l Bias l Outliers and patterns in residuals.
© Copyright McGraw-Hill Correlation and Regression CHAPTER 10.
Example: Bioassay experiment Problem statement –Observations: At each level of dose, 5 animals are tested, and number of death are observed.
Chapter 11 Statistical Techniques. Data Warehouse and Data Mining Chapter 11 2 Chapter Objectives  Understand when linear regression is an appropriate.
Logistic Regression. Linear Regression Purchases vs. Income.
© Department of Statistics 2012 STATS 330 Lecture 22: Slide 1 Stats 330: Lecture 22.
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.. Chap 14-1 Chapter 14 Introduction to Multiple Regression Basic Business Statistics 10 th Edition.
Introduction to Multiple Regression Lecture 11. The Multiple Regression Model Idea: Examine the linear relationship between 1 dependent (Y) & 2 or more.
Statistical Methods. 2 Concepts and Notations Sample unit – the basic landscape unit at which we wish to establish the presence/absence of the species.
Logistic Regression and Odds Ratios Psych DeShon.
Nonlinear Logistic Regression of Susceptibility to Windthrow Seminar 7 Likelihood Methods in Forest Ecology October 9 th – 20 th, 2006.
Nonparametric Statistics
1 BINARY CHOICE MODELS: LOGIT ANALYSIS The linear probability model may make the nonsense predictions that an event will occur with probability greater.
Mechanism vs. phenomenology in choosing functional forms: Neighborhood analyses of tree competition Case Study 3.
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.
Nonparametric Statistics
The simple linear regression model and parameter estimation
Chapter 4: Basic Estimation Techniques
Lecture 7 - Binomial and Logistic Regression
BINARY LOGISTIC REGRESSION
Chapter 4 Basic Estimation Techniques
Chapter 7. Classification and Prediction
EHS Lecture 14: Linear and logistic regression, task-based assessment
Logistic Regression APKC – STATS AFAC (2016).
Notes on Logistic Regression
Basic Estimation Techniques
Basic Estimation Techniques
CHAPTER 29: Multiple Regression*
Nonparametric Statistics
Introduction to Logistic Regression
Seminar 8 - Binomial and Logistic Regression
Lecture 7 - Binomial and Logistic Regression
Regression and Categorical Predictors
Lecture 7 - Binomial and Logistic Regression
Lecture 7 - Binomial and Logistic Regression
Presentation transcript:

Analysis of Categorical and Ordinal Data: Binomial and Logistic Regression Lecture 6

Analysis of Binary Data l Binomial Regression - Used when the individual “trial” is not the unit of study, but rather when there are replicates of a set of trials (i.e. seedlings in a quadrat) »In the past, folks often analyzed this type of dataset by converting the response variable to a percentage, and then doing regression on the percentages (after doing ugly transformations…) - Model predicts the underlying Binomial probability that would produce the observed number of successes given a number of trials l Logistic Regression - Used when the individual Bernoulli trial is the unit of study (i.e. did the seedling die…) - Model predicts the probability of “success” of a given trial

Steps in a likelihood analysis for binomial regression In R: 1.Specify the “scientific model” that predicts the probability of “success” as a function of a set of independent variables… -- Note that your scientific model should predict expected values bounded by 0 and 1 (since the predicted value is a probability) 2.Define the likelihood function (using dbinom ) binom_log_lh_function <- function(successes,trials,p) { dbinom(x=successes,size=trials, prob = p, log = TRUE) } 3.Set up optimization to find the parameters of the scientific model that maximize likelihood across the dataset

Logistic Regression Example: analysis of windthrow data l Traditionally: Summarize variation in degree and type of damage, across species and tree sizes, from the storm, as a whole... l A likelihood alternative: Use the spatial variation in storm intensity that occurs within a given storm to estimate parameters of functions that describe susceptibility to windthrow, as a function of variation in storm severity and individual tree attributes...

Types of Response Variables (with examples from analysis of windthrow data) l BINARY: Only two possible outcomes (yes, no; lived, died; etc.) - This is termed a “Bernoulli trial” l CATEGORICAL: Multiple categories (uprooted, snapped,...) l ORDINAL: Ordered categories (degree of damage): none, light, medium, heavy, complete canopy loss {usually estimated visually} l CONTINUOUS: just what the term implies, but rarely used in analyses of wind damage because of the difficulties of quantifying damage accurately...

Analysis of Binary Data: Traditional Logistic Regression Definition: Logit = log of an odds ratio (i.e log[p/(1-p)]) Benefits of logits A logit is a continuous variable Ranges from negative when p 0.5 Standard logistic regression involves fitting a linear function to the logit: Consider a sample space consisting of two outcomes (A,B) where the probability that event A occurs is p

What if your terms are multiplicative? Example: Assume that the probability of windthrow is a joint (multiplicative) function of (1)Storm severity, and (2)Tree size In addition, assume that the effect of DBH is nonlinear.... A model that incorporates these can be written as:

A little more detail.... l P isj is the probability of windthrow of the j th individual of species s in plot i l DBH isj is the DBH of that individual l a s, b s, and c s are species-specific, estimated parameters, and l S i is the estimated storm severity in plot i - NOTE: storm severity is an arbitrary index, and was allowed to range from NOTE: you can think of this as a hierarchical model, with trees nested in plots, and S is the plot term But don’t you have to measure storm severity (not estimate it)?

Likelihood Function for Logistic Regression It couldn’t be any easier... (since the scientific model is already expressed as a probabilistic equation):. loglikelihood <- function(pred,observed) { ifelse(observed == 1, log(pred), log(1-pred)) }

Example: Windthrow in the Adirondacks Highly variable damage due to: variation within storm topography susceptibility of species within a stand Reference: Canham, C. D., Papaik, M. J., and Latty, E. F Interspecific variation in susceptibility to windthrow as a function of tree size and storm severity for northern temperate tree species. Canadian Journal of Forest Research 31:1-10.

The dataset l Study area: 15 x 6 km area perpendicular to the storm path l 43 circular plots: ha (19.95 m radius) censused in 1996 (20 of the 43 were in oldgrowth forests) l The plots were chosen to span a wide range of apparent damage l All trees > 10 cm DBH censused l Tallied as windthrown if uprooted or if stem was < 45 o from the ground

Critical data requirements l Variation in storm severity across plots l Variation in DBH and species mixture within plots

The analysis... l 7 species comprised 97% of stems – only stems of those 7 species were included in the dataset for analysis l # parameters = 64 (43 plots + 3 parameters for each of 7 species) l Parameters estimated using simulated annealing

Model evaluation Numbers above bars represent the number of observations in the class The solid line is a 1:1 relationship

Estimating Storm Severity

Results: Big trees...

Little trees...

New twists l Effects of partial harvesting on risk of windthrow to residual trees l Effects of proximity to edges of clearings on risk of windthrow Research with Dave Coates in cedar-hemlock forests of interior B.C.

Effects of harvest intensity and proximity to edge… Equation (2) introduces the effect of prior harvest removal to equation (1) by adding basal area removal and assumes the effect is independent and additive Equation (3) assumes the effects of prior harvest interact with tree size: Models 1a – 3a: test models where separate c coefficients are estimated for “edge” vs. “non-edge” trees (edge = any tree within 10 m of a forest edge) Equation (1): basic model – probability of windthrow is a species-specific function of tree size and storm severity:

Other issues… l Is the risk of windthrow independent of the fate of neighboring trees? (not likely) - Should we examine spatially-explicit models that factor in the “nucleating” process of spread of windthrow gaps?…

Analysis for ORDINAL Response Variables l The categories in this case are ranked (i.e. none, light, heavy damage) l Analysis shifts to cumulative probabilities...

The “Parallel Slopes” form of ordinal logistic regression l The Challenge: Since the response categories are ordinal, and the model predicts cumulative probabilities, we need a scientific model that generates predictions that keep the categories in order (i.e. the cumulative probability that a response should be in or less than level k needs to be greater than the predicted cumulative probability for level k-1 l The Parallel Slopes solution: - Just allow the intercept term in the equation for the logit to vary among the k ordinal responses, while the slope stays constant (Note that you only need k-1 intercepts…)

Simple Ordinal Logistic Regression (i.e. the probability that an observation y will be less than or equal to ordinal level Y k (k = 1.. n-1 levels), given a vector of X explanatory variables), Then simple ordinal logistic regression fits a model of the form: If Remember: The probability that an event will fall into a single class k (rather than the cumulative probability) is simply

In our case... and where a ks, c s and b s are species specific parameters (s = 1.. S species), and S i are the estimated storm severities for the i = 1..N plots. where # of parameters: N + (K-1+2)*S, where N = # of plots, K = # of ordinal response levels, and S = # of species

The Likelihood Function Stays the Same Again, since the scientific model is already expressed as a probabilistic equation: The probability that an event will fall into a single class k (rather than the cumulative probability) is simply

Hurricane Damage in Puerto Rico l Storm damage assessment in the permanent plot at the Luquillo LTER site - Hurricane Hugo Hurricane Georges – 1998 l Combined the data into a single analysis: 136 plots, 13 species (including 1 lumped category for “other” species), and 3 damage levels: - No or light damage - Partial damage - Complete canopy loss l Total # of parameters = 188 (15,647 trees) Canham, C. D., J. Thompson, J. K. Zimmerman, and M. Uriarte Variation in susceptibility to hurricane damage as a function of storm intensity in Puerto Rican tree species. Biotropica 42:87-94.

Parameter Estimation with Simulated Annealing Solving simultaneously for 188 parameters in a dataset containing > 15,000 trees takes time!

Model Evaluation

Comparison of the two storms... Statistics on variation in storm severity from Hurricanes Hugo and Georges