Zero Inflated Models in R with Flexplot

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

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

  • @nl7247
    @nl7247 3 дня назад

    Thank you for Flexplot and your videos ❤

  • @trini-rt6xn
    @trini-rt6xn 5 дней назад +1

    Very interesting, and this is my first encounter with Zero Inflated Models. 👏
    It's always helpful to listen to how you think aloud, and how you approach analyzing new datasets. 👍
    Keep up the good work! ✨

  • @derekcaramella8730
    @derekcaramella8730 5 дней назад +1

    Fantastic topic!

  • @galenseilis5971
    @galenseilis5971 5 дней назад +1

    There are multiple approaches out there for specifying models that deal with zero-inflated data. Some of them are equivalent.
    The following is a formulation I have used in a Bayesian probabilistic modelling approach:
    ```
    B ~ Normal(0, 1) # Intercept parameter; std normal prior
    log(P) = + B # relationship between linear model and mixing probability; coefficients need priors
    Q ~ Bernoulli(P) # Indicator of being in zero-only subpopulation
    R ~ Exponential(1) # Rate parameter prior
    W ~ Beta(2, 2) # "success probability" prior
    X ~ NB(R, W) # Count from second population; sometimes zeroes occur here too. This may be interpreted as a counterfactual when Q=1.
    Y = (1 - Q) * X # Count from either population
    ```
    Priors can be readily changed according to background knowledge. Some implementations allow for improper priors if desired. Just about any part this model can be modified or extended depending on the modelling problem.
    The above model is a mixture distribution. There are other approaches that work on a wider space of problems, but this is one of the simple starting points that I have found effective.

  • @dangernoodle2868
    @dangernoodle2868 5 дней назад

    Is there an analogue for flexplot in Python? I've found ways to use R more at work, but I'm hesitant to make the switch because that's not what most people are using.

  • @Martin-lp4eu
    @Martin-lp4eu 4 дня назад

    Thank you for an amazing video!
    I tried following with my own data but i got stuck on the estimates part. Basically i throws an error when i try to use the function on the zeroinfl object. I tried the development version of flexplot as well. In the video there is a cut, so I guess you had similar problem, but you dont show how you fixed it.

    • @QuantPsych
      @QuantPsych  4 дня назад

      When did you last update flexplot? I just recently fixed things, but not in the development version.

    • @Martin-lp4eu
      @Martin-lp4eu 4 дня назад

      @@QuantPsych I have just reinstalled stable version of flexplot and it still does not work.

    • @Martin-lp4eu
      @Martin-lp4eu 4 дня назад

      @@QuantPsych Error in as.data.frame.default(x[[i]], optional = TRUE) : cannot coerce class ‘"function"’ to a data.frame is the error i get

  • @tagheuer001
    @tagheuer001 5 дней назад +1

    This channel's ego is zero inflated :) Traffic accident data is where I first came across zero inflated data.

    • @QuantPsych
      @QuantPsych  3 дня назад

      I'm not sure if that's a compliment or an insult...but...thank you?

    • @tagheuer001
      @tagheuer001 3 дня назад +1

      @@QuantPsych 100% compliment. Your model-first/early after visual inspection helped confirm a gut feeling that I never found any supportive evidence for. Also, lmer/glmer capabilities are still truly underestimated by big "AI-everything" consulting firms that default an an ML or NN solution for every problem.