Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contrast from posterior estimates #68

Open
wdonald1985 opened this issue Mar 26, 2016 · 7 comments
Open

Contrast from posterior estimates #68

wdonald1985 opened this issue Mar 26, 2016 · 7 comments
Labels

Comments

@wdonald1985
Copy link

Although I find the Bayes factor interesting, I am most interested in uncertainty and effect size. When using the lmBF function for the following code: bayesBF <- lmBF(len ~ dose, iterations = 10000, data = toothgrowth), the output does does not tell me which groups differ, by how much, and the uncertainty (credible intervals). I notice that I have mu and estimates for all of the levels of dose. Can I add the posterior estimates for dose to mu to get the mcmc mean for each level of dose. Then can I subtract these means, for example, dose.5 - dose.1 to get the contrasts?

When obtaining 10000 posterior estimates, I get the following from the methods I described.
variable, empirical mean, mcmc mean
Dose 0.5, 10.61, 10.78
Dose 1.0, 19.73, 19.72
Does 2.0, 26.1, 25.92

at all levels of Dose: empirical 18.813, mu = 18.812

Lastly, I saw the post about order constraints, but that still does not make it clear how I can calculate contrasts for specific comparisons.

Thanks in advance,
Donny

@richarddmorey
Copy link
Owner

Can I add the posterior estimates for dose to mu to get the mcmc mean for each level of dose. Then can I subtract these means, for example, dose.5 - dose.1 to get the contrasts?

Yes, you can do this. Note though: if you just care about the contrasts, you don't need to add the mean back in, because if you're going to just subtract them then the mean just subtracts right back out. You just need the difference between the effects themselves.

@wdonald1985
Copy link
Author

When using the random option in lmBF, can I also use the same approach for interactions?
Thank you for the quick reply!

@richarddmorey
Copy link
Owner

I'm not sure what you mean.

@wdonald1985
Copy link
Author

When there is an interaction, can I subtract posterior estimates of the interactions to determine the difference between interactions.

@richarddmorey
Copy link
Owner

You mean, eg, if there is a three-way interaction, can you take the (say) two two-way interactions and subtract them?

@wdonald1985
Copy link
Author

Yes. As an aside, I will be starting graduate school this fall at UC Davis where I will be focusing on the neuroendocrinology of social bonding in prarie voles and titi monkeys. As an undergraduate, I completed a minor in statistics, all NHST, but am attempting to train myself in Bayesian methods.
In my field, journals often ask for effect sizes such as Cohen's d. As such, I am trying to use RSTAN or use a package such as yours for models where I get mean estimates and estimates of sigma for all variables or levels of a factor.
In lmbf, for example, I was considereding obtaining estimates of mu, subtraction to get mean differences, and dividing by the empirical pooled sd. Or just placing a prior that would shrink estimates toward zero and conduct several t.testbf's.

I guess my main concern is that, although I have been reading extensively about Bayesian statistics (DBDA and Rethinking), my adviser and most people in my field have not. As such, ensuring what I am doing is correct is very, very important.

Thank you for the responses and I am sure that I will figure it all out soon!

@richarddmorey
Copy link
Owner

The three-way interaction parameters itself contain the information, don't they? Unless I'm misunderstanding what you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants