ORDERED LOGIT & PROBIT REGRESSION IN R!!! #2.1

Поделиться
HTML-код
  • Опубликовано: 28 янв 2025

Комментарии • 32

  • @xtxpxhx
    @xtxpxhx 2 года назад +2

    oh this was great thank you much!

    • @qssd
      @qssd  2 года назад +1

      You're so welcome!

  • @gabriellamartinez7985
    @gabriellamartinez7985 3 года назад +2

    Hello thank you for this video, its been super helpful!
    I have a question regarding the dependent variables. How would you interpret the polr function output for dependent variables that are factors? For example, if RefvotDum was a factor with the same 0, 1 levels or No, Yes levels, how would you interpret the coefficients in that case?

    • @patric001122
      @patric001122 3 года назад +1

      I also would like to know, how to interpret the coefficients. Can I just use the "(exp(model.1$coefficients[-1])" command to get the odds-ratio? is there an opportunity how I could get the marginal effects? And is it also valid to use the "scale()" command to standardize the coefficients?
      Thank you very much for your videos, they helped a lot!

    • @qssd
      @qssd  3 года назад

      Yeah, sorry, I haven't had time to create new videos on the interpretations. To get polr to run with a factor outcome variable, you need to classify it as ordered (e.g., as.ordered(as.factor()) ). The interpretations, though, should be the same for a numeric or ordered factor outcome variables.

    • @qssd
      @qssd  3 года назад

      Yes, you can use the same code for the odds ratio. The difference for interpretation from the binary logit is that the odds need to be discussed as 'more', 'increased, 'greater', etc. instead of a specific outcome. This is b/c ordered logit uses cumulative odds ratio and so the odds value is the cumulative odds of a lower to higher outcome. For example, 'for a one-unit increase in education, the odds of *greater/increased/more* trust increases by a factor of.....
      I don't usually work with marginal effects, but there is a lot you can do with predicted probabilities.
      You should be able to use the scale() function, but I haven't thought through the impact on the interpretations...
      Thanks.

    • @patric001122
      @patric001122 3 года назад

      @@qssd Thank you so much for the fast answer, it helped a lot!

    • @qssd
      @qssd  3 года назад

      Welcome!

  • @SamLloydClimbing
    @SamLloydClimbing 4 года назад +4

    Hi! This is a great video, I found your whole series very helpful. Are you still planning on releasing further videos in this series? Thanks :)

    • @qssd
      @qssd  4 года назад +1

      Hi! sorry. I'm hoping to do more.......been busy.

  • @crahul1987
    @crahul1987 3 года назад +1

    Very nice....can you please upload the second part?

    • @qssd
      @qssd  3 года назад

      Thanks! Sorry for a delayed response. I haven't had the time to create more of the videos, unfortunately.

  • @yanganontu4059
    @yanganontu4059 3 года назад

    Hi Brian really appreciate your work in my research i would like to measure the contribution of household food insecurity access scale which have discrete depended variables to beekeeping participation. can i use ordered probit model or ordered logit which one is better of?

    • @qssd
      @qssd  3 года назад

      Thanks! Sorry for the delay. If the dependent variable is ordinal, then either ordered logit or probit work equally well. There is no real difference. The choice is usually what you prefer like the choice between binary logit or probit. The one caveat is that, obviously, if you use ordered probit then you can't use odds ratios for interpretations.

  • @supradg
    @supradg 2 года назад

    Why do not make the Education and Scottish Identity as (ordered) categorical variables? I think that we cannot change these by 1 percentage point, for example? Does making them numeric make sense?

    • @qssd
      @qssd  2 года назад

      You could make them explicitly ordered categorical or numeric. Here, you will get the same regression coefficients with either.

    • @kasberge7164
      @kasberge7164 2 года назад

      @@qssd strictly speaking, you would have to recode them into dummies to include them in a regression model as independent variables, or not? You are treating them as numeric, which I don't get- is this accepted as a quantitative social science practice`?

    • @qssd
      @qssd  2 года назад +1

      @@kasberge7164 You would only dummy them if they are nominal-level variables. Edu and scot id are ordinal-level variables, so the simplest option is treating them as numeric. You would only recode them as dummies if wanted to create a new version(s) of the variable -- for example, scotID = 7 (so, '1' in a dummy) vs. scotID=1-6 (so, '0' in a dummy).

  • @ИвановИван-л1р
    @ИвановИван-л1р 4 года назад

    Hi thanks for the video, but can we recode the dependent variable , as 0.5, 1, 1.5 for instance by ordered(factor) function?

    • @qssd
      @qssd  4 года назад

      Yes, you can. As long as the differences are 1-unit, the coefficient should remain the same.

  • @Mattee77
    @Mattee77 3 года назад

    Hi, several econometrics books states that you cannot interpret Pseudo R2 similar to OLS R2 since they both have different forms of error terms. Pseudo R2 presented should be taken with a grain of salt. Aside from that, good tutorial on R! thanks!

    • @qssd
      @qssd  2 года назад

      Yes, you are right. Pseudo R2 is based on log-likelihood values.

  • @thejuhulikal6290
    @thejuhulikal6290 4 года назад

    hi, thank you for video, can u please upload the r file

    • @qssd
      @qssd  4 года назад +1

      Sorry for the delayed response. Do you mean the R code script? If yes, then sorry I don't give out the scripts - even when I'm teaching. The reason is that people learn and understand the code much better when typing it themselves instead of just running existing scripts. Even if they are just copying existing code, the practice of typing it in helps cement it in people's minds. Not trying to be mean - it is just a pedagogical tool. Thx.

    • @thejuhulikal6290
      @thejuhulikal6290 4 года назад +1

      @@qssd that was not mean... Thank u

  • @bio303
    @bio303 5 лет назад

    Hi! Thanks for your video, it was great. Can you tell me why you used as.numeric instead of as.factor for your other variables?

    • @qssd
      @qssd  5 лет назад

      Hi. If you do as.factor then they are treated a nominal-level variables and get automatically dummied out. Two are ordinal variables and so we set them as.numeric

    • @jannikx7924
      @jannikx7924 4 года назад

      @@qssd Hi, great video, but I don't get the point. trust in the government is also an ordinal variable, but you use as.factor for this variable.

    • @kash7718
      @kash7718 4 года назад

      @@jannikx7924 I have the same question, can you please respond @Quantitative Social Science Data Analysis ! Thank you :)

  • @mdtanimhasan3312
    @mdtanimhasan3312 4 года назад

    Hello, your video was really helpful.
    Could you please explain how to interpret the outcome of the dependent variable combined with |
    For example here is the summary and p-value of my model, I am struggling to interpreter the dependent variable outcome, TIA.
    Coefficients:
    Value Std. Error t value
    H 0.10955 0.06687 1.6381
    AGR 0.05929 0.06825 0.8687
    NP2 -1.00909 0.30407 -3.3186
    NP3 -1.69956 0.40289 -4.2184
    NP4 -0.28106 0.44589 -0.6303
    Intercepts:
    Value Std. Error t value
    1|2 -1.1571 0.6301 -1.8363
    2|3 -0.0505 0.6090 -0.0829
    3|4 0.9036 0.6022 1.5005
    4|5 2.2627 0.7164 3.1584
    5|6 5.1148 1.5859 3.2253
    6|7 16.5213 9.1049 1.8145
    Residual Deviance: 631.3888
    AIC: 653.3888
    Value Std. Error t value p-value
    H 0.10954539 0.06687426 1.6380799 0.1014
    AGR 0.05928751 0.06825109 0.8686676 0.3850
    NP2 -1.00909459 0.30407139 -3.3186107 0.0009
    NP3 -1.69956102 0.40288860 -4.2184390 0.0000
    NP4 -0.28105858 0.44589078 -0.6303306 0.5285
    1|2 -1.15712803 0.63014735 -1.8362817 0.0663
    2|3 -0.05048673 0.60902379 -0.0828978 0.9339
    3|4 0.90356996 0.60219631 1.5004575 0.1335
    4|5 2.26273192 0.71641548 3.1584073 0.0016
    5|6 5.11484231 1.58585762 3.2252847 0.0013
    6|7 16.52126027 9.10488998 1.8145480 0.0696

    • @qssd
      @qssd  4 года назад +1

      Hi! Thanks!
      I assume that you are looking to use the cut-points ( | ) to get individual-type predicted probabilities? You can do this by-hand using the ilogit() function from the faraway R package (which goes with his book). But, it is easier to create a new data frame with your values of interest and then use the predict() function. For example,
      First, I select the individual type based on the predictors:
      newdata = data.frame(Refvotedum=0, scot=1, education=1)
      Then get the predicted probabilities based on the model run.
      predict(model.1, newdata, type="probs")
      This will then give you the predicted probabilities for each outcome of the DV for that type.
      Hopefully I'll finally have time to get to adding more of these vids. Thanks for watching and for your question!

    • @mdtanimhasan3312
      @mdtanimhasan3312 4 года назад +1

      @@qssd Thank you :)