Announcement

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

  • Binary values regression type

    Hi hello,

    This is my first time posting, so I hope I am doing this right and it is clear for everyone!

    I have a dataset where I have a variable that is called charitablegiving. The following responses were possible:

    -9 missing
    -8 inapplicable
    -7 proxy
    -2 refused
    -1 don't know
    1 at least once a week
    2 less than weekly, at least monthly
    3 less often than once a month
    97 other

    I created a dummy variable for people who indicated that they give at least once a week using the following code:
    gen chargaloaw = charitablegiving == 1 if charitablegiving > 0

    I did the same for the variable that indicated whether people had a diploma in higher education:
    gen diplhe = diploma == 3 if diploma > 0

    I checked if these were correct and the values were all good.

    The question I now have is, what type of regression would I use to see the relationship between having a diploma in higher education and donating at least once a week? I believe they are both binary variables now, so do I just use regress or maybe logit?

    Thanks in advance!

  • #2
    What's "97 Other"? It seems as if response categories 1 through 3 are mutually exclusive and collectively exhaustive.

    And category 3 includes not giving to charity at all. So I would recommend something more like an ordered categorical regression (-ologit-, -oprobit- etc.) after recoding the negative values and probably the 97 value to missing values usng -mvdecode-.

    Also, the -if diploma > 0- in your second dichotomization seems redundant. If that variable, too, has ordered categories of educational attainment, then maybe use them as-is, too (that is, use factor variable notation), and look at the regression coefficient for that category.

    Comment


    • #3
      Anyway, more to your specific objective, you could try something like the following. It illustrates the use of -mvdecode-. (It assumes that you don't want to include category 97 among the observations submitted to your regression command.)
      Code:
      mvdecode charitablegiving diploma, mv(-9=.m \ -8=.i \ -7=.p \ -2=.r \ -1=.d \ 97=.o)
      
      quietly generate byte chargaloaw = charitablegiving == 1 if !missing(charitablegiving)
      quietly generate byte diplhe = diploma == 3 if !missing(diploma)
      
      logit chargaloaw i.diplhe, nolog // For example
      
      // Also you might consider something like
      ologit charitablegiving i.diploma, nolog

      Comment

      Working...
      X