Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Chapter 14: Ethers and Epoxides; Thiols and Sulfides 14.1 ..., Lecture notes of Stereochemistry

Alkoxides are prepared by the reaction of an alcohol with a strong base such as sodium hydride (NaH). The Williamson ether synthesis is an SN2 reaction.

Typology: Lecture notes

2021/2022

Uploaded on 07/04/2022

NicolaasNik
NicolaasNik 🇳🇱

4.5

(7)

169 documents

1 / 51

Toggle sidebar

Related documents


Partial preview of the text

Download Chapter 14: Ethers and Epoxides; Thiols and Sulfides 14.1 ... and more Lecture notes Stereochemistry in PDF only on Docsity! Binary Logistic Regression The coefficients of the multiple regression model are estimated using sample data with k independent variables • Interpretation of the Slopes: (referred to as a Net Regression Coefficient) – b1=The change in the mean of Y per unit change in X1, taking into account the effect of X2 (or net of X2) – b0 Y intercept. It is the same as simple regression. kik2i21i10i XbXbXbbŶ ++++=  Estimated (or predicted) value of Y Estimated slope coefficients Estimated intercept 2 Binary Logistic Regression – However, there are three problems 1. The error terms are heteroskedastic (variance of the dependent variable is different with different values of the independent variables 2. The error terms are not normally distributed 3. And most importantly, for purpose of interpretation, the predicted probabilities can be greater than 1 or less than 0, which can be a problem for subsequent analysis. 5 Binary Logistic Regression • The “logit” model solves these problems: – ln[p/(1-p)] = a + BX or – p/(1-p) = ea + BX – p/(1-p) = ea (eB)X Where: “ln” is the natural logarithm, logexp, where e=2.71828 “p” is the probability that Y for cases equals 1, p (Y=1) “1-p” is the probability that Y for cases equals 0, 1 – p(Y=1) “p/(1-p)” is the odds ln[p/1-p] is the log odds, or “logit” 6 Binary Logistic Regression • Logistic Distribution • Transformed, however, the “log odds” are linear. ln[p/(1-p)] P (Y=1) x x 7 Binary Logistic Regression • Logistic Distribution With the logistic transformation, we’re fitting the “model” to the data better. • Transformed, however, the “log odds” are linear. P(Y = 1) 1 .5 0 X = 0 10 20 Ln[p/(1-p)] X = 0 10 20 10 Binary Logistic Regression • You’re likely feeling overwhelmed, perhaps anxious about understanding this. • Don’t worry, coherence is gained when you see similarity to OLS regression: 1. Model fit 2. Interpreting coefficients 3. Inferential statistics 4. Predicting Y for values of the independent variables (the most difficult, but we’ll make it easy) 11 Review & Summary • In logistic regression, we predict Z, not p, because of Z’s convenient mathematical properties • Z is a linear function of the predictors, and we can translate that prediction into a probability. 12 Interpreting logistic regression results • In SPSS output, look for: 1) Model chi-square (equivalent to F) 2) WALD statistics and “Sig.” for each B 3) Logistic regression coefficients (B’s) 4) Exp(B) = odds ratio 15 Interpreting logistic coefficients • Identify which predictors are significant by looking at “Sig.” • Look at the sign of B1 * If B1 is positive, a unit change in x1 is raising the odds of the event happening, after controlling for the other predictors * If B1 is negative, the odds of the event decrease with a unit increase in x1. 16 Interpreting the odds ratio • Look at the column labeled Exp(B) Exp(B) means “e to the power B” or eB Called the “odds ratio” (Gr. symbol: Ψ) e is a mathematical constant used as the “base” for natural logarithms • In logistic regression, eB is the factor by which the odds change when X increases by one unit. 17 Binary Logistic Regression • A researcher is interested in the likelihood of gun ownership in the US, and what would predict that. • She uses the GSS to test the following research hypotheses: 1. Men are more likely to own guns than are women 2. Older people are more likely to own guns 3. White people are more likely to own guns than are those of other races 4. More educated people are less likely to own guns 20 Binary Logistic Regression • Variables are measured as such: Dependent: Havegun: no gun = 0, own gun(s) = 1 Independent: 1. Sex: men = 0, women = 1 2. Age: entered as number of years 3. White: all other races = 0, white =1 4. Education: entered as number of years SPSS: Analyze  Regression  Binary Logistic Enter your variables and for output below, under options, I checked “iteration history” 21 Binary Logistic Regression SPSS Output: Some descriptive information first… 22 Remember When Assessing Predictors, The Odds Ratio or Exp(b)… • Indicates the change in odds resulting from a unit change in the predictor. – OR > 1: Predictor ↑, Probability of outcome occurring ↑. – OR < 1: Predictor ↑, Probability of outcome occurring ↓. predictorthe in change unit a beforeOdds predictorthe in change unit a afterOdds bExp =)( 25 Binary Logistic Regression Interpreting Coefficients… ln[p/(1-p)] = a + b1X1 + b2X2 + b3X3 + b4X4 b1 b2 b3 b4 a Being male, getting older, and being white have a positive effect on likelihood of owning a gun. On the other hand, education does not affect owning a gun. We’ll discuss the Wald test in a moment… X1 X2 X3 X4 1 eb Which b’s are significant? 26 Binary Logistic Regression Each coefficient increases the odds by a multiplicative amount, the amount is eb. “Every unit increase in X increases the odds by eb.” In the example above, eb = Exp(B) in the last column. New odds / Old odds = eb = odds ratio For Female: e-.780 = .458 …females are less likely to own a gun by a factor of .458. Age: e.020=1.020 … for every year of age, the odds of owning a gun increases by a factor of 1.020. White: e1.618 = 5.044 …Whites are more likely to own a gun by a factor of 5.044. Educ: e-.023 = .977 …Not significant 27 Equation for Step 1 We can say that the odds of a patient who is treated being cured are 3.41 times higher than those of a patient who is not treated, with a 95% CI of 1.561 to 7.480. The important thing about this confidence interval is that it doesn’t cross 1 (both values are greater than 1). This is important because values greater than 1 mean that as the predictor variable(s) increase, so do the odds of (in this case) being cured. Values less than 1 mean the opposite: as the predictor increases, the odds of being cured decreases. See p 288 for an Example of using equation to compute Odds ratio. 30 Output: Step 1 Removing Intervention from the model would have a significant effect on the predictive ability of the model, in other words, it would be very bad to remove it. 31 Binary Logistic Regression Binary Logistic Regression • So what are natural logs and exponents? – If you didn’t learn about them before this class, you obviously don’t need to know it to get your degree … so don’t worry about it. – But, for those who did learn it, ln(x)=y is the same as: x=ey READ THE ABOVE LIKE THIS: when you see “ln(x)” say “the value after the equal sign is the power to which I need to take e to get x” so… y is the power to which you would take e to get x 35 Binary Logistic Regression • So… ln[p/(1-p)] = y is same as: p/(1-p) = ey READ THE ABOVE LIKE THIS: when you see “ln[p/(1-P)]” say “the value after the equal sign is the power to which I need to take e to get p/(1-p)” so… y is the power to which you would take e to get p/(1-p) 36 Binary Logistic Regression • So… ln[p/(1-p)] = a + bX is same as: p/(1-p) = ea + bX READ THE ABOVE LIKE THIS: when you see “ln[p/(1-P)]” say “the value after the equal sign is the power to which I need to take e to get p/(1-p)” so… a + bX is the power to which you would take e to get p/(1-p) 37 Binary Logistic Regression SPSS Output: Some descriptive information first… Maximum likelihood process stops at third iteration and yields an intercept (-.625) for a model with no predictors. A measure of fit, -2 Log likelihood is generated. The equation producing this: -2(∑(Yi * ln[P(Yi)] + (1-Yi) ln[1-P(Yi)]) This is simply the relationship between observed values for each case in your data and the model’s prediction for each case. The “negative 2” makes this number distribute as a X2 distribution. In a perfect model, -2 log likelihood would equal 0. Therefore, lower numbers imply better model fit. 40 Binary Logistic Regression Originally, the “best guess” for each person in the data set is 0, have no gun! This is the model for log odds when any other potential variable equals zero (null model). It predicts : P = .651, like above. 1/1+ea or 1/1+.535 Real P = .349 If you added each… 41 Binary Logistic Regression Next are iterations for our full model… 42 Binary Logistic Regression Age: e.020 = 1.020 … A year increase in age increases the odds of owning a gun by 2%. How would 10 years’ increase in age affect the odds? Recall (eb)X is the equation component for a variable. For 10 years, (1.020)10 = 1.219. The odds jump by 22% for ten years’ increase in age. Note: You’d have to know the current prediction level for the dependent variable to know if this percent change is actually making a big difference or not! 45 Binary Logistic Regression Note: You’d have to know the current prediction level for the dependent variable to know if this percent change is actually making a big difference or not! Recall that the logistic regression tells us two things at once. • Transformed, the “log odds” are linear. • Logistic Distribution ln[p/(1-p)] P (Y=1) x x 46 Binary Logistic Regression We can also get p(y=1) for particular folks. Odds = p/(1-p); p = P(Y=1) With algebra… Odds(1-p) = p … Odds-p(odds) = p … Odds = p+p(odds) … Odds = p(1+odds) … Odds/1+odds = p or p = Odds/(1+odds) Ln(odds) = a + bx and odds = e a + bx so… P = ea+bX/(1+ ea+bX) We can therefore plug in numbers for X to get P If a + BX = 0, then p = .5 As a + BX gets really big, p approaches 1 As a + BX gets really small, p approaches 0 (our model is an S curve) 47 Binary Logistic Regression Inferential statistics are as before: • The significance of the coefficients is determined by a “wald test.” Wald is χ2 with 1 df and equals a two-tailed t2 with p-value exactly the same. 50 Binary Logistic Regression 1. Significance test for α-level = .05 2. Critical X2 df=1= 3.84 3.To find if there is a significant slope in the population, Ho: β = 0 Ha: β ≠ 0 4.Collect Data 5.Calculate Wald, like t (z): t = b – βo (1.96 * 1.96 = 3.84) s.e. 6.Make decision about the null hypothesis 7.Find P-value So how would I do hypothesis testing? An Example: Reject the null for Male, age, and white. Fail to reject the null for education. There is a 24.2% chance that the sample came from a population where the education coefficient equals 0. 51
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved