Docsity

Agresti - Categorical Data Analysis, Notas de estudo de Estatística

Pré-visualização parcial do texto

Baixe Agresti - Categorical Data Analysis e outras Notas de estudo em PDF para Estatística, somente na Docsity!

Categorical Data Analysis

Categorical Data Analysis

Second Edition

ALAN AGRESTI

University of Florida Gainesville, Florida

This book is printed on acid-free paper. (^) "

Copyright  2002 John Wiley & Sons, Inc., Hoboken, New Jersey. All rights reserved.

Published simultaneously in Canada.

No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, Ž^978. 750-8400, fax Ž^978. 750-4744. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 605 Third Avenue, New York, NY 10158-0012, Ž^212. 850-6011, fax Ž^212. 850-6008, E-Mail: [email protected].

For ordering and customer service, call 1-800-CALL-WILEY.

Library of Congress Cataloging-in-Publication Data Is A © ailable

ISBN 0-471-36093-

Printed in the United States of America

10 9 8 7 6 5 4 3 2 1

Contents

x CONTENTS

9.7 Poisson Regression for Rates, 385 9.8 Empty Cells and Sparseness in Modeling Contingency Tables, 391 Notes, 398 Problems, 400

10. Models for Matched Pairs 409

10.1 Comparing Dependent Proportions, 410 10.2 Conditional Logistic Regression for Binary Matched Pairs, 414 10.3 Marginal Models for Square Contingency Tables, 420 10.4 Symmetry, Quasi-symmetry, and Quasi- independence, 423 10.5 Measuring Agreement Between Observers, 431 10.6 BradleyTerry Model for Paired Preferences, 436 10.7 Marginal Models and Quasi-symmetry Models for Matched Sets,* 439 Notes, 442 Problems, 444

11. Analyzing Repeated Categorical Response Data 455

11.1 Comparing Marginal Distributions: Multiple Responses, 456 11.2 Marginal Modeling: Maximum Likelihood Approach, 459 11.3 Marginal Modeling: Generalized Estimating Equations Approach, 466 11.4 Quasi-likelihood and Its GEE Multivariate Extension: Details,* 470 11.5 Markov Chains: Transitional Modeling, 476 Notes, 481 Problems, 482

12. Random Effects: Generalized Linear Mixed Models for Categorical Responses 491 12.1 Random Effects Modeling of Clustered Categorical Data, 492 12.2 Binary Responses: Logistic-Normal Model, 496 12.3 Examples of Random Effects Models for Binary Data, 502 12.4 Random Effects Models for Multinomial Data, 513

CONTENTS xi

12.5 Multivariate Random Effects Models for Binary Data,

Preface

The explosion in the development of methods for analyzing categorical data that began in the 1960s has continued apace in recent years. This book provides an overview of these methods, as well as older, now standard, methods. It gives special emphasis to generalized linear modeling techniques, which extend linear model methods for continuous variables, and their extensions for multivariate responses. Today, because of this development and the ubiquity of categorical data in applications, most statistics and biostatistics departments offer courses on categorical data analysis. This book can be used as a text for such courses. The material in Chapters 17 forms the heart of most courses. Chapters 1 3 cover distributions for categorical responses and traditional methods for two-way contingency tables. Chapters 47 introduce logistic regression and related logit models for binary and multicategory response variables. Chap- ters 8 and 9 cover loglinear models for contingency tables. Over time, this model class seems to have lost importance, and this edition reduces some- what its discussion of them and expands its focus on logistic regression. In the past decade, the major area of new research has been the develop- ment of methods for repeated measurement and other forms of clustered categorical data. Chapters 1013 present these methods, including marginal models and generalized linear mixed models with random effects. Chapters 14 and 15 present theoretical foundations as well as alternatives to the maximum likelihood paradigm that this text adopts. Chapter 16 is devoted to a historical overview of the development of the methods. It examines contri- butions of noted statisticians, such as Pearson and Fisher, whose pioneering effortsand sometimes vocal debatesbroke the ground for this evolution. Every chapter of the first edition has been extensively rewritten, and some substantial additions and changes have occurred. The major differences are:

 (^) A new Chapter 1 that introduces distributions and methods of inference for categorical data.  (^) A unified presentation of models as special cases of generalized linear models, starting in Chapter 4 and then throughout the text. xiii

xiv PREFACE

 (^) Greater emphasis on logistic regression for binary response variables and extensions for multicategory responses, with Chapters 47 introduc- ing models and Chapters 1013 extending them for clustered data.  (^) Three new chapters on methods for clustered, correlated categorical data, increasingly important in applications.  (^) A new chapter on the historical development of the methods.  (^) More discussion of ‘‘exact’’ small-sample procedures and of conditional logistic regression.

