Lecture 6 STK Categorical responses

Size: px
Start display at page:

Download "Lecture 6 STK Categorical responses"

Transcription

1 Lecture 6 STK Categorical responses 22. September 2014 Plan for lecture: 1. GLM for binary and binomial data 2. Link functions 3. Parameter interpretation in logistic regression 4. Parameter interpretation with other link functions 5. Goodness-of-fit: Hosmer-Lemeshow-test 6. ROC curves 7. Over dispersion Lecture 6 STK Categorical responses p. 1

2 Binomial responses AssumeY i Bin(n i,π i ) and independent The data belongs to the exponential family with pmf ( ) ni f(y,θ i,φ i ) = π y i y (1 π i) n i y i θ i = log(π i /(1 π i )) a(θ i ) = n i log(1+exp(θ i )) =c(y)exp(yθ i a(θ i )) dispersion parameter φ i = 1 and known andc(y) = ( n i y E[Y i ] = a (θ i ) = n i exp(θ i ) 1+exp(θ i ) = n iπ i = µ i Var[Y i ] = φ i a (θ i ) = n i exp(θ i ) (1+exp(θ i )) 2 = n i π i (1 π i ). ) Lecture 6 STK Categorical responses p. 2

3 Binomial or binary responses? AssumeY i Bin(n i,π i ) and independent The data can also be represented as 1 forj = 1,...,Y i Y i,j = 0 forj = Y i +1,...,n i which gives us binary data Note: IfY i,j Bin(1,π i ), buty i,j -s are dependent within groupi, the sum are not binomial Positive dependence give overdispersion Grouping, and then taking into account over dispersion, may be a way to handle such data Lecture 6 STK Categorical responses p. 3

4 Binary responses or grouped data? Y i Bin(n i,π i ),i = 1,...,k or Y i Bin(1,π i ),i = 1,...,n = i=k i=1 n i Estimation equivalent for both representations AIC for comparing models are also equivalent The deviance goodness-of-fit test becomes different! χ 2 n q n = k for grouped data n = k i=1 n i for binary data To trust the deviance goodness-of-fit test, we require: Y i Bin(n i,π i ) where n i π i > 5 andn i (1 π i ) > 5 Lecture 6 STK Categorical responses p. 4

5 Ex: Beetles > dim(beetle) [1] 8 3 > glm(cbind(dode,ant-dode) Dose,family=binomial,data=beetle) Coefficients: (Intercept) Dose Degrees of Freedom: 7 Total (i.e. Null); Null Deviance: Residual Deviance: AIC: Residual > dim(beetle2) [1] > glm(dode Dose,family=binomial,data=beetle2) Coefficients: (Intercept) Dose Degrees of Freedom: 480 Total (i.e. Null); 479 Residual Null Deviance: Residual Deviance: AIC: Lecture 6 STK Categorical responses p. 5

6 GLM for binomial or binary (n i = 1) responses IndependentY i with probability for successπ i Linear predictorη i = β T x i Link functiong(π i ) = η i The logit link function is the most usual: which gives π i g(π i ) = log( ) = logit(π i ) 1 π i π i = exp(η i) 1+exp(η i ) = g 1 (η i ) This is the canonical link function, i.e. canonical parameter θ i = η i The logit link yield logistic regression Lecture 6 STK Categorical responses p. 6

7 Requirements for link function for binomial data g() should be smooth (can be differentiated) be strongly monotone (increasing) take values over all real numbers g([0,1]) = R or equivalentg 1 (R) = [0,1] g 1 (η) cumulative distribution function (CDF) for a continuous distribution onr Logit link satisfies these requirements. g 1 (η) is CDF in "standard" logistic distribution with density exp(η) (1+exp(η)) 2 Lecture 6 STK Categorical responses p. 7

8 CDF and pdf in "standard" logistic distribution Kumulativ logistisk fordeling Tetthet logistisk fordeling F(x) f(x) x pdf is symmetric aroundx = 0, hence expectation is 0 The variance is x 2 exp(x) (1+exp(x)) 2dx = π2 3 = Lecture 6 STK Categorical responses p. 8 x

9 Probit link: Inverse of CDF for standard normal where Φ(y) = y However, g(η) = Φ 1 (η) 1 2π exp( 1 2 x2 )dx Since the pdf in the standard normal distribution also is symmetric around 0, with probit link we often get results that are comparable with those from logistic regression However, the logistic distribution has heavier tails than the normal, and in some situations the probit link may be better Lecture 6 STK Categorical responses p. 9

10 CDF and pdf for logit and probit Kumulative fordelingsfunksjoner Tettheter F(x) logistisk probit (skalert) f(x) x x Lecture 6 STK Categorical responses p. 10

11 Comparing estimates from logit and probit E[Y i ] =g 1 (η i ) g 1 (0)+(g 1 ) (0)η i ηi l logit = 0.5+φ (0)η p i probit I.e. forη i 0, since φ (0) = 1/sqrt2π, ηi l (φ (0)/0.25)η p = (8/π)η p 1.6η p or β l j 1.6β p j Lecture 6 STK Categorical responses p. 11

12 R-output beetles: Logit vs. Probit > logfit<-glm(cbind(dode,ant-dode) Dose,binomial(link=logit),beetle) > profit<-glm(cbind(dode,ant-dode) Dose,binomial(link=probit),beetle) > logfit Coefficients: (Intercept) Dose Degrees of Freedom: 7 Total (i.e. Null); 6 Residual Null Deviance: Residual Deviance: AIC: > profit Coefficients: (Intercept) Dose Degrees of Freedom: 7 Total (i.e. Null); 6 Residual Null Deviance: Residual Deviance: AIC: > logfit$coef/profit$coef (Intercept) Dose Lecture 6 STK Categorical responses p. 12

13 Akaike information criterion (AIC) AIC = 2ˆl+2q q = number of parameters in the model ˆl is the maximum log-likelihood under the model AIC are used for model selection The model with lowest AIC model are the best according to this criterion Lecture 6 STK Categorical responses p. 13

14 R-output beetles: Logit > summary(logfit) Deviance Residuals: Min 1Q Median 3Q Max Coefficients: Estimate Std. Error z value Pr(> z ) (Intercept) <2e-16 *** Dose <2e-16 *** --- Signif. codes: 0 *** ** 0.01 * (Dispersion parameter for binomial family taken to be 1) Null deviance: on 7 degrees of freedom Residual deviance: on 6 degrees of freedom AIC: Lecture 6 STK Categorical responses p. 14

15 R-output beetles: Probit > summary(profit) Deviance Residuals: Min 1Q Median 3Q Max Coefficients: Estimate Std. Error z value Pr(> z ) (Intercept) <2e-16 *** Dose <2e-16 *** --- Signif. codes: 0 *** ** 0.01 * (Dispersion parameter for binomial family taken to be 1) Null deviance: on 7 degrees of freedom Residual deviance: on 6 degrees of freedom AIC: Number of Fisher Scoring iterations: 4 Lecture 6 STK Categorical responses p. 15

