「Regression model」の版間の差分

提供: Vaccipedia | Resources for Vaccines, Tropical medicine and Travel medicine
ナビゲーションに移動 検索に移動
68行目: 68行目:
 
&dagger;'Multivariable' can be rephrased as 'Multiple'; Multivariable is <font color="red">'''NOT equal to 'Multivariate'!!'''</font>
 
&dagger;'Multivariable' can be rephrased as 'Multiple'; Multivariable is <font color="red">'''NOT equal to 'Multivariate'!!'''</font>
  
===How to convert coefficient of binary logistic regressoin to odds ratio===
+
===Conversion of binary logistic regression equation to outcome probability <math>p</math>===
About a binary logistic regression formula,
+
Equation of binary logistic regression can be converted to outcome probablity <math>p</math> as,
 
:<math>
 
:<math>
 
\begin{align}
 
\begin{align}
& \log Y = \\
+
\log Y = \log \left ( \frac{p}{1-p} \right ) & = a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots \\
& \log \left ( \frac{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{align}
 
\end{align}
 
</math>
 
</math>
  
adding 1 to <math>X_1</math> makes probablity <math>p\prime</math> as,
+
===How to convert coefficient of binary logistic regressoin 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,
 
:<math>
 
:<math>
\log \left ( \frac{p\prime}{1-p\prime} \right ) = a + b_1(X_1 + 1) + b_2X_2 + b_3X_3 + \cdots
+
\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>
 
</math>
  
Subtraction of above two equations makes,
+
Subtraction of these two equations makes,
 
:<math>
 
:<math>
 
\begin{align}
 
\begin{align}
\log \left ( \frac{p\prime}{1-p\prime} \right ) - \log \left ( \frac{p}{1-p} \right ) & = b_1(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 ) } & = e^{b_1}
91行目: 97行目:
 
</math>
 
</math>
  
Because <math>\frac {\left ( \dfrac{p\prime}{1-p\prime} \right )}{ \left ( \dfrac{p}{1-p} \right ) }</math> is the odds ratio of the probablity <math>p\prime</math> when 1 is added to <math>X_1</math> to the probability <math>p</math>,
 
  
<math>\color{red}{e^{b_1}}</math> or <math>\color{red}{\exp (b_1)}</math> is the conversion of coefficient <math>b_1</math> to obtain the '''odds ratio of outocome probabilities''' before and after variable <math>X_1</math> gains 1.
+
Because <math>\left ( \dfrac{p\prime}{1-p\prime} \right )</math> and <math>\left ( \dfrac{p}{1-p} \right )</math> are odds of <math>p\prime</math> and <math>p</math>, respectively,
 +
 
 +
<math>\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>1</math> is added to <math>X_1</math>] to [the probability before adding].
 +
 
 +
 
 +
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 1.
  
 
==Generalized linear model==
 
==Generalized linear model==

2023年2月4日 (土) 18:32時点における版

Basics & Definition
Epidemiology
Odds in statistics and Odds in a horse race
Collider bias
Data distribution
Statistical test
Regression model
Multivariate analysis
Marginal effects
Prediction and decision
Table-related commands in STATA
Missing data and imputation

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
  • Single linear regression
[math]\displaystyle{ Y = a + bX }[/math]
  • Multivariable† linear regression
[math]\displaystyle{ Y = a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots }[/math]

Least squares method

Binary
  • Single binary logistic regression
[math]\displaystyle{ \log Y = a + bX }[/math]
where [math]\displaystyle{ Y }[/math] is odds of outcome [math]\displaystyle{ \frac{p}{1-p} }[/math]
  • Multivariable† binary logistic regression
[math]\displaystyle{ \log Y = a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots }[/math]
where [math]\displaystyle{ Y }[/math] is odds of outcome [math]\displaystyle{ \frac{p}{1-p} }[/math]

Maximum likelihood estimation method

Multinominal
≥ 3
  • Single multinominal logistic regression
  • Multivariable† multinominal logistic regression

Maximum likelihood estimation method

Ordinal
  • Single ordinal logistic regression
  • Multivariable† ordinal logistic regression

Maximum likelihood estimation method

Rate ratio
  • Multivariable Poisson regression
[math]\displaystyle{ \log Y = a + b_1X_1 + b_2X_2 + b_3X_3 + \cdots }[/math]
where [math]\displaystyle{ Y }[/math] is rate ratio [math]\displaystyle{ \frac{events_1/person \text{-} time_1}{events_2/person \text{-} time_2} }[/math]

Maximum likelihood estimation method

Survival time
  • Multivariable proportional hazard regression
    = Cox hazard regression
[math]\displaystyle{ \log h(T) = \log h_0(T) + b_1X_1 + b_2X_2 + b_3X_3 + \cdots }[/math]
where [math]\displaystyle{ h(T) }[/math] is the hazard at time [math]\displaystyle{ T }[/math]
and [math]\displaystyle{ h_0(T) }[/math] is the baseline hazard at time [math]\displaystyle{ T }[/math]

Maximum likelihood estimation method

†'Multivariable' can be rephrased as 'Multiple'; Multivariable is NOT equal to 'Multivariate'!!

Conversion of binary logistic regression equation 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{align} \log Y = \log \left ( \frac{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{align} }[/math]

How to convert coefficient of binary logistic regressoin 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 ) } & = e^{b_1} \end{align} }[/math]


Because [math]\displaystyle{ \left ( \dfrac{p\prime}{1-p\prime} \right ) }[/math] and [math]\displaystyle{ \left ( \dfrac{p}{1-p} \right ) }[/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 1.

Generalized linear model

Penalized multivariable logistic regression model

Restricted cubic spline