Answers.Body: <p>Its a while since I've done GLM because ML is the method of choice.</p>
  <p><strong>Question1</strong> Yes multi-linear regression is an approximate description of GLM.</p>
  <p><em>Generally</em> the weights simply mean whether a feature is positively or negatively associated with the phenomena. It's important to be sure it's the right way around (negatives and positives can flip, if that makes sense).</p>
  <p><code>suppl1</code> is significantly and relatively strongly associated with symptoms, whilst <code>L</code> and <code>Q</code> <code>vitamin</code> levels appear to have some <em>protective</em> effects.
  <code>Suppl1</code> has a dose dependent effect with <code>L</code> and <code>Q</code> having a lower correlation with the observed symptoms.</p>
  <p>The dose dependency result therefore confirm suppl1 as associated with the symptoms. In all cases levels <code>C</code> are not significant, I assume this is a low level supplement.</p>
  <p><strong>Summary</strong> <code>vitx_levels</code> appear to have some protective effect.</p>
  <p>I do stress it is important to ensure the &quot;negative versus positive&quot; is the right way round. The residual is important and I suspect you've omitted this in the GLM. The lower the residual the better the fit of the model.</p>
  <p>BTW LD is different from GLM although they are related (title versus body of the question).</p>
  <p><strong>Question 2</strong> Yes that is correct <code>0.9822 * 1</code> I assume you mean <code>0.9822 * suppl1</code> ... However all <code>C</code> weights are not significant, so you could omit them.</p>
  <hr />
  <p>residual versus intercept ... I'm pretty certain that these are the same thing (its the <em>c</em> variable) and the intercept here appears quite large.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-10T21:18:21.630Z
Answers.Text: I am very grateful for your very elaborate response. I wish to ask what are the possible values `vitx_levels.L` or `vitx_levels.Q` could take in the equation below            ```y <- -2.7816 + 0.9822 * suppl1 - 0.1751 * vitx_levels.L - 0.1537 * vitx_levels.Q + 0.0164 * vitx_levels.C +  0.16821 * suppl1:vitx_levels.L + 0.2433 * suppl1:vitx_levels.Q - 0.0096 * suppl1:vitx_levels.C```. For example, let us say I have a `x=2` could I say for the ` vitx_levels.Q`  term in the equation above that  `vitx_levels.Q`  = `x^2` since  `vitx_levels.Q`  is the quadratic term?
Answers.UserDisplayName: Charles
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-10T21:31:55.117Z
Answers.Text: @Charles Yes its predictive model
Answers.UserDisplayName: M__
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-10T18:02:12.363Z
Answers.LastActivityDate: 2023-11-10T18:57:16.277Z
Answers.LastEditDate: 2023-11-10T18:57:16.277Z
Answers.UserDisplayName: M__
Body: <p>Can someone help hint me how I can interpret ordinal logistic regression coefficients and how I can use the .L, .Q and .C terms to calculate probabilities? I am analysing a dataset, where people complain of chest or not pain when they receive external supplements for a vitamin X or not. so I performed a logistic regression, using categorized and ordered (so it is an ordinal categorical variable) values of vitamin X from these observations. So I have grouped these vitamin X values within my data as very low, sub-optimal, optimal and high values and ordered that way.</p>
  <p>The data are as such:</p>
  <p>chest_pain_status: binary, 0 means not having chest pain, 1 means having chest pain</p>
  <p>suppl = binary, 0 means not supplementing and 1 means supplementing</p>
  <p>vitx_levels: very_low &lt; suboptimal &lt; optimal&lt; high</p>
  <p>My approach is as follows:</p>
  <pre class="lang-r prettyprint-override"><code>mod &lt;- glm(chest_pain_status ~ suppl*vitx_levels, dataset = data,family = binomial())
  
  summary(mod)
                          Estimate       std.Error     z value          Pr( &lt;|z|)
  (intercept)             -2.7816        0.2993        -9.2927          0.000
  suppl1                   0.9822        0.3209         3.0803          0.0021
  vitx_levels.L           -0.1751        0.0634        -2.7391          0.0062
  vitx_levels.Q           -0.1537        0.0552        -2.7689          0.0053
  vitx_levels.C            0.0164        0.0460         0.3579          0.7203
  suppl1:vitx_levels.L     0.16821       0.0739         2.7472          0.0229
  suppl1:vitx_levels.Q     0.2433        0.0641         3.7932          0.00015
  suppl1:vitx_levels.C    -0.0096        0.0537        -0.1787          0.8582
  </code></pre>
  <p><strong>Question1</strong>: Please how do I interpret coefficients of <code>vitx_levels.L</code>, <code>vitx_levels.Q</code> and <code>vitx_levels.C</code>? From my googling I can understand that R tries to test linear, quadratic and cubic relationships between <code>vitx_levels</code> and the log odds ratios of developing chest pain. It therefore means that there is a significant linear and negative relationship between <code>vitx_levels</code> and <code>chest_pain</code>. Same for the quadratic term. I hope I interpreted it right? Any additional ideas?</p>
  <p><strong>Question2</strong>: What values could I substitute in to <code>vitx_levels.L</code>, <code>vitx_levels.Q</code> and <code>vitx_levels.C</code> If I wanted to create a formula like the one below where I will later transform y to get probabilities:</p>
  <pre class="lang-r prettyprint-override"><code>y &lt;- -2.7816 + 0.9822 * suppl1 - 0.1751 * vitx_levels.L - 0.1537 * vitx_levels.Q + 0.0164 * vitx_levels.C +  0.16821 * suppl1:vitx_levels.L + 0.2433 * suppl1:vitx_levels.Q - 0.0096 * suppl1:vitx_levels.C
  </code></pre>
  <p>So for the function above, what values could I fit into <code>vitx_levels.L</code>, <code>vitx_levels.Q</code> and <code>vitx_levels.C</code> to be able to compute the value of y?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-11-10T03:41:25.123Z
