Page 1 of 1

Wald Test in MCMC estimation

Posted: Mon Jul 10, 2017 2:14 pm
by vivian1234
Hello,

I understand that I can use linearHypothesis function from the car library to calculate Wald Test for categorical variable if I use IGLS estimation. However, when I applied the same function on my result generated by MCMC estimation, it gave the following error:

Code: Select all

Error: $ operator not defined for this S4 class
In this case, can you kindly advice how can I conduct Wald Test if MCMC estimation is used?
Thank you very much.

Regards,
Vivian

Re: Wald Test in MCMC estimation

Posted: Mon Jul 10, 2017 3:54 pm
by ChrisCharlton
Wald tests are normally associated with frequentist estimation methods and make assumptions such as normality, which is why we haven't implemented the mechanisms needed to support this for MCMC. If you are only wanting to use it for approximate tests then running the following code prior to calling linearHypothesis will allow the function to succeed for models fitted with MCMC:

Code: Select all

df.residual.mlwinfitMCMC <- function(object, ...) {
    nobs(object) - length(coef(object))
}

Re: Wald Test in MCMC estimation

Posted: Fri Aug 04, 2017 11:20 am
by GerineLodder
I currently have a model wich I ran in MCMC, for which I want to compare the effects of 2 interventions with a control condotion.
So I have 2 dummies, Intervention1, and Intervention2 (both compared to those with no intervention).

My hypothesis is that there is actually no difference between these 2 interventions. Could I simply look at the quantiles of both, and see if their confidence intervalls overlap?
Is there a way to formally test whether there is a difference between the 2 conditions using MCMC?

Re: Wald Test in MCMC estimation

Posted: Wed Aug 09, 2017 8:03 am
by billb
Hi Gerine,
A better approach would be to extract the chains for the 2 dummies and subtract their values as this would then give you a chain for the differences. You could then look to see if the quantiles of this chain contain 0. This is better as it will deal with any correlation between the parameters.
Best wishes,
Bill.