logistic and poisson regression

66
Logistic and Poisson Regression SPH 247 Statistical Analysis of Laboratory Data

Upload: harley

Post on 24-Feb-2016

133 views

Category:

Documents


8 download

DESCRIPTION

Logistic and Poisson Regression. SPH 247 Statistical Analysis of Laboratory Data. Generalized Linear Models . The type of predictive model one uses depends on a number of issues; one is the type of response. - PowerPoint PPT Presentation

TRANSCRIPT

Multidisciplinary COllaboration: Why and How?

Logistic and Poisson RegressionSPH 247Statistical Analysis ofLaboratory Data5/6/20101Generalized Linear Models The type of predictive model one uses depends on a number of issues; one is the type of response.Measured values such as quantity of a protein, age, weight usually can be handled in an ordinary linear regression modelPatient survival, which may be censored, calls for a different method (survival analysis, Cox regression).April 30, 2010SPH 247 Statistical Analysis of Laboratory Data25/6/20102If the response is binary, then can we use logistic regression modelsIf the response is a count, we can use Poisson regressionOther forms of response can generate other types of generalized linear modelsApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data35/6/20103Generalized Linear ModelsWe need a linear predictor of the same form as in linear regression xIn theory, such a linear predictor can generate any type of number as a prediction, positive, negative, or zeroWe choose a suitable distribution for the type of data we are predicting (normal for any number, gamma for positive numbers, binomial for binary responses, Poisson for counts)We create a link function which maps the mean of the distribution onto the set of all possible linear prediction results, which is the whole real line (-, ).The inverse of the link function takes the linear predictor to the actual predictionApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data45/6/20104Ordinary linear regression has identity link (no transformation by the link function) and uses the normal distributionIf one is predicting an inherently positive quantity, one may want to use the log link since ex is always positive.An alternative to using a generalized linear model with an log link, is to transform the data using the log or maybe glog. This is a device that works well with measurement data but may not be usable in other casesApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data55/6/20105April 30, 2010SPH 247 Statistical Analysis of Laboratory Data60Possible Means-0PredictorsLink= Log5/6/20106April 30, 2010SPH 247 Statistical Analysis of Laboratory Data70Possible Means-0PredictorsInverseLink= ex5/6/20107Logistic RegressionSuppose we are trying to predict a binary variable (patient has ovarian cancer or not, patient is responding to therapy or not)We can describe this by a 0/1 variable in which the value 1 is used for one response (patient has ovarian cancer) and 0 for the other (patient does not have ovarian cancerWe can then try to predict this responseApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data85/6/20108For a given patient, a prediction can be thought of as a kind of probability that the patient does have ovarian cancer. As such, the prediction should be between 0 and 1. Thus ordinary linear regression is not suitableThe logit transform takes a number which can be anything, positive or negative, and produces a number between 0 and 1. Thus the logit link is useful for binary dataApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data95/6/20109April 30, 2010SPH 247 Statistical Analysis of Laboratory Data1010Possible Means-0PredictorsLink= Logit5/6/201010April 30, 2010SPH 247 Statistical Analysis of Laboratory Data1110Possible Means-0PredictorsInverseLink= inverselogit5/6/201011April 30, 2010SPH 247 Statistical Analysis of Laboratory Data12

5/6/201012April 30, 2010SPH 247 Statistical Analysis of Laboratory Data13

5/6/201013April 30, 2010SPH 247 Statistical Analysis of Laboratory Data14

5/6/201014Analyzing Tabular Data with Logistic RegressionResponse is hypertensive y/nPredictors are smoking (y/n), obesity (y/n), snoring (y/n) [coded as 0/1 for Stata, R does not care]How well can these 3 factors explain/predict the presence of hypertension?Which are important?April 30, 2010SPH 247 Statistical Analysis of Laboratory Data155/6/201015April 30, 2010SPH 247 Statistical Analysis of Laboratory Data16no.yes library(ISwR)> data(juul)> juul1 8 & age < 20 & complete.cases(menarche))> summary(juul1) age menarche sex igf1 tanner Min. : 8.03 Min. :1.000 Min. :2 Min. : 95.0 Min. : 1.000 1st Qu.:10.62 1st Qu.:1.000 1st Qu.:2 1st Qu.:280.5 1st Qu.: 1.000 Median :13.17 Median :2.000 Median :2 Median :409.0 Median : 4.000 Mean :13.44 Mean :1.507 Mean :2 Mean :414.1 Mean : 3.307 3rd Qu.:16.48 3rd Qu.:2.000 3rd Qu.:2 3rd Qu.:514.0 3rd Qu.: 5.000 Max. :19.75 Max. :2.000 Max. :2 Max. :914.0 Max. : 5.000 NA's :108.0 NA's :83.000 testvol Min. : NA 1st Qu.: NA Median : NA Mean :NaN 3rd Qu.: NA Max. : NA NA's :519

