Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Differences in number of observations when adding vars in logistic model

    Hi all,

    I am currently having trouble deciphering why I am receiving a difference in # of observations whenever I add additional variables to the model. I have attached a document below for reference. Please let me know if you need additional information. Thanks so much in advance!
    Attached Files

  • #2
    Gadri:
    how many missing values are detected in -femdom-?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Gadri:
      how many missing values are detected in -femdom-?
      Hi Carlo,
      Attached is the tabulations/sum of the variables. I'm trying to figure out how to run a model with the exact same observations across the board regardless of how many variables I input. I'm not sure where I am going wrong.
      Attached Files

      Comment


      • #4
        Originally posted by Carlo Lazzaro View Post
        Gadri:
        how many missing values are detected in -femdom-?
        Here is the current logit model for reference
        Attached Files

        Comment


        • #5
          Gadri:
          Stata applies the listwise deletion to avoid problems when calculating the VCE matrix.
          Therefore, the only way to fix your issue is to avoid having missing values in any of the variables that appear in your logistic regression.
          As an aside, please follow the FAQ and use CODE delimiters instead of screenshots when sharing what you typed and what Stata gave you back. Thanks.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Originally posted by Carlo Lazzaro View Post
            Gadri:
            Stata applies the listwise deletion to avoid problems when calculating the VCE matrix.
            Therefore, the only way to fix your issue is to avoid having missing values in any of the variables that appear in your logistic regression.
            As an aside, please follow the FAQ and use CODE delimiters instead of screenshots when sharing what you typed and what Stata gave you back. Thanks.
            Hi Carlo,
            Thank you for the information. How would I make sure that the variables I include do not have missing values? That is, what is the easiest or most direct way to do so?

            Thank you for letting me know about the CODE delimiters instead of screenshots!

            Comment


            • #7
              Gadri:
              I usually follow this two-step procedure:
              Code:
              . use "C:\Program Files\Stata18\ado\base\a\auto.dta"
              (1978 automobile data)
              
              . sum
              
                  Variable |        Obs        Mean    Std. dev.       Min        Max
              -------------+---------------------------------------------------------
                      make |          0
                     price |         74    6165.257    2949.496       3291      15906
                       mpg |         74     21.2973    5.785503         12         41
                     rep78 |         69    3.405797    .9899323          1          5
                  headroom |         74    2.993243    .8459948        1.5          5
              -------------+---------------------------------------------------------
                     trunk |         74    13.75676    4.277404          5         23
                    weight |         74    3019.459    777.1936       1760       4840
                    length |         74    187.9324    22.26634        142        233
                      turn |         74    39.64865    4.399354         31         51
              displacement |         74    197.2973    91.83722         79        425
              -------------+---------------------------------------------------------
                gear_ratio |         74    3.014865    .4562871       2.19       3.89
                   foreign |         74    .2972973    .4601885          0          1
              
              . codebook rep78
              
              -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
              rep78                                                                                                                                                        Repair record 1978
              -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
              
                                Type: Numeric (int)
              
                               Range: [1,5]                         Units: 1
                       Unique values: 5                         Missing .: 5/74
              
                          Tabulation: Freq.  Value
                                          2  1
                                          8  2
                                         30  3
                                         18  4
                                         11  5
                                          5  .
              
              .
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment

              Working...
              X