Docsity

Logistic Regression: Concepts, Assumptions, and Hypothesis Testing, Exams of Data Analysis & Statistical Methods

Toggle sidebar
bg1
ISYE 6414 – Exam Certification Final
with 100% Correct Answers.
Logistic Regression - ✔✔Commonly used for modeling binary response
data. The response variable is a binary variable, and thus, not normally
distributed.
In logistic regression, we model the probability of a success, not the
response variable. In this model, we do not have an error term
g-function - ✔✔We link the probability of success to the predicting
variables using the g link function. The g function is the s-shape
function that models the probability of success with respect to the
predicting variables
The link function g is the log of the ratio of p over one minus p, where p
again is the probability of success
Logit function (log odds function) of the probability of success is a linear
model in the predicting variables
The probability of success is equal to the ratio between the exponential
of the linear combination of the predicting variables over 1 plus this
same exponential
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f

Partial preview of the text

Download Logistic Regression: Concepts, Assumptions, and Hypothesis Testing and more Exams Data Analysis & Statistical Methods in PDF only on Docsity!

ISYE 6414 – Exam Certification Final

with 100% Correct Answers.

Logistic Regression - ✔✔Commonly used for modeling binary response data. The response variable is a binary variable, and thus, not normally distributed. In logistic regression, we model the probability of a success, not the response variable. In this model, we do not have an error term g-function - ✔✔We link the probability of success to the predicting variables using the g link function. The g function is the s-shape function that models the probability of success with respect to the predicting variables The link function g is the log of the ratio of p over one minus p, where p again is the probability of success Logit function (log odds function) of the probability of success is a linear model in the predicting variables The probability of success is equal to the ratio between the exponential of the linear combination of the predicting variables over 1 plus this same exponential

Odds of a success - ✔✔This is the exponential of the Logit function Logistic Regression Assumptions - ✔✔Linearity: The relationship between the g of the probability of success and the predicted variable, is a linear function. Independence: The response binary variables are independently observed Logit: The logistic regression model assumes that the link function g is a logit function Linearity Assumption - ✔✔The Logit transformation of the probability of success is a linear combination of the predicting variables. The relationship may not be linear, however, and transformation may improve the fit The linearity assumption can be evaluated by plotting the logit of the success rate versus the predicting variables. If there's a curvature or some non-linear pattern, it may be an indication that the lack of fit may be due to the non-linearity with respect to some of the predicting variables

Response variable - ✔✔The response data are Bernoulli or binomial with one trial with probability of success MLE - ✔✔The resulting log-likelihood function to be maximized, is very complicated and it is non-linear in the regression coefficients beta 0, beta 1, and beta p MLE has good statistical properties under the assumption of a large sample size i.e. large N For large N, the sampling distribution of MLEs can be approximated by a normal distribution The least square estimation for the standard regression model is equivalent with MLE, under the assumption of normality. MLE is the most applied estimation approach Parameter estimation - ✔✔Maximizing the log likelihood function with respect to beta0, beta1 etc in closed (exact) form expression is not possible because the log likelihood function is a non-linear function in the model parameters i.e. we cannot derive the estimated regression coefficients in an exact form

Use numerical algorithm to estimate betas (maximize the log likelihood function). The estimated parameters and their standard errors are approximate estimates Binomial Data - ✔✔This is binary data with repititions Marginal Relationship - ✔✔Capturing the association of a predicting variable to the response variable without consideration of other factors Conditional Relationship - ✔✔Capturing the association oof a predicting variable to the response variable conditional of other predicting variables in the model Simpson's paradox - ✔✔This is when the addition of a predictive variable reverses the sign on the coefficients of an existing parameter It refers to reversal of an association when looking at a marginal relationship versus a partial or conditional one. This is a situation where the marginal relationship adds a wrong sign This happens when the 2 variables are correlated

We reject the null hypothesis that the regression coefficient is 0 if the z value (gets too large) is larger in absolute value than the z critical point, (or the 1- alpha over 2 of the normal quantile). We interpret that the coefficient is statistically significant **Applies for Logistic & Poisson Regression Hypothesis Testing (coefficient == constant) - ✔✔To test if the regression coefficient is equal to this constant b, then the z-value changes. We subtract b from the estimated coefficients of the numerator We decide to reject/accept using the P-value The P-value is 2 times the left tail of the standard normal of the quantile provided by the absolute value of the z-value P-value = 2P(Z > |z-value|) **Applies for Logistic & Poisson Regression

Hypothesis testing (statistical significance: +/-) - ✔✔Here, the z-value is the same but the P-value will change Positive: P-value = P(Z > z-value) Negative: P-value = P(Z < z-value) **Applies for Logistic & Poisson Regression Statistical Inference - ✔✔Logistic Regression: Normal Distribution. The statistical inference based on the normal distribution applies only under large sample data. If the sample size, or n, is small? Then the statistical inference is not reliable i.e. warn on the lack of the reliability of the results Standard Regression: T-Distribution. The statistical inference relies on the distribution that applies under both small and large samples **Applies for Logistic & Poisson Regression

