Skip to main content
added 243 characters in body
Source Link
Maarten Buis
  • 21.5k
  • 37
  • 65

You need to choose whether $A$ or $B$ is your dependent/explained/left-hand-side/$y$-variable. Let's say $B$ is the variable you want to explain, and $A$ is the variable with which you explain $B$. So now you can write the regression as:

$\ln(Odds(B=1|A))= \beta_0+\beta_1A$

So $\beta_0$ is a constant, so it is the log odds of $B$ being 1 when all $x$-variables (in this case just $A$) equal 0. The odds is the number of successes per failure, which in your example is $\frac{44}{443}\approx0.10$. Taking the log of that will give us $\beta_0$, which for your table is approximately $-2.3$.

$\beta_1$ is the log odds ratio. The odds ratio is, as the name suggest, a ratio of odds. It answers the question, by what factor does the odds change for a unit increase in $x$. The odds was $\frac{44}{443}$ when $A$ was 0, and the odds is $\frac{27}{95}$ when $A$ is 1, so odds changes by a factor $\frac{\frac{27}{95}}{\frac{44}{443}} = \frac{27\times443}{95\times44}\approx2.9$. So the odds of $B=1$ is almost three times larger for the group $A=1$ compared to the group $A=0$. Taking the log of the odds ratio will give is $\beta_1$, in this case approximately $1.1$

These manual computation were possible because this is a so called saturated model; the model will exactly reproduce the cell counts. If, for example, we added a second explanatory variable but not the interaction, then this would no longer be a saturated model, and we would have to use an iterative algorithm to find the maximum likelihood estimates of the parameters.

In your question you referred to just using $A$, and shown the marginal distribution of $A$. That would be equivalent to a logistic regression with only a constant and no explanatory variables. This too is a saturated model, and the constant in that model is the log of the odds you estimated.


Edit, response to edit in original question

What you found is correct: the odds ratio is symmetric. This property is for example used in case control studies.

You need to choose whether $A$ or $B$ is your dependent/explained/left-hand-side/$y$-variable. Let's say $B$ is the variable you want to explain, and $A$ is the variable with which you explain $B$. So now you can write the regression as:

$\ln(Odds(B=1|A))= \beta_0+\beta_1A$

So $\beta_0$ is a constant, so it is the log odds of $B$ being 1 when all $x$-variables (in this case just $A$) equal 0. The odds is the number of successes per failure, which in your example is $\frac{44}{443}\approx0.10$. Taking the log of that will give us $\beta_0$, which for your table is approximately $-2.3$.

$\beta_1$ is the log odds ratio. The odds ratio is, as the name suggest, a ratio of odds. It answers the question, by what factor does the odds change for a unit increase in $x$. The odds was $\frac{44}{443}$ when $A$ was 0, and the odds is $\frac{27}{95}$ when $A$ is 1, so odds changes by a factor $\frac{\frac{27}{95}}{\frac{44}{443}} = \frac{27\times443}{95\times44}\approx2.9$. So the odds of $B=1$ is almost three times larger for the group $A=1$ compared to the group $A=0$. Taking the log of the odds ratio will give is $\beta_1$, in this case approximately $1.1$

These manual computation were possible because this is a so called saturated model; the model will exactly reproduce the cell counts. If, for example, we added a second explanatory variable but not the interaction, then this would no longer be a saturated model, and we would have to use an iterative algorithm to find the maximum likelihood estimates of the parameters.

In your question you referred to just using $A$, and shown the marginal distribution of $A$. That would be equivalent to a logistic regression with only a constant and no explanatory variables. This too is a saturated model, and the constant in that model is the log of the odds you estimated.

You need to choose whether $A$ or $B$ is your dependent/explained/left-hand-side/$y$-variable. Let's say $B$ is the variable you want to explain, and $A$ is the variable with which you explain $B$. So now you can write the regression as:

$\ln(Odds(B=1|A))= \beta_0+\beta_1A$

So $\beta_0$ is a constant, so it is the log odds of $B$ being 1 when all $x$-variables (in this case just $A$) equal 0. The odds is the number of successes per failure, which in your example is $\frac{44}{443}\approx0.10$. Taking the log of that will give us $\beta_0$, which for your table is approximately $-2.3$.