In this text, I interpret categorical data analysis to refer to methods for categorical response variables. For most methods, explanatory variables can be qualitative or quantitative, as in ordinary regression. Thus, the focus is intended to be more general than contingency table analysis, although for simplicity of data presentation, most examples use contingency tables. These examples are often simplistic, but should help readers focus on understand- ing the methods themselves and make it easier for them to replicate results with their favorite software. Special features of the text include:

 (^) More than 100 analyses of ‘‘real’’ data sets.  (^) More than 600 exercises at the end of the chapters, some directed towards theory and methods and some towards applications and data analysis.  (^) An appendix that shows, by chapter, the use of SAS for performing analyses presented in this book.  (^) Notes at the end of each chapter that provide references for recent research and many topics not covered in the text.

Appendix A summarizes statistical software needed to use the methods described in this text. It shows how to use SAS for analyses included in the text and refers to a web site Ž^ www.stat.ufl.edur aarcdarcda.html .that contains Ž. 1 information on the use of other software Žsuch as R, S-plus, SPSS, and Stata ,^.^ Ž. 2 data sets for examples in the form of complete SAS programs for conducting the analyses, Ž. 3 short answers for many of the odd-numbered exercises, Ž. 4 corrections of errors in early printings of the book, and Ž. 5 extra exercises. I recommend that readers refer to this ap- pendix or specialized manuals while reading the text, as an aid to implement- ing the methods. I intend this book to be accessible to the diverse mix of students who take graduate-level courses in categorical data analysis. But I have also written it with practicing statisticians and biostatisticians in mind. I hope it enables them to catch up with recent advances and learn about methods that sometimes receive inadequate attention in the traditional statistics curricu- lum.

C H A P T E R 1

Introduction: Distributions and

Inference for Categorical Data

From helping to assess the value of new medical treatments to evaluating the factors that affect our opinions and behaviors, analysts today are finding myriad uses for categorical data methods. In this book we introduce these methods and the theory behind them. Statistical methods for categorical responses were late in gaining the level of sophistication achieved early in the twentieth century by methods for continuous responses. Despite influential work around 1900 by the British statistician Karl Pearson, relatively little development of models for categori- cal responses occurred until the 1960s. In this book we describe the early fundamental work that still has importance today but place primary emphasis on more recent modeling approaches. Before outlining the topics covered, we describe the major types of categorical data.

1.1 CATEGORICAL RESPONSE DATA

A categorical ® ariable has a measurement scale consisting of a set of cate- gories. For instance, political philosophy is often measured as liberal, moder- ate, or conservative. Diagnoses regarding breast cancer based on a mammo- gram use the categories normal, benign, probably benign, suspicious, and malignant. The development of methods for categorical variables was stimulated by research studies in the social and biomedical sciences. Categorical scales are pervasive in the social sciences for measuring attitudes and opinions. Cate- gorical scales in biomedical sciences measure outcomes such as whether a medical treatment is successful. Although categorical data are common in the social and biomedical sciences, they are by no means restricted to those areas. They frequently

2 INTRODUCTION : DISTRIBUTIONS AND INFERENCE FOR CATEGORICAL DATA

occur in the behavioral sciences Že.g., type of mental illness, with the cate- gories schizophrenia, depression, neurosis , epidemiology and public health^. Že.g., contraceptive method at last intercourse, with the categories none, condom, pill, IUD, other , genetics^.^ Ž^ type of allele inherited by an offspring ,. zoology Že.g., alligators’ primary food preference, with the categories fish, invertebrate, reptile , education^.^ Že.g., student responses to an exam question, with the categories correct and incorrect , and marketing^.^ Že.g., consumer preference among leading brands of a product, with the categories brand A, brand B, and brand C. They even occur in highly quantitative fields such as^. engineering sciences and industrial quality control. Examples are the classifi- cation of items according to whether they conform to certain standards, and subjective evaluation of some characteristic: how soft to the touch a certain fabric is, how good a particular food product tastes, or how easy to perform a worker finds a certain task to be. Categorical variables are of many types. In this section we provide ways of classifying them and other variables.

1.1.1 Response–Explanatory Variable Distinction

Most statistical analyses distinguish between response^ Ž^ or dependent. ® ariables and explanatory^ Ž^ or independent .® ariables. For instance, regression models describe how the mean of a response variable, such as the selling price of a house, changes according to the values of explanatory variables, such as square footage and location. In this book we focus on methods for categorical response variables. As in ordinary regression, explanatory variables can be of any type.

1.1.2 Nominal–Ordinal Scale Distinction

Categorical variables have two primary types of scales. Variables having categories without a natural ordering are called nominal. Examples are religious affiliation Žwith the categories Catholic, Protestant, Jewish, Muslim, other , mode of transportation to work^.^ Žautomobile, bicycle, bus, subway, walk , favorite type of music^.^ Ž^ classical, country, folk, jazz, rock , and choice of. residence Ž^ apartment, condominium, house, other. For nominal variables,. the order of listing the categories is irrelevant. The statistical analysis does not depend on that ordering. Many categorical variables do have ordered categories. Such variables are called ordinal. Examples are size of automobile Žsubcompact, compact, midsize, large ,^.^ social class Ž^ upper, middle, lower ,. political philosophy Ž (^) liberal, moderate, conservative , and patient condition. Žgood, fair, serious, critical. Ordinal variables have ordered categories, but distances between^. categories are unknown. Although a person categorized as moderate is more liberal than a person categorized as conservative, no numerical value de- scribes how much more liberal that person is. Methods for ordinal variables utilize the category ordering.

