Answers.Body: <p>Are you sure this is linear regression? Gender is logistic regression, i.e. it's a boolean value. Really linear regression is y = mx + c, here this is multi-linear regression for age and bmi (GLM) and logistic regression for gender.</p>
  <p>I would simply choose one variable either age or bmi repeat the calculation and remove everything else. I minimise my R BTW favouring scipy and Pythons statsmodels.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-07T00:47:50.383Z
Answers.LastActivityDate: 2024-04-07T00:47:50.383Z
Answers.UserDisplayName: M__
Body: <p>I am trying to do linear regression using retinopathy as response and 342 proteins as predictor. the model should be adjusted for age, sex and BMI. There are no missing values for any variables.</p>
  <p>The model fitting was as follows...</p>
  <pre><code>mod_ret &lt;- lm(ret~x+sex+age+bmi, data = df)
  </code></pre>
  <p>while running summary I have got following results..</p>
  <p><a href="https://i.sstatic.net/WPYBD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/WPYBD.png" alt="summary(mod_ret)" /></a></p>
  <p>Can you please provide insight into why I am getting no statistics and how to resolve that? Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-07T12:25:34.420Z
Comments.Text: Please don't put screenshots of text into StackExchange posts. Copy the text and paste it into your post. Don't worry about how it looks; other people can fix that up if it looks weird and you don't know how to do that.
Comments.UserDisplayName: gringer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-07T21:26:51.493Z
Comments.Text: The intercept labels look odd; I'd usually expect a category name rather than a sample name. Can you show the first few lines of df? (e.g. `head(df)`)
Comments.UserDisplayName: gringer
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-05-14T18:07:51.497Z
Comments.Text: I suspect that you are treating age as a categorical variable rather than a numerical covariate. That would lead to the kinds of singularities due to overfitting on your categorical data- basically, you only have <=1 person in any given category due to the extreme sparsity when you treat age as categorical.
Comments.UserDisplayName: Maximilian Press
Tags: <r>
Title: Problems with NA's from linear regression using lm()
ThreadText: # Problems with NA's from linear regression using lm()
  
  (Asked by: username_0 on 2024-04-06)
  
  I am trying to do linear regression using retinopathy as response and 342 proteins as predictor. the model should be adjusted for age, sex and BMI. There are no missing values for any variables.
  
  The model fitting was as follows...
  
  ```
  mod_ret <- lm(ret~x+sex+age+bmi, data = df)
  
  ```
  
  while running summary I have got following results..
  
  [![summary(mod_ret)](https://i.sstatic.net/WPYBD.png)](https://i.sstatic.net/WPYBD.png)
  
  Can you please provide insight into why I am getting no statistics and how to resolve that? Thanks!
  
  **Tags:** r
  
  > **Comments:**
  > **username_1**: Please don't put screenshots of text into StackExchange posts. Copy the text and paste it into your post. Don't worry about how it looks; other people can fix that up if it looks weird and you don't know how to do that.  
  > **username_1**: The intercept labels look odd; I'd usually expect a category name rather than a sample name. Can you show the first few lines of df? (e.g. `head(df)`)  
  > **username_2**: I suspect that you are treating age as a categorical variable rather than a numerical covariate. That would lead to the kinds of singularities due to overfitting on your categorical data- basically, you only have <=1 person in any given category due to the extreme sparsity when you treat age as categorical.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2024-04-07. Score: 0
  
  Are you sure this is linear regression? Gender is logistic regression, i.e. it's a boolean value. Really linear regression is y = mx + c, here this is multi-linear regression for age and bmi (GLM) and logistic regression for gender.
  
  I would simply choose one variable either age or bmi repeat the calculation and remove everything else. I minimise my R BTW favouring scipy and Pythons statsmodels.
  
  
  ---
  
  