Announcement

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

  • graph the predicted probability

    Hi guys!

    I am totally new with statistics, just started to learn using Stata. On the last class we were learning about linear regressions, predicted probability, logit, margins etc. I am trying to practice but it doesn`t go very well. So before we made this:

    /*Graph the predicted probability of Pi with/without a confidence interval*/
    quietly logit grade gpa tuce i.psi
    margins psi, at(gpa = (2(.1)4) ) atmeans
    marginsplot, noci scheme(sj) xtitle("GPA") ytitle("Pr(Y=1)") ///
    title("Predicted Probability of Getting An A")

    quietly logit grade gpa tuce i.psi
    quietly margins psi, at(gpa = (2(.1)4) ) atmeans
    marginsplot, scheme(sj) xtitle("GPA") ytitle("Pr(Y=1)") ///
    title("Predicted Probability of Getting An A")

    I tried to copy these commands to solve an excercise, but it doesn`t really work, can you help make write the right command for these (happymar, female, educ)

    1.predicted probability of marital happiness for the female and male over
    various years of education (set church=1).

    2. substantive effect of gender on the predicted probability
    of marital happiness over various years of education (set church=1).

  • #2
    "It doesn't really work" does not tell us much. You need to tell us exactly what you did, what did happen (e.g. error messages), and why you believe that this is not correct. Put yourself in our position: We see commands that are correct combined with your claim that it did not work. How can we say anything useful?

    I actually do have a suspicion: I suspect that you pasted this code in the command line window and you got an error message like "/ is not a valid command name" or "option / not allowed". If that is the case, then tell us so we can tell you what the solution is.

    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      I found that basic commands for predicted probability which I posted above, but not sure how to fill it with my own datas:

      //
      quietly logit happymar i.female educ
      margins ?, at( ? ) atmeans
      marginsplot, ?
      title("Predicted Probability")

      //

      happymar, educ, female

      1.predicted probability of marital happiness for the female and male over
      various years of education (set church=1).

      2. substantive effect of gender on the predicted probability
      of marital happiness over various years of education (set church=1).

      Comment

      Working...
      X