5/6/201024April 30, 2010SPH 247 Statistical Analysis of Laboratory Data25> juul1$menarche juul1$tanner attach(juul1)> summary(glm(menarche ~ age,binomial))

Call:glm(formula = menarche ~ age, family = binomial)

Deviance Residuals: Min 1Q Median 3Q Max -2.32759 -0.18998 0.01253 0.12132 2.45922

Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) -20.0132 2.0284 -9.867 anova(glm(menarche ~ age+tanner,binomial),test="Chisq")Analysis of Deviance Table

Model: binomial, link: logit

Response: menarche

Terms added sequentially (first to last)

Df Deviance Resid. Df Resid. Dev P(>|Chi|)NULL 435 604.19 age 1 442.31 434 161.88 3.396e-98tanner 4 55.28 430 106.60 2.835e-11

> drop1(glm(menarche ~ age+tanner,binomial),test="Chisq")Single term deletions

Model:menarche ~ age + tanner Df Deviance AIC LRT Pr(Chi) 106.599 118.599 age 1 124.500 134.500 17.901 2.327e-05 ***tanner 4 161.881 165.881 55.282 2.835e-11 ***---Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 5/6/201027Class prediction from expression arraysOne common use of omics data is to try to develop predictions for classes of patients, such as cancer/normaltype of tumorgrading or staging of tumorsmany other disease/healthy or diagnosis of disease typeApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data285/6/201028Two-class predictionLinear regressionLogistic regressionLinear or quadratic discriminant analysisPartial least squaresFuzzy neural nets estimated by genetic algorithms and other buzzwordsMany such methods require fewer variables than cases, so dimension reduction is neededApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data295/6/201029Dimension ReductionSuppose we have 20,000 variables and wish to predict whether a patient has ovarian cancer or not and suppose we have 50 cases and 50 controlsWe can only use a number of predictors much smaller than 50How do we do this?April 30, 2010SPH 247 Statistical Analysis of Laboratory Data305/6/201030Two distinct ways are selection of genes and selection of supergenes as linear combinationsWe can choose the genes with the most significant t-tests or other individual gene criteriaWe can use forward stepwise logistic regression, which adds the most significant gene, then the most significant addition, and so on, or other ways of picking the best subset of genesApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data315/6/201031Supergenes are linear combinations of genes. If g1, g2, g3, , gp are the expression measurements for the p genes in an array, and a1, a2, a3, , ap are a set of coefficients then g1 a1+ g2 a2+ g3 a3+ + gp ap is a supergene. Methods for construction of supergenes include PCA and PLSApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data325/6/201032Choosing Subsets of SupergenesSuppose we have 50 cases and 50 controls and an array of 20,000 gene expression values for each of the 100 observationsIn general, any arbitrary set of 100 genes will be able to predict perfectly in the data if a logistic regression is fit to the 100 genesMost of these will predict poorly in future samplesApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data335/6/201033This is a mathematical factA statistical fact is that even if there is no association at all between any gene and the disease, often a few genes will produce apparently excellent results, that will not generalize at allWe must somehow account for this, and cross validation is the usual wayApril 30, 2010SPH 247 Statistical Analysis of Laboratory Data345/6/201034April 30, 2010SPH 247 Statistical Analysis of Laboratory Data35y