4 INTRODUCTION : DISTRIBUTIONS AND INFERENCE FOR CATEGORICAL DATA

the quantitativequalitative classification is fuzzy. Analysts often treat them as qualitative, using methods for nominal variables. But in many respects, ordinal variables more closely resemble interval variables than they resemble nominal variables. They possess important quantitative features: Each category has a greater or smaller magnitude of the characteristic than another category; and although not possible to measure, an underlying continuous variable is usually present. The political philosophy classification Ž (^) liberal, moderate, conservative. crudely measures an inherently continuous characteristic. Analysts often utilize the quantitative nature of ordinal variables by assigning numerical scores to categories or assuming an underlying continu- ous distribution. This requires good judgment and guidance from researchers who use the scale, but it provides benefits in the variety of methods available for data analysis.

1.1.5 Organization of This Book

The models for categorical response variables discussed in this book resem- ble regression models for continuous response variables; however, they assume binomial, multinomial, or Poisson response distributions instead of normality. Two types of models receive special attention, logistic regression and loglinear models. Ordinary logistic regression models , also called logit models , apply with binary^ Ž^ i.e., two-category. responses and assume a bino- mial distribution. Generalizations of logistic regression apply with multicate- gory responses and assume a multinomial distribution. Loglinear models apply with count data and assume a Poisson distribution. Certain equiva- lences exist between logistic regression and loglinear models. The book has four main units. In the first, Chapters 1 through 3, we summarize descriptive and inferential methods for univariate and bivariate categorical data. These chapters cover discrete distributions, methods of inference, and analyses for measures of association. They summarize the non-model-based methods developed prior to about 1960. In the second and primary unit, Chapters 4 through 9, we introduce models for categorical responses. In Chapter 4 we describe a class of generalized linear models having models of this text as special cases. We focus on models for binary and count response variables. Chapters 5 and 6 cover the most important model for binary responses, logistic regression. In Chap- ter 7 we present generalizations of that model for nominal and ordinal multicategory response variables. In Chapter 8 we introduce the modeling of multivariate categorical response data and show how to represent association and interaction patterns by loglinear models for counts in the table that cross-classifies those responses. In Chapter 9 we discuss model building with loglinear and related logistic models and present some related models. In the third unit, Chapters 10 through 13, we discuss models for handling repeated measurement and other forms of clustering. In Chapter 10 we

DISTRIBUTIONS FOR CATEGORICAL DATA 5

present models for a categorical response with matched pairs; these apply, for instance, with a categorical response measured for the same subjects at two times. Chapter 11 covers models for more general types of repeated categorical data, such as longitudinal data from several times with explana- tory variables. In Chapter 12 we present a broad class of models, generalized linear mixed models , that use random effects to account for dependence with such data. In Chapter 13 further extensions and applications of the models from Chapters 10 through 12 are described. The fourth and final unit is more theoretical. In Chapter 14 we develop asymptotic theory for categorical data models. This theory is the basis for large-sample behavior of model parameter estimators and goodness-of-fit statistics. Maximum likelihood estimation receives primary attention here and throughout the book, but Chapter 15 covers alternative methods of estimation, such as the Bayesian paradigm. Chapter 16 stands alone from the others, being a historical overview of the development of categorical data methods. Most categorical data methods require extensive computations, and statis- tical software is necessary for their effective use. In Appendix A we discuss software that can perform the analyses in this book and show the use of SAS for text examples. See the Web site www. stat. ufl. edu r aa r cda r cda. html to download sample programs and data sets and find information about other software. Chapter 1 provides background material. In Section 1.2 we review the key distributions for categorical data: the binomial, multinomial, and Poisson. In Section 1.3 we review the primary mechanisms for statistical inference, using maximum likelihood. In Sections 1.4 and 1.5 we illustrate these by presenting significance tests and confidence intervals for binomial and multinomial parameters.

1.2 DISTRIBUTIONS FOR CATEGORICAL DATA

Inferential data analyses require assumptions about the random mechanism that generated the data. For regression models with continuous responses, the normal distribution plays the central role. In this section we review the three key distributions for categorical responses: binomial , multinomial , and Poisson.

1.2.1 Binomial Distribution

Many applications refer to a fixed number n of binary observations. Let y (^) 1 , y (^) 2 ,... , y (^) n denote responses for n independent and identical trials such that P Y^ Ž^ i s 1. s  and P Y Ž^ i s 0. s 1 y . We use the generic labels ‘‘success’’ and ‘‘failure’’ for outcomes 1 and 0. Identical trials means that the probability of success  is the same for each trial. Independent trials means