Coefficient Test (Deviance) - ✔✔The hypothesis testing procedure is testing the null hypothesis that all alpha coefficients are zero, versus the alternative that at least one alpha coefficient is not zero For the testing procedure for subsets of coefficients, we compare the likelihood of a reduced model versus a full model. This test provides inferences on the predictive power of the model. Predictive power means that the predicting variables predict the data even if one or more of the assumptions do not hold Overall Regression - ✔✔Standard Regression: We use the F test to test for the overall regression Logistic Regression: We use the difference between the log likelihood function of the model under the null hypothesis (also called the null- deviance), and the log likelihood of the full model (residual deviance) i.e. the difference between the null deviance and the residual deviance Overall Regression (Logistic) - ✔✔The test statistic is a chi-squared distribution with p degrees of freedom where p is the number of predicting variables. We reject the null hypothesis when the P-value is small, indicating that the overall regression has explanatory power.

Data w/ replications vs Data w/o replications - ✔✔Data with replications: We can observe binary data for repeated trials. That is a binomial distribution with more than one trial or ni greater than 1 Data without replications: For each unique set of the observed predicting variables, we can observe binary data with no repeated trials. That is a binomial distribution with one trial where ni = 1 Logistic Regression with replications - ✔✔Residuals: We can only define residuals for binary data with replications Goodness of Fit: We perform goodness of fit only for logistic regression with replications under the assumption that Yi is binomial with ni greater than 1 Pearson Residuals - ✔✔This is the standardized difference between the ith observed response and estimated expected response, which is ni times the probability of success We need to standardize the difference between observed and expected response, as the responses have different variances

If the p-value is small, we reject the null hypothesis of good fit, and thus we conclude that the model is not a good fit. We want LARGE values of P. Large values of P indicate that the model may be a good fit For goodness of fit test, we compare the likelihoods of the saturated model versus the fitted model. Goodness of Fit (binary data with no responses) - ✔✔Use the deviances from the aggregated model for goodness of fit, not based on the individual level data Reasons why a model may not be a good fit - ✔✔There may be other variables that should be included in the model The relationship between Logit of the expected probability and predictors might be multiplicative, rather than additive Departure from the linearity assumption Initial observations outliers, leverage points are also still an issue for this model Logit function does not fit well with the data

The binomial distribution isn't appropriate. For example, if there's correlation among the responses or there's heterogeneity in the success that hasn't been modeled. Both of these violations can lead to what we call overdispersion Overdispersion - ✔✔This is where the variability of the probability estimates is larger than would be implied by a binomial random variable ɸ = D/(n-p-1) D is the Deviance(sum of squared deviances) If ɸ > 2 then model is overdispersed; an over-dispersed model will fit better Overdispersion impacts the estimated variance and statistical inference. If overdispersion is not accounted for, statistical inference will not be as reliable Link Functions - ✔✔C-log Function: This has very long tails, meaning that it works best in extremely skewed distributions Probit Function: This is the inverse of the CDF of a standard normal distribution. This fits data with least-heavy tails among the three S

The bias comes from the fact that we use the data twice. One, we used it for fitting the model and the second time is to estimate the classification error rate Cross Validation - ✔✔This is a direct measure of predictive power Random sampling is computationally more expensive than the K-fold cross validation, with no clear advantage in terms of the accuracy of the estimation classification error rate The rule of thumb for choosing K is about K = 10 LOOCV is a K-fold cross validation with K = n. The larger K is, the larger the number of folds, the less bias the estimate of the classification the error is but has higher variability. LOOCV - ✔✔LOOCV can be approximated by the sum between the training risk + the complexity penalty. The complexity penalty is (2 * # of predictors in submodel * estimated_variance of submodel)/n

The variability of the submodel is smaller than that of the full model, thus LOOCV penalizes complexity less than Mallow's Cp LOOCV is ~ AIC when the true variance is replaced by the estimate of the variance from the submodel Poisson Regression - ✔✔The response Y in Poisson regression is assumed to have a Poisson distribution, and this is commonly used for modeling count or rate data. We assume that the i-th response Yi has a Poisson distribution, with rate lambda i. Alternatively, log of the rate lambda i is equal to the linear combination of the predicting variables We do not interpret beta with respect to the response variable but with respect to the ratio of the rate There is no error term Poisson Regression Assumptions - ✔✔Linearity: The log transformation of the rate is a linear combination of the predicting variables. Independence: The response variables are independently obserterm- 52ved

G transformation - ✔✔The transformation g is called a link function since it links the expectation of the response to the predicting variables Poisson Regression vs Log transformed Linear Regression - ✔✔Standard Regression: We estimate the expectation of the log of the response - E(log(Y)) The variance under the standard regression is assumed constant Poisson Regression: We estimate the log of the expectation of the response - log(E(Y)) The variance of the response is assumed to be equal to the expectation; thus, the variance is not constant. **Use the Poisson regression especially when the response data are small counts **Using the standard linear regression with log transformation instead of Poisson regression, will result in violations of the assumption of constant variance **Standard Linear Regression could be used if the number of counts are large and with the variance stabilizing transformation √(μ + 3/8) i.e. Square root of the response + 3/8. This transformation will work well for large count when the response data are large counts

Log Rate - ✔✔This is the log function of the expected value of the response ln(λ(x)) = β0 + β1x Regression Coefficient - ✔✔The regression coefficient is interpreted as the log ratio of the rate with an increase with one unit in the predicting variable For p predictors, we have p + 1 regression coefficients for a model with intercept. We estimate the model parameters using the maximum likelihood estimation Maximum Likelihood Estimate - ✔✔Here, we maximize the likelihood function with respect to the model parameters or in this case, the regression coefficient The log likelihood that needs to be maximized is highly non-linear. Thus we cannot derive a closed form (exact) expression of the estimates. The estimated parameters and their standard errors are approximate estimates