$\beta_1$ is the log odds ratio. The odds ratio is, as the name suggest, a ratio of odds. It answers the question, by what factor does the odds change for a unit increase in $x$. The odds was $\frac{44}{443}$ when $A$ was 0, and the odds is $\frac{27}{95}$ when $A$ is 1, so odds changes by a factor $\frac{\frac{27}{95}}{\frac{44}{443}} = \frac{27\times443}{95\times44}\approx2.9$. So the odds of $B=1$ is almost three times larger for the group $A=1$ compared to the group $A=0$. Taking the log of the odds ratio will give is $\beta_1$, in this case approximately $1.1$

These manual computation were possible because this is a so called saturated model; the model will exactly reproduce the cell counts. If, for example, we added a second explanatory variable but not the interaction, then this would no longer be a saturated model, and we would have to use an iterative algorithm to find the maximum likelihood estimates of the parameters.

In your question you referred to just using $A$, and shown the marginal distribution of $A$. That would be equivalent to a logistic regression with only a constant and no explanatory variables. This too is a saturated model, and the constant in that model is the log of the odds you estimated.


Edit, response to edit in original question

What you found is correct: the odds ratio is symmetric. This property is for example used in case control studies.

updated math text
Source Link
StatsStudent
  • 11.5k
  • 4
  • 44
  • 75

You need to choose whether $A$ or $B$ is your dependent/explained/left-hand-side/y$y$-variable. LetsLet's say $B$ is the variable you want to explain, and $A$ is the variable with which you explain $B$. So now you can write the regression as:

$\ln(Odds(B=1|A))= \beta_0+\beta_1A$

So $\beta_0$ is a constant, so it is the log odds of $B$ being 1 when all x$x$-variables (in this case just $A$) equal 0. The odds is the number of successes per failure, which in your example is $\frac{44}{443}\approx0.10$. Taking the log of that will give us $\beta_0$, which for your table is approximately $-2.3$.

$\beta_1$ is the log odds ratio. The odds ratio is, as the name suggest, a ratio of odds. It answers the question, by what factor does the odds change for a unit increase in $x$. The odds was $\frac{44}{443}$ when $A$ was 0, and the odds is $\frac{27}{95}$ when $A$ is 1, so odds changes by a factor $\frac{\frac{27}{95}}{\frac{44}{443}} = \frac{27\times443}{95\times44}\approx2.9$. So the odds of B=1$B=1$ is almost three times larger for the group $A$=1$A=1$ compared to the group $A$=0$A=0$. Taking the log of the odds ratio will give is $\beta_1$, in this case approximately $1.1$

These manual computation were possible because this is a so called saturated model; the model will exactly reproduce the cell counts. If, for example, we added a second explanatory variable but not the interaction, then this would no longer be a saturated model, and we would have to use an iterative algorithm to find the maximum likelihood estimates of the parameters.

In your question you referred to just using $A$, and shown the marginal distribution of $A$. That would be equivalent to a logistic regression with only a constant and no explanatory variables. This too is a saturated model, and the constant in that model is the log of the odds you estimated.

You need to choose whether $A$ or $B$ is your dependent/explained/left-hand-side/y-variable. Lets say $B$ is the variable you want to explain, and $A$ is the variable with which you explain $B$. So now you can write the regression as:

$\ln(Odds(B=1|A))= \beta_0+\beta_1A$

So $\beta_0$ is a constant, so it is the log odds of $B$ being 1 when all x-variables (in this case just $A$) equal 0. The odds is the number of successes per failure, which in your example is $\frac{44}{443}\approx0.10$. Taking the log of that will give us $\beta_0$, which for your table is approximately $-2.3$.

$\beta_1$ is the log odds ratio. The odds ratio is, as the name suggest, a ratio of odds. It answers the question, by what factor does the odds change for a unit increase in $x$. The odds was $\frac{44}{443}$ when $A$ was 0, and the odds is $\frac{27}{95}$ when $A$ is 1, so odds changes by a factor $\frac{\frac{27}{95}}{\frac{44}{443}} = \frac{27\times443}{95\times44}\approx2.9$. So the odds of B=1 is almost three times larger for the group $A$=1 compared to the group $A$=0. Taking the log of the odds ratio will give is $\beta_1$, in this case approximately $1.1$