16 clog-log-link based on the Gumbel distribution The linkη i = g(π i ) = log( log(1 π i )) is called the "complementary log-log-link" Its inverse is given by π i = 1 exp( exp(η i )) = F(η i ) which is CDF for (the standardized) Gumbel distribution Properties: not symmetric light tail towards + tails as the logistic distributions towards expectation = Euler s constant 0.58 variance π 2 / Lecture 6 STK Categorical responses p. 16

17 CDF and pdf in Gumbel distribution Kumulative fordelingsfunksjon Gumbel Tetthet Gumbel F(x) f(x) x x Lecture 6 STK Categorical responses p. 17

18 R-output beetles: Clog-log > clogfit<-glm(cbind(dode,ant-dode) Dose,binomial(link=cloglog),beetle) > summary(clogfit) Coefficients: Estimate Std. Error z value Pr(> z ) (Intercept) <2e-16 *** Dose <2e-16 *** Null deviance: on 7 degrees of freedom Residual deviance: on 6 degrees of freedom AIC: Number of Fisher Scoring iterations: 4 > logfit$coef/clogfit$coef (Intercept) Dose Lecture 6 STK Categorical responses p. 18

19 Comparing link functions by AIC > AIC(logfit,profit,clogfit) df AIC logfit profit clogfit clog-log-link gives the lowest AIC Since all three models has the same number of parameters, it also gives the highest log-likelihood, i.e. the best fit Lecture 6 STK Categorical responses p. 19

20 Fitted probabilities for beetle data with logit link and clog-log link: andel dode biller logistisk cloglog dose (log_10) The clog-log link fits observed proportions better than logit link, with residual deviance 3.45 for clog-log and for logit Lecture 6 STK Categorical responses p. 20

21 Including 2. order term of dose > form = cbind(dode,ant-dode) Dose+I(Doseˆ2) > logfit2<-glm(form,binomial(link=logit),beetle) > profit2<-glm(form,binomial(link=probit),beetle) > clogfit2<-glm(form,binomial(link=cloglog),beetle) > AIC(clogfit,logfit2,profit2,caufit2,clogfit2) df AIC clogfit logfit profit clogfit Lecture 6 STK Categorical responses p. 21

22 Fitted probabilities for beetle data including also models with quadratic terms of Dose andel dode biller logistisk cloglog logistisk, 2. gradsledd dose (log_10) clog-log link: Quadratic term yields residual deviance 3.19 compared to 3.44 with only linear term Lecture 6 STK Categorical responses p. 22

23 Interpretation of parameters in logistic regression The odds for an event is defined: π = Odds 1 π In logistic regression, withη = β T x, the odds are Odds = exp(η) 1+exp(η) 1 exp(η) 1+exp(η) = exp(η) 1+exp(η) 1 1+exp(η) = exp(η) i.e. η = log Odds Lecture 6 STK Categorical responses p. 23

24 Interpretation of parameters in logistic regression: Odds-ratio Let x k = x k,k j,x j = x j +1, i.e. x x = (0,...,0,1,0,...,0), The ratio between two odds with explanatory variables x andx is called the odds-ratio, (with π = e η /(1+e η ) andη = β T x ) 1 π π 1 π OR j = π = exp(β j ) = Odds Odds = exp(η η) = exp(β T (x x)) or β j = log(or j ), i.e the regression coefficients are log-odds-ratios or relative change in odds on the log scale Lecture 6 STK Categorical responses p. 24

25 Odds-ratio Relative Risk (RR) when the probabilities are small Relative risk is defined as the ratio between two probabilities: RR = π π When bothπ andπ are small, 1 π 1 and1 π 1. Therefore, OR = π π 1 π 1 π π π = RR I.e., when the probabilities are small, exp(β j ) expresses approximately the relative change in probability whenx j is increased by one unit Lecture 6 STK Categorical responses p. 25

26 The approximation OR RR Relative risk Odds-ratio π π = π = π = π = π = π = π = Lecture 6 STK Categorical responses p. 26

27 Interpretation of parameters with clog-log-link π =1 exp( exp(β T x)) or η =β T x = log( log(1 π)) If π is small, then log(1 π) π (Taylor) which gives η log(π) π exp(η) and thus RR j = π π exp(β j) Lecture 6 STK Categorical responses p. 27

28 Ex: Mortality by Wilm s tumor 444 dead, 3471 survivors > glm(d unfav+factor(stg),family=binomial(link=logit), data=nwts)$coef (Intercept) unfav factor(stg)2 factor(stg)3 factor(stg) > glm(d unfav+factor(stg),family=binomial(link=cloglog), data=nwts)$coef (Intercept) unfav factor(stg)2 factor(stg)3 factor(stg) Lecture 6 STK Categorical responses p. 28

29 Interpretation of parameters with probit link Sometimes we may have continuous responses, for instance normal distributed,y i0 N(β T x i,σ 2 ), but still prefer to study 1 ify i0 < γ = threshold value Y i = 0 if not Ex; Y i0 = birth weight Y i = 1 ify i0 < 2800 gram 0 if not Ex: Psychometric measurements, Y i0 = score on a depression scale Y i = 1 ify i0 < threshold value 0 if not Lecture 6 STK Categorical responses p. 29

30 Underlying scale Y i = 1 ify i0 < γ = threshold value 0 if not tetthet Y0 Lecture 6 STK Categorical responses p. 30

31 Probit, cont. Why binary response? Tradition to do table analysis Direct scorey i0 may have a skew distribution Direct score may not be registered, only an underlying scale we imagine exists ("latent" variable) The relation between Y i0 N(β T x i,σ 2 ) Y i = I(Y i0 γ) is given by π i = P(Y i = 1) = P(Y i0 γ) = Φ( γ σ (β σ ) x i ) Lecture 6 STK Categorical responses p. 31

32 Relationship between parameters on probit and underlying scale E[Y i0 ] = β T x i = β 0 +β 1 x i1 + +β p x ip is equivalent to the linear predictor on probit scale where α 0 = γ β 0 σ Φ 1 (π i ) = α 0 +α 1 x i1 + +α p x ip α j = β j σ forj = 1,...,p Note: The standard deviationσ on the underlying scale can not be identified by the probit analysis Lecture 6 STK Categorical responses p. 32

33 Ex: Birth weight and gestational age > summary(lm(vekt svlengde+sex)) Coefficients: Estimate Std. Error t value Pr(> t ) (Intercept) svlengde e-06 *** sex * --- Residual standard error: on 21 degrees of freedom Multiple R-Squared: 0.64, Adjusted R-squared: F-statistic: on 2 and 21 DF, p-value: 2.194e-05 Here is ˆσ = Lecture 6 STK Categorical responses p. 33

34 Ex: Birth weight and gestational age cont. Defines Y i = 1 if birth weight is less than 2800 gram > lavvekt<-1*(vekt<2800) > table(lavvekt) > > glm(lavvekt svlengde+sex,family=binomial(link=probit))$coef (Intercept) svlengde sex > -lm(vekt svlengde+sex)$coef/177.1 (Intercept) svlengde sex Approximately probit-estimates from linear regression: ˆα j ˆβ j ˆσ Lecture 6 STK Categorical responses p. 34

