Announcement

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

  • Adjust for variables in logistic regression

    Dear stata users,

    I am fairly new to working with stata so I hope I can find some answers from experts in this forum!

    I am currently working with a survey sample with approx. 19.000 observations, the data was collected online across different countries.
    We want to do a binary logistic regression (dependent Variable coded as 0 and 1) with several independent variables (categorical and continous).
    I would like to adjust the model for variables such as country etc.

    Do I simply add the adjustment variables in the "logistic" command as independent variables in the model? Is there another way to adjust in a binary logistic regression?

    Thank you in advance

  • #2
    Eirin:
    welcome to this forum.
    Some comments about your query:
    - use the -svy:- prefix (see -help svy-) if your data were obtained from a survey;
    - the only way to add predictors is to put them in the right-hand side of the regression equation.
    If your predictors are categorical variables and/or interactions, take a look at -fvvarlist- (see (-help fvvarlist-).
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,

      thank you for the quick response!

      So would it be correct (after defining survey settings) to command

      svy: logistic dreaming i.Finance i.Household i.Maritalstatus i.gender c.age

      if my dependent variable is dreaming, my independent variables are Finance, Household and Maritalstatus and my adjustment variables are gender and age? (as an example)
      Or do i need to specify the adjustment variables in another way?

      Thank you

      Comment


      • #4
        Erin:
        regardless my wonder about entering -dreaming- as a regressand (please consider it as an amateur's comment), your code (that you could have better reported using CODE delimiters, though. Please, see the FAQ on that. Thanks):
        Code:
        svy: logistic dreaming i.Finance i.Household i.Maritalstatus i.gender c.age
        , your code makes sense: the right-hand side of your regression equation should contain both predictors and controls.
        You also used the -fvvarlist- notation the right way (and that is laudable for a self-reported Stata newbie).
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Thank you very much for your help!

          Comment

          Working...
          X