Comments.Text: Which way around are the coefficients? Is the control first or the diseased patients first? Where's the coefficient for chest pain - it's in your equation but not in the output? I assume "intercept" is the residual is that right?
Comments.UserDisplayName: M__
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-11-10T11:34:32.840Z
Comments.Text: @M__. Thanks for your attention. Chest pain is the outcome and would not have a coefficient. Intercept is not the residual.
Comments.UserDisplayName: Charles
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-11-10T14:01:31.243Z
Comments.Text: Yes of course - thanks. Where is the residual (every GLM should have one)?
Comments.UserDisplayName: M__
Tags: <r><ggplot2><machine-learning>
Title: Intepreting and applying ordinal logistic regression coefficients to calculate probabilities?
ThreadText: # Intepreting and applying ordinal logistic regression coefficients to calculate probabilities?
  
  (Asked by: username_0 on 2023-11-09)
  
  Can someone help hint me how I can interpret ordinal logistic regression coefficients and how I can use the .L, .Q and .C terms to calculate probabilities? I am analysing a dataset, where people complain of chest or not pain when they receive external supplements for a vitamin X or not. so I performed a logistic regression, using categorized and ordered (so it is an ordinal categorical variable) values of vitamin X from these observations. So I have grouped these vitamin X values within my data as very low, sub-optimal, optimal and high values and ordered that way.
  
  The data are as such:
  
  chest\_pain\_status: binary, 0 means not having chest pain, 1 means having chest pain
  
  suppl = binary, 0 means not supplementing and 1 means supplementing
  
  vitx\_levels: very\_low < suboptimal < optimal< high
  
  My approach is as follows:
  
  ```r
  mod <- glm(chest_pain_status ~ suppl*vitx_levels, dataset = data,family = binomial())
  
  summary(mod)
                          Estimate       std.Error     z value          Pr( <|z|)
  (intercept)             -2.7816        0.2993        -9.2927          0.000
  suppl1                   0.9822        0.3209         3.0803          0.0021
  vitx_levels.L           -0.1751        0.0634        -2.7391          0.0062
  vitx_levels.Q           -0.1537        0.0552        -2.7689          0.0053
  vitx_levels.C            0.0164        0.0460         0.3579          0.7203
  suppl1:vitx_levels.L     0.16821       0.0739         2.7472          0.0229
  suppl1:vitx_levels.Q     0.2433        0.0641         3.7932          0.00015
  suppl1:vitx_levels.C    -0.0096        0.0537        -0.1787          0.8582
  
  ```
  
  **Question1**: Please how do I interpret coefficients of `vitx_levels.L`, `vitx_levels.Q` and `vitx_levels.C`? From my googling I can understand that R tries to test linear, quadratic and cubic relationships between `vitx_levels` and the log odds ratios of developing chest pain. It therefore means that there is a significant linear and negative relationship between `vitx_levels` and `chest_pain`. Same for the quadratic term. I hope I interpreted it right? Any additional ideas?
  
  **Question2**: What values could I substitute in to `vitx_levels.L`, `vitx_levels.Q` and `vitx_levels.C` If I wanted to create a formula like the one below where I will later transform y to get probabilities:
  
  ```r
  y <- -2.7816 + 0.9822 * suppl1 - 0.1751 * vitx_levels.L - 0.1537 * vitx_levels.Q + 0.0164 * vitx_levels.C +  0.16821 * suppl1:vitx_levels.L + 0.2433 * suppl1:vitx_levels.Q - 0.0096 * suppl1:vitx_levels.C
  
  ```
  
  So for the function above, what values could I fit into `vitx_levels.L`, `vitx_levels.Q` and `vitx_levels.C` to be able to compute the value of y?
  
  **Tags:** r, ggplot2, machine-learning
  
  > **Comments:**
  > **username_1**: Which way around are the coefficients? Is the control first or the diseased patients first? Where's the coefficient for chest pain - it's in your equation but not in the output? I assume "intercept" is the residual is that right?  
  > **username_0**: @username_1. Thanks for your attention. Chest pain is the outcome and would not have a coefficient. Intercept is not the residual.  
  > **username_1**: Yes of course - thanks. Where is the residual (every GLM should have one)?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-11-10. Score: 1
  
  Its a while since I've done GLM because ML is the method of choice.
  
  **Question1** Yes multi-linear regression is an approximate description of GLM.
  
  *Generally* the weights simply mean whether a feature is positively or negatively associated with the phenomena. It's important to be sure it's the right way around (negatives and positives can flip, if that makes sense).
  
  `suppl1` is significantly and relatively strongly associated with symptoms, whilst `L` and `Q` `vitamin` levels appear to have some *protective* effects.
  `Suppl1` has a dose dependent effect with `L` and `Q` having a lower correlation with the observed symptoms.
  
  The dose dependency result therefore confirm suppl1 as associated with the symptoms. In all cases levels `C` are not significant, I assume this is a low level supplement.
  
  **Summary** `vitx_levels` appear to have some protective effect.
  
  I do stress it is important to ensure the "negative versus positive" is the right way round. The residual is important and I suspect you've omitted this in the GLM. The lower the residual the better the fit of the model.
  
  BTW LD is different from GLM although they are related (title versus body of the question).
  
  **Question 2** Yes that is correct `0.9822 * 1` I assume you mean `0.9822 * suppl1` ... However all `C` weights are not significant, so you could omit them.
  
  ---
  
  residual versus intercept ... I'm pretty certain that these are the same thing (its the *c* variable) and the intercept here appears quite large.
  
  > **Comments:**
  > **username_0**: I am very grateful for your very elaborate response. I wish to ask what are the possible values `vitx_levels.L` or `vitx_levels.Q` could take in the equation below            ```y <- -2.7816 + 0.9822 * suppl1 - 0.1751 * vitx_levels.L - 0.1537 * vitx_levels.Q + 0.0164 * vitx_levels.C +  0.16821 * suppl1:vitx_levels.L + 0.2433 * suppl1:vitx_levels.Q - 0.0096 * suppl1:vitx_levels.C```. For example, let us say I have a `x=2` could I say for the ` vitx_levels.Q`  term in the equation above that  `vitx_levels.Q`  = `x^2` since  `vitx_levels.Q`  is the quadratic term?  
  > **username_1**: @username_0 Yes its predictive model  
  
  ---
  
  