Announcement

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

  • How to get an overall p-value for an independent categorical variable using binary logistic regression ?

    Hello,

    I would like to know how to get an overall p-value for an independent categorical variable using binary logistic regression ? When I run the binary logistic regression model I just get p-values for each group of the categorical variable, instead an overall p-value for the variable itself...

    Could somebody help me???

    Thank you very much!

  • #2
    assuming you used factor variable notation (if not, you should - see "help fvvarlist"), then here is an example using the auto data
    Code:
    sysuse auto, clear
    logistic foreign i.rep78
    testparm i.rep78

    Comment


    • #3
      It would have been more helpful to show us the exact command(s) you are using and the output you got from Stata. It isn't entirely clear what you mean. But I'm going to assume that you have a dichotomous outcome variable, and a categorical predictor with more than 2 levels. If you didn't have any other predictor variables in your model, you can look at the header that precedes the coefficient table in your output. There will be a line showing the LR chi2 and the Prob > chi2. These constitute a likelihood-ratio test of the model, and the latter statistic is the p-value. Since the model consists only of your predictor of interest, that is all you need.

      If you do have other predictors in your model, then the test of the model as a whole is not a test of your categorical variable. You can proceed in two ways.

      Code:
      logistic outcome i.predictor_of_interest other_variables
      estimates store full
      logistic outcome other_variables if e(sample)
      lrtest full .
      will give you a likelihood ratio test of your predictor of interest.

      Or, you can do a Wald test:
      Code:
      logistic outcome i.predictor_of_interest other_variables
      levelsof predictor_of_interest if e(sample), local(levels)
      testparm i(`levels').predictor_of_interest
      Last edited by Clyde Schechter; 01 Dec 2015, 09:40.

      Comment

      Working...
      X