{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreidbluzr2mvvkhcz3jllhddhokx4ek2dqqk2gzjakhvgndka3lmuiu",
    "uri": "at://did:plc:wwyqal4cnqhuwyacdj7rqq3n/app.bsky.feed.post/3mlvbkjowi6x2"
  },
  "path": "/t/censored-binomial-models/28732#post_7",
  "publishedAt": "2026-05-15T09:36:25.000Z",
  "site": "https://discourse.datamethods.org",
  "tags": [
    "JAGS"
  ],
  "textContent": "Thanks for posting this very interesting problem, Ahmed. I made efforts toward a JAGS model for this, and have begun to think that it involves both truncation and censoring working together. (Surgeons for whom both A_i\\le 10 and B_i\\le 10 are truncated.)\n\nI wonder what people think of the likelihood I’ve assembled here. This looks like a good opportunity to make subtle mistakes!\n\n\n    var S,    # number of surgeons (S ≡ No + Na + Nb)\n        No,   # surgeons 1:No have both A and B counts observed\n        Na,   # surgeons No+(1:Na) have only A count observed\n        Nb,   # surgeons No+Na+(1:Nb) have only B count observed\n        a[S], # a[s] = probability surgeon s chooses A\n        N[S], # N[s] = true (poss. unk.) count of procedures for surgeon s\n        L[S], # for s in (No+1):S, equal to whichever of {A,B} is observed\n        A[S], # left-censored count of A procedures\n        B[S]; # left-censored count of B procedures\n\n    # We introduce L[No+1:S] simply to avoid RUNTIME ERROR\n    # 'Possible directed cycle' in the truncated-N blocks\n    # of the model.\n    data {\n      for (s in 1:No)         { L[s] = 0 }\n      for (s in No+(1:Na))    { L[s] = A[s] }\n      for (s in No+Na+(1:Nb)) { L[s] = B[s] }\n    }\n\n    model {\n      for (s in 1:S) {\n        a[s] ~ dbeta(0.8, 0.6) # bimodal, as if surgeons tend to be A or B 'partisans'\n      }\n      for (s in 1:No) {\n        N[s] ~ dnegbin(0.1, 4)\n        A[s] ~ dbin(a[s], N[s])\n      }\n      for (s in No+(1:Na)) {\n        N[s] ~ dnegbin(0.1, 4) |> T(L[s], L[s]+10)\n        A[s] ~ dbin(a[s], N[s])\n      }\n      for (s in No+Na+(1:Nb)) {\n        N[s] ~ dnegbin(0.1, 4) |> T(L[s], L[s]+10)\n        B[s] ~ dbin(1-a[s], N[s])\n      }\n    }\n\n",
  "title": "Censored binomial models"
}