Outcome xi | Probability pi |
---|---|
0 | s |
1 | 1-s |
Regression Type | Distribution | Link Function | Generalized Linear Regression Equation |
---|---|---|---|
Ordinary | Normal | Identity | μ = β0 + ∑j=1n βj xi |
Logistic | Bernoulli | Logit | log(p/(1-p)) = β0 + ∑j=1n βj xi |
Poisson | Poisson | Log | log(λ) = β0 + ∑j=1n βj xi |
logit(p) | = | 2.0859 |
log[p/(1-p)] | = | 2.0859 |
p/(1-p) | = | exp(2.0859) |
p/(1-p) | = | 8.0518 |
p | = | 8.0518(1-p) |
9.0518p | = | 8.0518 |
p | = | 0.8895 |
x <- rnorm(10000)^2 + rnorm(10000)^2 + rnorm(10000)^2 + rnorm(10000)^2
x = rbinom(50, 1, 0.5) cat("Number of heads =", sum(x), "out of 50 coin flips.\n")
Number of heads = 21 out of 50 coin flips.This result can be summarized in a contingency table:
Cell | 1 | 2 |
Result | Head | Tail |
Count | 21 | 29 |
Observed Values | Cold | |||
1 | 0 | Totals | ||
Treatment | Placebo | 31 | 109 | 140 |
Supplement | 17 | 122 | 129 | |
Totals | 48 | 231 | 279 |
Expected Values Assuming Independence | Cold | |||
1 | 0 | Totals | ||
Treatment | Placebo | 24.09 | 115.91 | 140.00 |
Supplement | 23.91 | 115.09 | 129.00 | |
Totals | 48.00 | 231.00 | 279.00 |
p <- fitted(model, type="response") deviances = sqrt(-2 * log(abs(p - (1 - a))) * sign(a - p)