35 Goodness of fit tests for binomial data If Y i Bin(n i,π i ) and (a)n i π i > 5 and (b)n i (1 π i ) > 5 fori = 1,...,N, we have approximately Residual deviance Pearson chi-square = 2(ľ ˆl) χ 2 N p X 2 = n i=1 (Y i n iˆπ i ) 2 n iˆπ i (1 ˆπ i ) χ2 N p ľ is log-likelihood in saturated model ˆl log-likelihood for the fitted model withpparameters and ˆπ i are estimated probabilities If D andx 2 is much larger thann p, it indicates that the model fit is bad However, they i -s are often binary, and then the conditions (a) and (b) is no fulfilled Lecture 6 STK Categorical responses p. 35

36 Two strategies for goodness of fit tests with binary data With categorical explanatory variables: Aggregate to binomial data Aggregation can not be used if there are many categorical variables with many levels, or if there are continuous variables. Can then instead use Hosmer-Lemeshow test Lecture 6 STK Categorical responses p. 36

37 Aggregation Count number of individuals within each combination of the categorical variables Count number ofy i = 1 within each combination Fit a GLM on aggregated data The model is OK ifd andx 2 are small compared to χ 2, Ñ p where Ñ is number of combinations of the categorical variables Requires that expected number of successes/failures in each group> 5 Lecture 6 STK Categorical responses p. 37

38 Ex: Aggregation on Wilm s tumor data > table(nwts$unfav) > table(nwts$stg) > nwts2 = aggregate(nwts$d,by=list(nwts$unfav,nwts$stg),fun=table) Group.1 Group.2 x.0 x > nwts2 = data.frame(unfav=nwts2$group.1,stg=nwts2$group.2, n=nwts2$x[,1]+nwts2$x[,2],d=nwts2$x[,2]) Lecture 6 STK Categorical responses p. 38

39 Ex: Aggregation on Wilm s tumor data > glmfit = glm(cbind(d,n-d) as.factor(unfav)+as.factor(stg),data=nwts2,f > glmfit (Intercept) unfavaggr factor(stgaggr)2 factor(stgaggr)3 factor(stgaggr) Degrees of Freedom: 7 Total (i.e. Null); 3 Residual Null Deviance: Residual Deviance: 3.33 AIC: > X2<-sum(residuals(glmfit,type="pearson")ˆ2) > X2 [1] Lecture 6 STK Categorical responses p. 39

40 Ex: Aggregation on Wilm s tumor data cont. The model seems to be OK, since residual deviance D = 3.33 X 2 = 3.26 = Pearson chi-square is small compared to residual degrees of freedomdf = 3 Is expected successes and failures > 5? We compute these: > round((nwts2$n*glmfit$fit,2) > round((nwts2$n*(1-glmfit$fit),2) Lecture 6 STK Categorical responses p. 40

41 Hosmer-Lemeshow test Fit the GLM model Order the individuals by fitted probabilities ˆπ (1) ˆπ (2) ˆπ (n) Divide the into G groups according to the ordering, with equally many individuals in each group ( C statistic ) Divide the interval from ˆπ (1) to ˆπ (n) into G intervals ( H statistic ) Compute the average π g = of ˆπ (i) in groupg = 1,2,...,G Compute no observationsn g and successesy g in groupg Compute Hosmer-Lemeshow X 2 hl = G g=1 Under the 0 hypothesis (model is OK) we have (Y g n g π g ) 2 n g π g (1 π g ) approximatelyx 2 hl χ2 G 2 Lecture 6 STK Categorical responses p. 41

42 Ex: Hosmer-Lemeshow test on Wilm s tumor data > glmfit<-glm(d unfav+factor(stg)+yr.regis+age, data=nwts,family=binomial) > library(mkmisc) > HLgof.test(glmfit$fit,nwts$d) $C Hosmer-Lemeshow C statistic data: glmfit$fit and nwts$d X-squared = , df = 8, p-value = $H Hosmer-Lemeshow H statistic data: glmfit$fit and nwts$d X-squared = , df = 8, p-value = Lecture 6 STK Categorical responses p. 42

43 Ex: Hosmer-Lemeshow test on Wilm s tumor data cont. > glmfit<-glm(d unfav+factor(stg)+yr.regis+age,family=binomial) > kuttoff<-sort(glmfit$fit)[c(round(length(d)*(1:10)/10))] > gr<-rep(1,length(d)) > for (i in 1:9) gr<-gr+(glmfit$fit>kuttoff[i]) > table(gr) > ngr<-as.numeric(table(gr)) > ngr [1] > dgr<-numeric(0) > for (i in 1:10) dgr[i]<-sum(d[gr==i]) > dgr [1] > for (i in 1:10) pigr[i]<-mean(glmfit$fit[gr==i]) > round(pigr,3) [1] > X2HL<-sum((dgr-ngr*pigr)ˆ2/(ngr*pigr*(1-pigr))) > X2HL [1] > 1-pchisq(X2HL,8) [1] Lecture 6 STK Categorical responses p. 43

44 Sensitivity and specificity Classification: Predict an event(y i = 1) if ˆπ i > γ, where γ is a threshold value Predict no event if ˆπ i γ Count number of correct classifications in the data set Sensitivity: Proportion of correct predictions when true Y i = 1 Specificity: Proportion of correct predictions when true Y i = 0 We want high values for both sensitivity and specificity For a given method, we can choose threshold valueγ to give a good balance in a specific classification situation Lecture 6 STK Categorical responses p. 44

45 ROC curves For evaluating and comparing models, we can vary the thresholdγ and plot a Receiver Operating Characteristics curve or ROC-curve with sensitivity on the y-axis and (1-specificity) on the x-axis Can also compute the area under curve (AUC) AUC=1 if perfect classification AUC=0.5 if random classification Lecture 6 STK Categorical responses p. 45

46 ROC for predicting bycatch of fish Shrimp fishery in Barents Sea: Predict if one can expect to catch more than 0.8 juvenile cod per kg shrimps caught If yes, the fishing area is temporarily closed Probability of correct prediction if observed> model predictor no predictability Lecture 6 STK Categorical responses p. 46

47 Over dispersion in binomial data With independent, binary data there is never over dispersion (Var(Y i ) = π i (1 π i ))) If independent, binary data Y ij with same π i are aggregated toy i = j=n i j=1 Y ij, theny i Bin(n i,π i ), Var(Y i ) = n i π i (1 π i )) and no over dispersion However, over dispersion occurs if the outcomes of the individuals trials are positively correlated. Then Var(Y i ) > n i π i (1 π i ) Possibility 1: Quasi-likelihood Possibility 2: Mixed model Possibility 3: Beta-binomial distribution Lecture 6 STK Categorical responses p. 47

48 Over dispersion in binomial data - Quasi-likelihood Specify mean structure by link function and linear predictor Specify variance structure Possibility 1: Var(Y i ) = φn i π i (1 π i )) Possibility 2: Var(Y i ) = (1+ρ(n i 1))n i π i (1 π i )) Fit the model. (Not sure if Possibility 2 is implemented in R) Lecture 6 STK Categorical responses p. 48

49 Randomπ or beta binomial response Mixed model: π i random with expectationπi If π i is random and beta distributed (continuous between 0 and 1), Y i becomes beta binomial Then Var(Y i ) = (1+ρ(n i 1))n i π(1 π)) Can be estimated i R by the betabin function from the aod library Lecture 6 STK Categorical responses p. 49

12 Modelling Binomial Response Data

12 Modelling Binomial Response Data c 2005, Anthony C. Brooms Statistical Modelling and Data Analysis 12 Modelling Binomial Response Data 12.1 Examples of Binary Response Data Binary response data arise when an observation on an individual

More information

Linear Regression Models P8111

Linear Regression Models P8111 Linear Regression Models P8111 Lecture 25 Jeff Goldsmith April 26, 2016 1 of 37 Today s Lecture Logistic regression / GLMs Model framework Interpretation Estimation 2 of 37 Linear regression Course started

More information

A Generalized Linear Model for Binomial Response Data. Copyright c 2017 Dan Nettleton (Iowa State University) Statistics / 46

A Generalized Linear Model for Binomial Response Data. Copyright c 2017 Dan Nettleton (Iowa State University) Statistics / 46 A Generalized Linear Model for Binomial Response Data Copyright c 2017 Dan Nettleton (Iowa State University) Statistics 510 1 / 46 Now suppose that instead of a Bernoulli response, we have a binomial response

More information

Introduction to General and Generalized Linear Models

Introduction to General and Generalized Linear Models Introduction to General and Generalized Linear Models Generalized Linear Models - part III Henrik Madsen Poul Thyregod Informatics and Mathematical Modelling Technical University of Denmark DK-2800 Kgs.

More information

SCHOOL OF MATHEMATICS AND STATISTICS. Linear and Generalised Linear Models

SCHOOL OF MATHEMATICS AND STATISTICS. Linear and Generalised Linear Models SCHOOL OF MATHEMATICS AND STATISTICS Linear and Generalised Linear Models Autumn Semester 2017 18 2 hours Attempt all the questions. The allocation of marks is shown in brackets. RESTRICTED OPEN BOOK EXAMINATION

More information

Lecture 13: More on Binary Data

