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

Bayesian partial correlations #301

Open
JulianGaviriaL opened this issue Sep 29, 2023 · 0 comments
Open

Bayesian partial correlations #301

JulianGaviriaL opened this issue Sep 29, 2023 · 0 comments

Comments

@JulianGaviriaL
Copy link

  1. I obtain the following results from the Bayesian correlation test of "Sepal.Length", "Sepal.Width", "Petal.Length" (iris dataset):
require(easystats)
require(BayesFactor)
require(see)

d<-correlation(iris, select=c("Sepal.Length", "Sepal.Width", "Petal.Length"), bayesian = TRUE)

Parameter1 | Parameter2 | rho | 95% CI | pd | % in ROPE | Prior | BF

Sepal.Length | Sepal.Width | -0.11 | [-0.27, 0.04] | 91.62% | 44.38% | Beta (3 +- 3) | 0.509
Sepal.Length | Petal.Length | 0.86 | [ 0.82, 0.90] | 100%*** | 0% | Beta (3 +- 3) | 2.14e+43***
Sepal.Width | Petal.Length | -0.41 | [-0.54, -0.28] | 100%*** | 0% | Beta (3 +- 3) | 3.49e+05***

My aim is to compute bayesian partial correlations. I tried 2 different codes:

e<-correlation(iris, select=c("Sepal.Length", "Sepal.Width", "Petal.Length"), bayesian = TRUE,partial_bayesian = TRUE)
f<-correlation(iris, select=c("Sepal.Length", "Sepal.Width", "Petal.Length"), bayesian = TRUE,partial = TRUE, partial_bayesian = TRUE)

Which one yields the most reliable results?

e

Correlation Matrix (pearson-method)

Parameter1 | Parameter2 | rho | 95% CI | pd | % in ROPE | Prior | BF

Sepal.Length | Sepal.Width | -0.11 | [-0.25, 0.05] | 91.42% | 44.55% | Beta (3 +- 3) | 0.509
Sepal.Length | Petal.Length | 0.86 | [ 0.82, 0.90] | 100%*** | 0% | Beta (3 +- 3) | 2.14e+43***
Sepal.Width | Petal.Length | -0.41 | [-0.55, -0.28] | 100%*** | 0% | Beta (3 +- 3) | 3.49e+05***

Observations: 150

f

Correlation Matrix (pearson-method)

Parameter1 | Parameter2 | rho | 95% CI | pd | % in ROPE | Prior | BF

Sepal.Length | Sepal.Width | 0.57 | [ 0.45, 0.66] | 100%*** | 0% | Beta (3 +- 3) | 6.96e+11***
Sepal.Length | Petal.Length | 0.91 | [ 0.87, 0.93] | 100%*** | 0% | Beta (3 +- 3) | 2.81e+55***
Sepal.Width | Petal.Length | -0.65 | [-0.74, -0.56] | 100%*** | 0% | Beta (3 +- 3) | 4.73e+17***

Observations: 150

  1. I assume that the correlation value (rho) of "Sepal.Length" | Sepal.Width" is adjusted for the linear effect of "Petal.Length".
    2.a) How does it works when I have 4 or a greater number of variables?
    2.b) Would it be possible to determine which variable (either "Petal.Length" or "Petal.Width") controls the correlation between "Sepal.Length" | Sepal.Width"?

g<-correlation(iris, select=c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"), bayesian = TRUE)

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

No branches or pull requests

1 participant