These manual computation were possible because this is a so called saturated model; the model will exactly reproduce the cell counts. If, for example, we added a second explanatory variable but not the interaction, then this would no longer be a saturated model, and we would have to use an iterative algorithm to find the maximum likelihood estimates of the parameters.

In your question you referred to just using $A$, and shown the marginal distribution of $A$. That would be equivalent to a logistic regression with only a constant and no explanatory variables. This too is a saturated model, and the constant in that model is the log of the odds you estimated.

You need to choose whether $A$ or $B$ is your dependent/explained/left-hand-side/$y$-variable. Let's say $B$ is the variable you want to explain, and $A$ is the variable with which you explain $B$. So now you can write the regression as:

$\ln(Odds(B=1|A))= \beta_0+\beta_1A$

So $\beta_0$ is a constant, so it is the log odds of $B$ being 1 when all $x$-variables (in this case just $A$) equal 0. The odds is the number of successes per failure, which in your example is $\frac{44}{443}\approx0.10$. Taking the log of that will give us $\beta_0$, which for your table is approximately $-2.3$.

$\beta_1$ is the log odds ratio. The odds ratio is, as the name suggest, a ratio of odds. It answers the question, by what factor does the odds change for a unit increase in $x$. The odds was $\frac{44}{443}$ when $A$ was 0, and the odds is $\frac{27}{95}$ when $A$ is 1, so odds changes by a factor $\frac{\frac{27}{95}}{\frac{44}{443}} = \frac{27\times443}{95\times44}\approx2.9$. So the odds of $B=1$ is almost three times larger for the group $A=1$ compared to the group $A=0$. Taking the log of the odds ratio will give is $\beta_1$, in this case approximately $1.1$

These manual computation were possible because this is a so called saturated model; the model will exactly reproduce the cell counts. If, for example, we added a second explanatory variable but not the interaction, then this would no longer be a saturated model, and we would have to use an iterative algorithm to find the maximum likelihood estimates of the parameters.

In your question you referred to just using $A$, and shown the marginal distribution of $A$. That would be equivalent to a logistic regression with only a constant and no explanatory variables. This too is a saturated model, and the constant in that model is the log of the odds you estimated.

Source Link
Maarten Buis
  • 21.5k
  • 37
  • 65

You need to choose whether $A$ or $B$ is your dependent/explained/left-hand-side/y-variable. Lets say $B$ is the variable you want to explain, and $A$ is the variable with which you explain $B$. So now you can write the regression as:

$\ln(Odds(B=1|A))= \beta_0+\beta_1A$

So $\beta_0$ is a constant, so it is the log odds of $B$ being 1 when all x-variables (in this case just $A$) equal 0. The odds is the number of successes per failure, which in your example is $\frac{44}{443}\approx0.10$. Taking the log of that will give us $\beta_0$, which for your table is approximately $-2.3$.

$\beta_1$ is the log odds ratio. The odds ratio is, as the name suggest, a ratio of odds. It answers the question, by what factor does the odds change for a unit increase in $x$. The odds was $\frac{44}{443}$ when $A$ was 0, and the odds is $\frac{27}{95}$ when $A$ is 1, so odds changes by a factor $\frac{\frac{27}{95}}{\frac{44}{443}} = \frac{27\times443}{95\times44}\approx2.9$. So the odds of B=1 is almost three times larger for the group $A$=1 compared to the group $A$=0. Taking the log of the odds ratio will give is $\beta_1$, in this case approximately $1.1$

These manual computation were possible because this is a so called saturated model; the model will exactly reproduce the cell counts. If, for example, we added a second explanatory variable but not the interaction, then this would no longer be a saturated model, and we would have to use an iterative algorithm to find the maximum likelihood estimates of the parameters.

In your question you referred to just using $A$, and shown the marginal distribution of $A$. That would be equivalent to a logistic regression with only a constant and no explanatory variables. This too is a saturated model, and the constant in that model is the log of the odds you estimated.