Announcement

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

  • STATA Logistic Regression Coefficient Plot Not Working?

    Good Day all!
    I need some urgent help because I can't seem to understand why my coefficient plot seems to be wrong.

    The first two photos show the 2 logistic regressions I am trying to plot on the coefficient plot. For each IV which measures my DV, there is a dummy (base) variable, for which the value is 1 as it is an odds ratio. Now, when I plot this using the following code:
    logistic occupbin i.educat age i.incomecat, baselevels
    estimates store occupbin
    logistic classpercbin i.educat age i.incomecat, baselevels
    estimates store classpercbin
    coefplot (occupbin, label(Objective Social Class)) (classpercbin, label(Subjective Social Class)), drop(_cons) xline(1) baselevels

    I get the graph in the third picture. I am incredibly confused because the base variables are at 1, and the information displayed on this graph does not match the information on the tables (Pictures 1 and 2) at all. Am I doing something wrong?


    I don't know why this is happening, and it has been a reoccurring issue. Thank you for taking the time to read this and I hope to get a response quickly!Click image for larger version

Name:	Screenshot 2021-05-14 at 04.34.53.png
Views:	1
Size:	151.9 KB
ID:	1609506 Click image for larger version

Name:	Screenshot 2021-05-14 at 04.34.47.png
Views:	1
Size:	173.2 KB
ID:	1609507 Click image for larger version

Name:	Screenshot 2021-05-14 at 04.37.13.png
Views:	1
Size:	160.0 KB
ID:	1609508
    Last edited by Aarushi Jain; 13 May 2021, 17:17.

  • #2
    It's showing the results of -logit- rather than -logistic-. If you wish to show the odds ratios in the graph, add the option -eform- as one of the options in the -coefplot- command. If you do not like the resultant confidence intervals being so asymmetric, add another option -xscale(log)- to covert the axis to log scale.
    Last edited by Ken Chui; 13 May 2021, 18:19.

    Comment


    • #3
      Ken Chui Thank you so much for all your help and efforts! I greatly appreciate it. My graph is showing exactly what I need it to.

      Comment

      Working...
      X