Lecture 13: More on Binary Data Lecture 1: More on Binary Data Link functions for Binomial models Link η = g(π) π = g 1 (η) identity π η logarithmic log π e η logistic log ( π 1 π probit Φ 1 (π) Φ(η) log-log log( log π) exp( e η ) complementary

More information

ST3241 Categorical Data Analysis I Generalized Linear Models. Introduction and Some Examples

ST3241 Categorical Data Analysis I Generalized Linear Models. Introduction and Some Examples ST3241 Categorical Data Analysis I Generalized Linear Models Introduction and Some Examples 1 Introduction We have discussed methods for analyzing associations in two-way and three-way tables. Now we will

More information

Single-level Models for Binary Responses

Single-level Models for Binary Responses Single-level Models for Binary Responses Distribution of Binary Data y i response for individual i (i = 1,..., n), coded 0 or 1 Denote by r the number in the sample with y = 1 Mean and variance E(y) =

More information

Sections 4.1, 4.2, 4.3

Sections 4.1, 4.2, 4.3 Sections 4.1, 4.2, 4.3 Timothy Hanson Department of Statistics, University of South Carolina Stat 770: Categorical Data Analysis 1/ 32 Chapter 4: Introduction to Generalized Linear Models Generalized linear

More information

STAT5044: Regression and Anova

STAT5044: Regression and Anova STAT5044: Regression and Anova Inyoung Kim 1 / 18 Outline 1 Logistic regression for Binary data 2 Poisson regression for Count data 2 / 18 GLM Let Y denote a binary response variable. Each observation

More information

Logistic Regression. James H. Steiger. Department of Psychology and Human Development Vanderbilt University

Logistic Regression. James H. Steiger. Department of Psychology and Human Development Vanderbilt University Logistic Regression James H. Steiger Department of Psychology and Human Development Vanderbilt University James H. Steiger (Vanderbilt University) Logistic Regression 1 / 38 Logistic Regression 1 Introduction

More information

Statistical Modelling with Stata: Binary Outcomes

Statistical Modelling with Stata: Binary Outcomes Statistical Modelling with Stata: Binary Outcomes Mark Lunt Arthritis Research UK Epidemiology Unit University of Manchester 21/11/2017 Cross-tabulation Exposed Unexposed Total Cases a b a + b Controls

More information

9 Generalized Linear Models

9 Generalized Linear Models 9 Generalized Linear Models The Generalized Linear Model (GLM) is a model which has been built to include a wide range of different models you already know, e.g. ANOVA and multiple linear regression models

More information

Generalized Linear Models. Last time: Background & motivation for moving beyond linear

Generalized Linear Models. Last time: Background & motivation for moving beyond linear Generalized Linear Models Last time: Background & motivation for moving beyond linear regression - non-normal/non-linear cases, binary, categorical data Today s class: 1. Examples of count and ordered

More information

Multinomial Logistic Regression Models

Multinomial Logistic Regression Models Stat 544, Lecture 19 1 Multinomial Logistic Regression Models Polytomous responses. Logistic regression can be extended to handle responses that are polytomous, i.e. taking r>2 categories. (Note: The word

More information

Generalized Linear Models. stat 557 Heike Hofmann

Generalized Linear Models. stat 557 Heike Hofmann Generalized Linear Models stat 557 Heike Hofmann Outline Intro to GLM Exponential Family Likelihood Equations GLM for Binomial Response Generalized Linear Models Three components: random, systematic, link

More information

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

NATIONAL UNIVERSITY OF SINGAPORE EXAMINATION (SOLUTIONS) ST3241 Categorical Data Analysis. (Semester II: ) NATIONAL UNIVERSITY OF SINGAPORE EXAMINATION (SOLUTIONS) Categorical Data Analysis (Semester II: 2010 2011) April/May, 2011 Time Allowed : 2 Hours Matriculation No: Seat No: Grade Table Question 1 2 3

More information

Generalized linear models for binary data. A better graphical exploratory data analysis. The simple linear logistic regression model

Generalized linear models for binary data. A better graphical exploratory data analysis. The simple linear logistic regression model Stat 3302 (Spring 2017) Peter F. Craigmile Simple linear logistic regression (part 1) [Dobson and Barnett, 2008, Sections 7.1 7.3] Generalized linear models for binary data Beetles dose-response example

More information

Classification. Chapter Introduction. 6.2 The Bayes classifier

Classification. Chapter Introduction. 6.2 The Bayes classifier Chapter 6 Classification 6.1 Introduction Often encountered in applications is the situation where the response variable Y takes values in a finite set of labels. For example, the response Y could encode

More information

COMPLEMENTARY LOG-LOG MODEL

COMPLEMENTARY LOG-LOG MODEL COMPLEMENTARY LOG-LOG MODEL Under the assumption of binary response, there are two alternatives to logit model: probit model and complementary-log-log model. They all follow the same form π ( x) =Φ ( α

More information

MSH3 Generalized linear model

MSH3 Generalized linear model Contents MSH3 Generalized linear model 5 Logit Models for Binary Data 173 5.1 The Bernoulli and binomial distributions......... 173 5.1.1 Mean, variance and higher order moments.... 173 5.1.2 Normal limit....................

More information

Categorical data analysis Chapter 5

Categorical data analysis Chapter 5 Categorical data analysis Chapter 5 Interpreting parameters in logistic regression The sign of β determines whether π(x) is increasing or decreasing as x increases. The rate of climb or descent increases

More information

Generalized linear models

Generalized linear models Generalized linear models Douglas Bates November 01, 2010 Contents 1 Definition 1 2 Links 2 3 Estimating parameters 5 4 Example 6 5 Model building 8 6 Conclusions 8 7 Summary 9 1 Generalized Linear Models

More information

UNIVERSITY OF TORONTO. Faculty of Arts and Science APRIL 2010 EXAMINATIONS STA 303 H1S / STA 1002 HS. Duration - 3 hours. Aids Allowed: Calculator

UNIVERSITY OF TORONTO. Faculty of Arts and Science APRIL 2010 EXAMINATIONS STA 303 H1S / STA 1002 HS. Duration - 3 hours. Aids Allowed: Calculator UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL 2010 EXAMINATIONS STA 303 H1S / STA 1002 HS Duration - 3 hours Aids Allowed: Calculator LAST NAME: FIRST NAME: STUDENT NUMBER: There are 27 pages

More information

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

Review. Timothy Hanson. Department of Statistics, University of South Carolina. Stat 770: Categorical Data Analysis Review Timothy Hanson Department of Statistics, University of South Carolina Stat 770: Categorical Data Analysis 1 / 22 Chapter 1: background Nominal, ordinal, interval data. Distributions: Poisson, binomial,

More information

STA216: Generalized Linear Models. Lecture 1. Review and Introduction

STA216: Generalized Linear Models. Lecture 1. Review and Introduction STA216: Generalized Linear Models Lecture 1. Review and Introduction Let y 1,..., y n denote n independent observations on a response Treat y i as a realization of a random variable Y i In the general

More information

STAT 7030: Categorical Data Analysis

STAT 7030: Categorical Data Analysis STAT 7030: Categorical Data Analysis 5. Logistic Regression Peng Zeng Department of Mathematics and Statistics Auburn University Fall 2012 Peng Zeng (Auburn University) STAT 7030 Lecture Notes Fall 2012

More information

Logistic Regressions. Stat 430

Logistic Regressions. Stat 430 Logistic Regressions Stat 430 Final Project Final Project is, again, team based You will decide on a project - only constraint is: you are supposed to use techniques for a solution that are related to

More information

LOGISTIC REGRESSION Joseph M. Hilbe

LOGISTIC REGRESSION Joseph M. Hilbe LOGISTIC REGRESSION Joseph M. Hilbe Arizona State University Logistic regression is the most common method used to model binary response data. When the response is binary, it typically takes the form of

More information

STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis. 1. Indicate whether each of the following is true (T) or false (F).

STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis. 1. Indicate whether each of the following is true (T) or false (F). STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis 1. Indicate whether each of the following is true (T) or false (F). (a) T In 2 2 tables, statistical independence is equivalent to a population

More information

Today. HW 1: due February 4, pm. Aspects of Design CD Chapter 2. Continue with Chapter 2 of ELM. In the News:

Today. HW 1: due February 4, pm. Aspects of Design CD Chapter 2. Continue with Chapter 2 of ELM. In the News: Today HW 1: due February 4, 11.59 pm. Aspects of Design CD Chapter 2 Continue with Chapter 2 of ELM In the News: STA 2201: Applied Statistics II January 14, 2015 1/35 Recap: data on proportions data: y

More information

Chapter 4: Generalized Linear Models-I

Chapter 4: Generalized Linear Models-I : Generalized Linear Models-I Dipankar Bandyopadhyay Department of Biostatistics, Virginia Commonwealth University BIOS 625: Categorical Data & GLM [Acknowledgements to Tim Hanson and Haitao Chu] D. Bandyopadhyay

More information

STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis. 1. Indicate whether each of the following is true (T) or false (F).

STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis. 1. Indicate whether each of the following is true (T) or false (F). STA 4504/5503 Sample Exam 1 Spring 2011 Categorical Data Analysis 1. Indicate whether each of the following is true (T) or false (F). (a) (b) (c) (d) (e) In 2 2 tables, statistical independence is equivalent

More information

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

Class Notes: Week 8. Probit versus Logit Link Functions and Count Data Ronald Heck Class Notes: Week 8 1 Class Notes: Week 8 Probit versus Logit Link Functions and Count Data This week we ll take up a couple of issues. The first is working with a probit link function. While

More information

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

ST3241 Categorical Data Analysis I Multicategory Logit Models. Logit Models For Nominal Responses ST3241 Categorical Data Analysis I Multicategory Logit Models Logit Models For Nominal Responses 1 Models For Nominal Responses Y is nominal with J categories. Let {π 1,, π J } denote the response probabilities

More information

STA 216: GENERALIZED LINEAR MODELS. Lecture 1. Review and Introduction. Much of statistics is based on the assumption that random

STA 216: GENERALIZED LINEAR MODELS. Lecture 1. Review and Introduction. Much of statistics is based on the assumption that random STA 216: GENERALIZED LINEAR MODELS Lecture 1. Review and Introduction Much of statistics is based on the assumption that random variables are continuous & normally distributed. Normal linear regression

More information

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

Logistic Regression. Interpretation of linear regression. Other types of outcomes. 0-1 response variable: Wound infection. Usual linear regression Logistic Regression Usual linear regression (repetition) y i = b 0 + b 1 x 1i + b 2 x 2i + e i, e i N(0,σ 2 ) or: y i N(b 0 + b 1 x 1i + b 2 x 2i,σ 2 ) Example (DGA, p. 336): E(PEmax) = 47.355 + 1.024

More information

7/28/15. Review Homework. Overview. Lecture 6: Logistic Regression Analysis

7/28/15. Review Homework. Overview. Lecture 6: Logistic Regression Analysis Lecture 6: Logistic Regression Analysis Christopher S. Hollenbeak, PhD Jane R. Schubart, PhD The Outcomes Research Toolbox Review Homework 2 Overview Logistic regression model conceptually Logistic regression

More information

Modeling Overdispersion

Modeling Overdispersion James H. Steiger Department of Psychology and Human Development Vanderbilt University Regression Modeling, 2009 1 Introduction 2 Introduction In this lecture we discuss the problem of overdispersion in

More information

Neural networks (not in book)

Neural networks (not in book) (not in book) Another approach to classification is neural networks. were developed in the 1980s as a way to model how learning occurs in the brain. There was therefore wide interest in neural networks

More information

Generalised linear models. Response variable can take a number of different formats

Generalised linear models. Response variable can take a number of different formats Generalised linear models Response variable can take a number of different formats Structure Limitations of linear models and GLM theory GLM for count data GLM for presence \ absence data GLM for proportion

More information

Parametric Modelling of Over-dispersed Count Data. Part III / MMath (Applied Statistics) 1

Parametric Modelling of Over-dispersed Count Data. Part III / MMath (Applied Statistics) 1 Parametric Modelling of Over-dispersed Count Data Part III / MMath (Applied Statistics) 1 Introduction Poisson regression is the de facto approach for handling count data What happens then when Poisson

More information

Introduction to the Generalized Linear Model: Logistic regression and Poisson regression

Introduction to the Generalized Linear Model: Logistic regression and Poisson regression Introduction to the Generalized Linear Model: Logistic regression and Poisson regression Statistical modelling: Theory and practice Gilles Guillot gigu@dtu.dk November 4, 2013 Gilles Guillot (gigu@dtu.dk)

More information

Model Selection in GLMs. (should be able to implement frequentist GLM analyses!) Today: standard frequentist methods for model selection

Model Selection in GLMs. (should be able to implement frequentist GLM analyses!) Today: standard frequentist methods for model selection Model Selection in GLMs Last class: estimability/identifiability, analysis of deviance, standard errors & confidence intervals (should be able to implement frequentist GLM analyses!) Today: standard frequentist

More information

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

NATIONAL UNIVERSITY OF SINGAPORE EXAMINATION. ST3241 Categorical Data Analysis. (Semester II: ) April/May, 2011 Time Allowed : 2 Hours NATIONAL UNIVERSITY OF SINGAPORE EXAMINATION Categorical Data Analysis (Semester II: 2010 2011) April/May, 2011 Time Allowed : 2 Hours Matriculation No: Seat No: Grade Table Question 1 2 3 4 5 6 Full marks

More information

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

Goodness-of-Fit Tests for the Ordinal Response Models with Misspecified Links Communications of the Korean Statistical Society 2009, Vol 16, No 4, 697 705 Goodness-of-Fit Tests for the Ordinal Response Models with Misspecified Links Kwang Mo Jeong a, Hyun Yung Lee 1, a a Department

More information

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

STA 303 H1S / 1002 HS Winter 2011 Test March 7, ab 1cde 2abcde 2fghij 3 STA 303 H1S / 1002 HS Winter 2011 Test March 7, 2011 LAST NAME: FIRST NAME: STUDENT NUMBER: ENROLLED IN: (circle one) STA 303 STA 1002 INSTRUCTIONS: Time: 90 minutes Aids allowed: calculator. Some formulae

More information

Log-linear Models for Contingency Tables

Log-linear Models for Contingency Tables Log-linear Models for Contingency Tables Statistics 149 Spring 2006 Copyright 2006 by Mark E. Irwin Log-linear Models for Two-way Contingency Tables Example: Business Administration Majors and Gender A

More information

Chapter 4: Generalized Linear Models-II

Chapter 4: Generalized Linear Models-II : Generalized Linear Models-II Dipankar Bandyopadhyay Department of Biostatistics, Virginia Commonwealth University BIOS 625: Categorical Data & GLM [Acknowledgements to Tim Hanson and Haitao Chu] D. Bandyopadhyay

More information

Review: what is a linear model. Y = β 0 + β 1 X 1 + β 2 X 2 + A model of the following form:

Review: what is a linear model. Y = β 0 + β 1 X 1 + β 2 X 2 + A model of the following form: Outline for today What is a generalized linear model Linear predictors and link functions Example: fit a constant (the proportion) Analysis of deviance table Example: fit dose-response data using logistic

More information

STA 450/4000 S: January

STA 450/4000 S: January STA 450/4000 S: January 6 005 Notes Friday tutorial on R programming reminder office hours on - F; -4 R The book Modern Applied Statistics with S by Venables and Ripley is very useful. Make sure you have

More information

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

Section IX. Introduction to Logistic Regression for binary outcomes. Poisson regression Section IX Introduction to Logistic Regression for binary outcomes Poisson regression 0 Sec 9 - Logistic regression In linear regression, we studied models where Y is a continuous variable. What about

More information

Logistic regression. 11 Nov Logistic regression (EPFL) Applied Statistics 11 Nov / 20

Logistic regression. 11 Nov Logistic regression (EPFL) Applied Statistics 11 Nov / 20 Logistic regression 11 Nov 2010 Logistic regression (EPFL) Applied Statistics 11 Nov 2010 1 / 20 Modeling overview Want to capture important features of the relationship between a (set of) variable(s)

More information

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

Analysis of Categorical Data. Nick Jackson University of Southern California Department of Psychology 10/11/2013 Analysis of Categorical Data Nick Jackson University of Southern California Department of Psychology 10/11/2013 1 Overview Data Types Contingency Tables Logit Models Binomial Ordinal Nominal 2 Things not

More information

Machine Learning. Lecture 3: Logistic Regression. Feng Li.

Machine Learning. Lecture 3: Logistic Regression. Feng Li. Machine Learning Lecture 3: Logistic Regression Feng Li fli@sdu.edu.cn https://funglee.github.io School of Computer Science and Technology Shandong University Fall 2016 Logistic Regression Classification

More information

Generalized linear models

Generalized linear models Generalized linear models Outline for today What is a generalized linear model Linear predictors and link functions Example: estimate a proportion Analysis of deviance Example: fit dose- response data

More information

Generalized Linear Models (1/29/13)

Generalized Linear Models (1/29/13) STA613/CBB540: Statistical methods in computational biology Generalized Linear Models (1/29/13) Lecturer: Barbara Engelhardt Scribe: Yangxiaolu Cao When processing discrete data, two commonly used probability

More information

Generalized Linear Models and Exponential Families

Generalized Linear Models and Exponential Families Generalized Linear Models and Exponential Families David M. Blei COS424 Princeton University April 12, 2012 Generalized Linear Models x n y n β Linear regression and logistic regression are both linear

More information

Introduction to General and Generalized Linear Models

Introduction to General and Generalized Linear Models Introduction to General and Generalized Linear Models Generalized Linear Models - part II Henrik Madsen Poul Thyregod Informatics and Mathematical Modelling Technical University of Denmark DK-2800 Kgs.

More information

Lecture 14: Introduction to Poisson Regression

Lecture 14: Introduction to Poisson Regression Lecture 14: Introduction to Poisson Regression Ani Manichaikul amanicha@jhsph.edu 8 May 2007 1 / 52 Overview Modelling counts Contingency tables Poisson regression models 2 / 52 Modelling counts I Why

More information

Modelling counts. Lecture 14: Introduction to Poisson Regression. Overview

Modelling counts. Lecture 14: Introduction to Poisson Regression. Overview Modelling counts I Lecture 14: Introduction to Poisson Regression Ani Manichaikul amanicha@jhsph.edu Why count data? Number of traffic accidents per day Mortality counts in a given neighborhood, per week

More information

Logistic Regression. Continued Psy 524 Ainsworth

Logistic Regression. Continued Psy 524 Ainsworth 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

More information

1. Hypothesis testing through analysis of deviance. 3. Model & variable selection - stepwise aproaches

1. Hypothesis testing through analysis of deviance. 3. Model & variable selection - stepwise aproaches Sta 216, Lecture 4 Last Time: Logistic regression example, existence/uniqueness of MLEs Today s Class: 1. Hypothesis testing through analysis of deviance 2. Standard errors & confidence intervals 3. Model

More information

Tento projekt je spolufinancován Evropským sociálním fondem a Státním rozpočtem ČR InoBio CZ.1.07/2.2.00/

Tento projekt je spolufinancován Evropským sociálním fondem a Státním rozpočtem ČR InoBio CZ.1.07/2.2.00/ Tento projekt je spolufinancován Evropským sociálním fondem a Státním rozpočtem ČR InoBio CZ.1.07/2.2.00/28.0018 Statistical Analysis in Ecology using R Linear Models/GLM Ing. Daniel Volařík, Ph.D. 13.

More information

BMI 541/699 Lecture 22

BMI 541/699 Lecture 22 BMI 541/699 Lecture 22 Where we are: 1. Introduction and Experimental Design 2. Exploratory Data Analysis 3. Probability 4. T-based methods for continous variables 5. Power and sample size for t-based

More information

Logistic Regression - problem 6.14

Logistic Regression - problem 6.14 Logistic Regression - problem 6.14 Let x 1, x 2,, x m be given values of an input variable x and let Y 1,, Y m be independent binomial random variables whose distributions depend on the corresponding values

More information

Introduction to logistic regression

Introduction to logistic regression Introduction to logistic regression Tuan V. Nguyen Professor and NHMRC Senior Research Fellow Garvan Institute of Medical Research University of New South Wales Sydney, Australia What we are going to learn

More information

Generalized Linear Models Introduction

Generalized Linear Models Introduction Generalized Linear Models Introduction Statistics 135 Autumn 2005 Copyright c 2005 by Mark E. Irwin Generalized Linear Models For many problems, standard linear regression approaches don t work. Sometimes,

More information

ˆπ(x) = exp(ˆα + ˆβ T x) 1 + exp(ˆα + ˆβ T.

ˆπ(x) = exp(ˆα + ˆβ T x) 1 + exp(ˆα + ˆβ T. Exam 3 Review Suppose that X i = x =(x 1,, x k ) T is observed and that Y i X i = x i independent Binomial(n i,π(x i )) for i =1,, N where ˆπ(x) = exp(ˆα + ˆβ T x) 1 + exp(ˆα + ˆβ T x) This is called the

More information

Generalized logit models for nominal multinomial responses. Local odds ratios

Generalized logit models for nominal multinomial responses. Local odds ratios Generalized logit models for nominal multinomial responses Categorical Data Analysis, Summer 2015 1/17 Local odds ratios Y 1 2 3 4 1 π 11 π 12 π 13 π 14 π 1+ X 2 π 21 π 22 π 23 π 24 π 2+ 3 π 31 π 32 π

More information

Truck prices - linear model? Truck prices - log transform of the response variable. Interpreting models with log transformation

Truck prices - linear model? Truck prices - log transform of the response variable. Interpreting models with log transformation Background Regression so far... Lecture 23 - Sta 111 Colin Rundel June 17, 2014 At this point we have covered: Simple linear regression Relationship between numerical response and a numerical or categorical

More information

Chapter 5: Logistic Regression-I

Chapter 5: Logistic Regression-I : Logistic Regression-I Dipankar Bandyopadhyay Department of Biostatistics, Virginia Commonwealth University BIOS 625: Categorical Data & GLM [Acknowledgements to Tim Hanson and Haitao Chu] D. Bandyopadhyay

More information

Likelihoods for Generalized Linear Models

Likelihoods for Generalized Linear Models 1 Likelihoods for Generalized Linear Models 1.1 Some General Theory We assume that Y i has the p.d.f. that is a member of the exponential family. That is, f(y i ; θ i, φ) = exp{(y i θ i b(θ i ))/a i (φ)

More information

Regression so far... Lecture 21 - Logistic Regression. Odds. Recap of what you should know how to do... At this point we have covered: Sta102 / BME102

Regression so far... Lecture 21 - Logistic Regression. Odds. Recap of what you should know how to do... At this point we have covered: Sta102 / BME102 Background Regression so far... Lecture 21 - Sta102 / BME102 Colin Rundel November 18, 2014 At this point we have covered: Simple linear regression Relationship between numerical response and a numerical

More information

Linear Regression. Data Model. β, σ 2. Process Model. ,V β. ,s 2. s 1. Parameter Model

Linear Regression. Data Model. β, σ 2. Process Model. ,V β. ,s 2. s 1. Parameter Model Regression: Part II Linear Regression y~n X, 2 X Y Data Model β, σ 2 Process Model Β 0,V β s 1,s 2 Parameter Model Assumptions of Linear Model Homoskedasticity No error in X variables Error in Y variables

More information

Latent Variable Models for Binary Data. Suppose that for a given vector of explanatory variables x, the latent

Latent Variable Models for Binary Data. Suppose that for a given vector of explanatory variables x, the latent Latent Variable Models for Binary Data Suppose that for a given vector of explanatory variables x, the latent variable, U, has a continuous cumulative distribution function F (u; x) and that the binary

More information

Standard Errors & Confidence Intervals. N(0, I( β) 1 ), I( β) = [ 2 l(β, φ; y) β i β β= β j

Standard Errors & Confidence Intervals. N(0, I( β) 1 ), I( β) = [ 2 l(β, φ; y) β i β β= β j Standard Errors & Confidence Intervals β β asy N(0, I( β) 1 ), where I( β) = [ 2 l(β, φ; y) ] β i β β= β j We can obtain asymptotic 100(1 α)% confidence intervals for β j using: β j ± Z 1 α/2 se( β j )

More information

Data-analysis and Retrieval Ordinal Classification

Data-analysis and Retrieval Ordinal Classification Data-analysis and Retrieval Ordinal Classification Ad Feelders Universiteit Utrecht Data-analysis and Retrieval 1 / 30 Strongly disagree Ordinal Classification 1 2 3 4 5 0% (0) 10.5% (2) 21.1% (4) 42.1%

More information

McGill University. Faculty of Science. Department of Mathematics and Statistics. Statistics Part A Comprehensive Exam Methodology Paper

McGill University. Faculty of Science. Department of Mathematics and Statistics. Statistics Part A Comprehensive Exam Methodology Paper Student Name: ID: McGill University Faculty of Science Department of Mathematics and Statistics Statistics Part A Comprehensive Exam Methodology Paper Date: Friday, May 13, 2016 Time: 13:00 17:00 Instructions

More information

Poisson regression: Further topics

Poisson regression: Further topics Poisson regression: Further topics April 21 Overdispersion One of the defining characteristics of Poisson regression is its lack of a scale parameter: E(Y ) = Var(Y ), and no parameter is available to

More information

11. Generalized Linear Models: An Introduction

11. Generalized Linear Models: An Introduction Sociology 740 John Fox Lecture Notes 11. Generalized Linear Models: An Introduction Copyright 2014 by John Fox Generalized Linear Models: An Introduction 1 1. Introduction I A synthesis due to Nelder and

More information

Generalized Linear Models: An Introduction

Generalized Linear Models: An Introduction Applied Statistics With R Generalized Linear Models: An Introduction John Fox WU Wien May/June 2006 2006 by John Fox Generalized Linear Models: An Introduction 1 A synthesis due to Nelder and Wedderburn,

More information

Exam Applied Statistical Regression. Good Luck!

Exam Applied Statistical Regression. Good Luck! Dr. M. Dettling Summer 2011 Exam Applied Statistical Regression Approved: Tables: Note: Any written material, calculator (without communication facility). Attached. All tests have to be done at the 5%-level.

More information

Homework 5 - Solution

Homework 5 - Solution STAT 526 - Spring 2011 Homework 5 - Solution Olga Vitek Each part of the problems 5 points 1. Agresti 10.1 (a) and (b). Let Patient Die Suicide Yes No sum Yes 1097 90 1187 No 203 435 638 sum 1300 525 1825

More information

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

 M A #M B. Standard deviation of the population (Greek lowercase letter sigma) σ 2 Notation and Equations for Final Exam Symbol Definition X The variable we measure in a scientific study n The size of the sample N The size of the population M The mean of the sample µ The mean of the

More information

Binary Regression. GH Chapter 5, ISL Chapter 4. January 31, 2017

Binary Regression. GH Chapter 5, ISL Chapter 4. January 31, 2017 Binary Regression GH Chapter 5, ISL Chapter 4 January 31, 2017 Seedling Survival Tropical rain forests have up to 300 species of trees per hectare, which leads to difficulties when studying processes which

More information

STAC51: Categorical data Analysis

STAC51: Categorical data Analysis STAC51: Categorical data Analysis Mahinda Samarakoon April 6, 2016 Mahinda Samarakoon STAC51: Categorical data Analysis 1 / 25 Table of contents 1 Building and applying logistic regression models (Chap

More information

Experimental Design and Statistical Methods. Workshop LOGISTIC REGRESSION. Jesús Piedrafita Arilla.

Experimental Design and Statistical Methods. Workshop LOGISTIC REGRESSION. Jesús Piedrafita Arilla. Experimental Design and Statistical Methods Workshop LOGISTIC REGRESSION Jesús Piedrafita Arilla jesus.piedrafita@uab.cat Departament de Ciència Animal i dels Aliments Items Logistic regression model Logit

More information

Statistics 203: Introduction to Regression and Analysis of Variance Course review

Statistics 203: Introduction to Regression and Analysis of Variance Course review Statistics 203: Introduction to Regression and Analysis of Variance Course review Jonathan Taylor - p. 1/?? Today Review / overview of what we learned. - p. 2/?? General themes in regression models Specifying

More information

Generalized Linear Models for Non-Normal Data

Generalized Linear Models for Non-Normal Data Generalized Linear Models for Non-Normal Data Today s Class: 3 parts of a generalized model Models for binary outcomes Complications for generalized multivariate or multilevel models SPLH 861: Lecture

More information

EPSY 905: Fundamentals of Multivariate Modeling Online Lecture #7

EPSY 905: Fundamentals of Multivariate Modeling Online Lecture #7 Introduction to Generalized Univariate Models: Models for Binary Outcomes EPSY 905: Fundamentals of Multivariate Modeling Online Lecture #7 EPSY 905: Intro to Generalized In This Lecture A short review

More information

STAT 525 Fall Final exam. Tuesday December 14, 2010

STAT 525 Fall Final exam. Tuesday December 14, 2010 STAT 525 Fall 2010 Final exam Tuesday December 14, 2010 Time: 2 hours Name (please print): Show all your work and calculations. Partial credit will be given for work that is partially correct. Points will

More information

STAT 526 Spring Midterm 1. Wednesday February 2, 2011

STAT 526 Spring Midterm 1. Wednesday February 2, 2011 STAT 526 Spring 2011 Midterm 1 Wednesday February 2, 2011 Time: 2 hours Name (please print): Show all your work and calculations. Partial credit will be given for work that is partially correct. Points

More information

Binary Response: Logistic Regression. STAT 526 Professor Olga Vitek

Binary Response: Logistic Regression. STAT 526 Professor Olga Vitek Binary Response: Logistic Regression STAT 526 Professor Olga Vitek March 29, 2011 4 Model Specification and Interpretation 4-1 Probability Distribution of a Binary Outcome Y In many situations, the response

More information

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

Stat/F&W Ecol/Hort 572 Review Points Ané, Spring 2010 1 Linear models Y = Xβ + ɛ with ɛ N (0, σ 2 e) or Y N (Xβ, σ 2 e) where the model matrix X contains the information on predictors and β includes all coefficients (intercept, slope(s) etc.). 1. Number of

More information

Unit 5 Logistic Regression Practice Problems

Unit 5 Logistic Regression Practice Problems Unit 5 Logistic Regression Practice Problems SOLUTIONS R Users Source: Afifi A., Clark VA and May S. Computer Aided Multivariate Analysis, Fourth Edition. Boca Raton: Chapman and Hall, 2004. Exercises

More information

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

Stat 642, Lecture notes for 04/12/05 96 Stat 642, Lecture notes for 04/12/05 96 Hosmer-Lemeshow Statistic The Hosmer-Lemeshow Statistic is another measure of lack of fit. Hosmer and Lemeshow recommend partitioning the observations into 10 equal

More information

Introduction to Logistic Regression

Introduction to Logistic Regression Introduction to Logistic Regression Problem & Data Overview Primary Research Questions: 1. What are the risk factors associated with CHD? Regression Questions: 1. What is Y? 2. What is X? Did player develop

More information

You can specify the response in the form of a single variable or in the form of a ratio of two variables denoted events/trials.

You can specify the response in the form of a single variable or in the form of a ratio of two variables denoted events/trials. The GENMOD Procedure MODEL Statement MODEL response = < effects > < /options > ; MODEL events/trials = < effects > < /options > ; You can specify the response in the form of a single variable or in the

More information

Administration. Homework 1 on web page, due Feb 11 NSERC summer undergraduate award applications due Feb 5 Some helpful books

Administration. Homework 1 on web page, due Feb 11 NSERC summer undergraduate award applications due Feb 5 Some helpful books STA 44/04 Jan 6, 00 / 5 Administration Homework on web page, due Feb NSERC summer undergraduate award applications due Feb 5 Some helpful books STA 44/04 Jan 6, 00... administration / 5 STA 44/04 Jan 6,

More information