「Regression model」の版間の差分
Vaccipedia.admin (トーク | 投稿記録) |
Vaccipedia.admin (トーク | 投稿記録) |
||
(同じ利用者による、間の7版が非表示) | |||
1行目: | 1行目: | ||
− | {{ | + | {{Floating_Menu}} |
==Classification of Regression models== | ==Classification of Regression models== | ||
68行目: | 68行目: | ||
†'Multivariable' can be rephrased as 'Multiple'; Multivariable is <font color="red">'''NOT equal to 'Multivariate'!!'''</font> | †'Multivariable' can be rephrased as 'Multiple'; Multivariable is <font color="red">'''NOT equal to 'Multivariate'!!'''</font> | ||
− | ===Conversion of | + | ==Binary logistic regression== |
+ | ===Conversion of logit of outcome odds to outcome probability <math>p</math>=== | ||
Equation of binary logistic regression can be converted to outcome probablity <math>p</math> as, | Equation of binary logistic regression can be converted to outcome probablity <math>p</math> as, | ||
:<math> | :<math> | ||
− | \begin{ | + | \begin{array}{lrll} |
− | \log Y = \log \left ( \ | + | \log Y = & \log \left ( \dfrac{p}{1-p} \right ) & = a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots \\ |
− | \Leftrightarrow \dfrac{p}{1-p} & = \exp (a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots) = e^{(a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots)} \\ | + | \Leftrightarrow & \dfrac{p}{1-p} & = \exp (a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots) |
− | \Leftrightarrow p & = \dfrac { \exp (a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots) }{ 1 + \exp (a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots) } | + | & = e^{(a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots)} \\ |
− | + | \Leftrightarrow & p & = \dfrac { \exp (a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots) }{ 1 + \exp (a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots) } | |
− | \end{ | + | & = \dfrac { e^{(a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots)} }{ 1 + e^{(a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots)} } \\ |
+ | \end{array} | ||
</math> | </math> | ||
− | === | + | ===Conversion of coefficient to odds ratio=== |
When thinking about outcome probability <math>p</math> and the changed outcome probability <math>p\prime</math> by adding <math>1</math> to explanatory variable <math>X_1</math>, the following two equations are obtained, | When thinking about outcome probability <math>p</math> and the changed outcome probability <math>p\prime</math> by adding <math>1</math> to explanatory variable <math>X_1</math>, the following two equations are obtained, | ||
:<math> | :<math> | ||
93行目: | 95行目: | ||
\log \left ( \frac{p\prime}{1-p\prime} \right ) - \log \left ( \frac{p}{1-p} \right ) & = b_1({\color{red}X_1 + 1}) - b_1X_1 \\ | \log \left ( \frac{p\prime}{1-p\prime} \right ) - \log \left ( \frac{p}{1-p} \right ) & = b_1({\color{red}X_1 + 1}) - b_1X_1 \\ | ||
& = b_1 \\ | & = b_1 \\ | ||
− | \Leftrightarrow \frac {\left ( \dfrac{p\prime}{1-p\prime} \right )}{ \left ( \dfrac{p}{1-p} \right ) } & = e^{b_1} | + | \Leftrightarrow \frac {\left ( \dfrac{p\prime}{1-p\prime} \right )}{ \left ( \dfrac{p}{1-p} \right ) } & = \exp (b_1) = e^{b_1} |
\end{align} | \end{align} | ||
</math> | </math> | ||
104行目: | 106行目: | ||
Thus, converted <math>b_1</math> to <math>\color{red}{e^{b_1}}</math> or <math>\color{red}{\exp (b_1)}</math> gives the '''odds ratio of outocome probabilities''' before and after variable <math>X_1</math> gains <math>1</math>. | Thus, converted <math>b_1</math> to <math>\color{red}{e^{b_1}}</math> or <math>\color{red}{\exp (b_1)}</math> gives the '''odds ratio of outocome probabilities''' before and after variable <math>X_1</math> gains <math>1</math>. | ||
+ | |||
+ | ::<math> | ||
+ | \begin{align} | ||
+ | \exp (\text{coefficient}) = e^{\text{coefficient}} & = \text{odds ratio} \\ | ||
+ | \log (\text{odds ratio}) & = \text{coefficient} | ||
+ | \end{align} | ||
+ | </math> | ||
==Generalized linear model== | ==Generalized linear model== |
2023年9月10日 (日) 13:19時点における最新版
Navigation Menu |
General issues of Vaccine | |||||||
---|---|---|---|---|---|---|---|
|
General issues of Travel med. | ||||||||
---|---|---|---|---|---|---|---|---|
|
Immunology | |||||||
---|---|---|---|---|---|---|---|
|
Epi & Stats | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Virus | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
COVID-19 | |||||
---|---|---|---|---|---|
|
Bacteria | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Rickettsia | |||||
---|---|---|---|---|---|
|
Protozoa | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Fungi | |||||||
---|---|---|---|---|---|---|---|
|
Nematode (roundworm) | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Trematode (fluke, distoma) | |||||||
---|---|---|---|---|---|---|---|
|
Cestode (tapeworm) | ||||||
---|---|---|---|---|---|---|
|
Medical Zoology | ||||||||
---|---|---|---|---|---|---|---|---|
|
目次
Classification of Regression models
Independent variable (exposure) | ||||
---|---|---|---|---|
Univariable (single variable) | Multivariable (multiple variables) | How to derive coefficients [math]\displaystyle{ b_i }[/math] | ||
Dependent variable (outcome) |
Continuous |
|
|
Least squares method |
Binary |
|
|
Maximum likelihood estimation method | |
Multinominal ≥ 3 |
|
|
Maximum likelihood estimation method | |
Ordinal |
|
|
Maximum likelihood estimation method | |
Rate ratio |
|
Maximum likelihood estimation method | ||
Survival time |
|
Maximum likelihood estimation method |
†'Multivariable' can be rephrased as 'Multiple'; Multivariable is NOT equal to 'Multivariate'!!
Binary logistic regression
Conversion of logit of outcome odds to outcome probability [math]\displaystyle{ p }[/math]
Equation of binary logistic regression can be converted to outcome probablity [math]\displaystyle{ p }[/math] as,
- [math]\displaystyle{ \begin{array}{lrll} \log Y = & \log \left ( \dfrac{p}{1-p} \right ) & = a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots \\ \Leftrightarrow & \dfrac{p}{1-p} & = \exp (a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots) & = e^{(a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots)} \\ \Leftrightarrow & p & = \dfrac { \exp (a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots) }{ 1 + \exp (a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots) } & = \dfrac { e^{(a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots)} }{ 1 + e^{(a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots)} } \\ \end{array} }[/math]
Conversion of coefficient to odds ratio
When thinking about outcome probability [math]\displaystyle{ p }[/math] and the changed outcome probability [math]\displaystyle{ p\prime }[/math] by adding [math]\displaystyle{ 1 }[/math] to explanatory variable [math]\displaystyle{ X_1 }[/math], the following two equations are obtained,
- [math]\displaystyle{ \begin{array}{lcl} \log \left ( \dfrac{p}{1-p} \right ) & = & a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots \\ \log \left ( \dfrac{p\prime}{1-p\prime} \right ) & = & a + b_1( {\color{red}X_1 + 1} ) + b_2X_2 + b_3X_3 + \cdots \end{array} }[/math]
Subtraction of these two equations makes,
- [math]\displaystyle{ \begin{align} \log \left ( \frac{p\prime}{1-p\prime} \right ) - \log \left ( \frac{p}{1-p} \right ) & = b_1({\color{red}X_1 + 1}) - b_1X_1 \\ & = b_1 \\ \Leftrightarrow \frac {\left ( \dfrac{p\prime}{1-p\prime} \right )}{ \left ( \dfrac{p}{1-p} \right ) } & = \exp (b_1) = e^{b_1} \end{align} }[/math]
Because [math]\displaystyle{ \dfrac{p\prime}{1-p\prime} }[/math] and [math]\displaystyle{ \dfrac{p}{1-p} }[/math] are odds of [math]\displaystyle{ p\prime }[/math] and [math]\displaystyle{ p }[/math], respectively,
[math]\displaystyle{ \frac {\left ( \dfrac{p\prime}{1-p\prime} \right )}{ \left ( \dfrac{p}{1-p} \right ) } }[/math] is the odds ratio of [the probability when [math]\displaystyle{ 1 }[/math] is added to [math]\displaystyle{ X_1 }[/math]] to [the probability before adding].
Thus, converted [math]\displaystyle{ b_1 }[/math] to [math]\displaystyle{ \color{red}{e^{b_1}} }[/math] or [math]\displaystyle{ \color{red}{\exp (b_1)} }[/math] gives the odds ratio of outocome probabilities before and after variable [math]\displaystyle{ X_1 }[/math] gains [math]\displaystyle{ 1 }[/math].
- [math]\displaystyle{ \begin{align} \exp (\text{coefficient}) = e^{\text{coefficient}} & = \text{odds ratio} \\ \log (\text{odds ratio}) & = \text{coefficient} \end{align} }[/math]
Generalized linear model
Penalized multivariable logistic regression model
- Penalized Logistic Regression Essentials in R: Ridge, Lasso and Elastic Net
- 罰則付き・正則化回帰モデルについて(About penalized/regularized regression model)