Announcement

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

  • Bayesian analysis

    Hi team,
    I have a challenge in running Bayesian Analysis, I just want to produce estimate for NMR at facility level by starting with just prior information Data Quality Category(DQC). The nmr_ is the observed/reported inpatient neonatal mortality rate at facility level for the year 2025. So using prior information QDC what is the estimated mortality? Here is the sample dataset
    * Example code for sharing the dataset
    clear
    input str15 facility int year float nmr_ byte DQC
    "Amana" 2024 90.43 2
    "Benjamin Mkapa" 2024 7.58 1
    "Bugando" 2024 0.89 1
    "Bukoba" 2024 172.95 1
    "Dodoma" 2024 24.50 2
    "Geita" 2024 5.45 1
    "Iringa" 2024 124.56 1
    "KCMC" 2024 101.27 2
    "Katavi" 2024 346.03 0
    "Kitete" 2024 142.03 2
    "Ligula" 2024 78.19 3
    "Manyara" 2024 48.23 2
    "Maweni" 2024 32.16 2
    "Mawenzi" 2024 39.66 1
    "Mbeya" 2024 32.59 2
    "Morogoro" 2024 59.61 2
    "MtMeru" 2024 17.38 1
    "Simiyu" 2024 55.08 0
    "Singida" 2024 80.84 2
    "Sokoine" 2024 60.51 3
    "Songwe" 2024 129.96 0
    "Temeke" 2024 162.99 3
    "Tumbi" 2024 229.05 3
    end

    This is my statacode and the error message : .
    . * Bayesian regression model with normal likelihood
    . * Fit a simple Bayesian model
    . bayesmh nmr_ , ///
    > likelihood(normal({b0}, {sigma}))
    invalid specification normal in option likelihood()

  • #2
    Originally posted by Josephine Shabani View Post
    I have a challenge in running Bayesian Analysis . . .
    This is my statacode and the error message : .
    . . .
    . bayesmh nmr_ , ///
    > likelihood(normal({b0}, {sigma}))
    invalid specification normal in option likelihood()
    It's a syntax error in the likelihood specification. It should name only the variance parameter and so something like this:
    Code:
    bayesmh nmr_ , ///
        likelihood(normal({sigma2}))
    The mean parameter is defined by the linear predictor, which in your case is an intercept-only model. Is that what you want? I don't understand what you mean by

    So using prior information QDC what is the estimated mortality?
    Do you wish to include DCQ as a predictor? If so, then you'd include it in the variable list after the outcome variable.

    And in any case, you'll need to specify prior distributions for the variance and intercept, and if you include DCQ, then for its regression coefficient, too—say, something like the following.
    Code:
    bayesmh nmr_ c.DQC, ///
        likelihood(normal({sigma2})) ///
        prior({nmr_: DQC}, normal(10)) prior({nmr_: _cons}, flat) ///
        prior({sigma2=1}, exp(1))

    Comment


    • #3
      Thanks so much, Joseph! for now I just have the intercept only model, I will keep on adding covariates(like facility level, ownership, facility delivery coverage etc) later. For now I just wanted to see the impact of DQC as prior in the mortality estimates. Just a simple model
      Last edited by Josephine Shabani; 25 Nov 2025, 01:54.

      Comment

      Working...
      X