| g_regression | R Documentation |
The function implements Bayesian regression with g prior (Zellner, 1986)
g_regression(data, g = "UIP")
data |
A matrix with data. The first column is interpreted as with the dependent variable, while the remaining columns are interpreted as regressors. |
g |
Value for g in the g prior. Either a number above zero specified by the user or: |
A list with g_regression objects:
Expected values of coefficients
Posterior standard errors
Natural logarithm of marginal likelihood
R^2 form ols model
Degrees of freedom
Determinant of the regressors' matrix
x1 <- rnorm(100, mean = 0, sd = 1)
x2 <- rnorm(100, mean = 0, sd = 2)
e <- rnorm(100, mean = 0, sd = 5)
y <- 2 + x1 + 2*x2 + e
data <- cbind(y,x1,x2)
g_result <- g_regression(data, g = "UIP")
g_result[[1]]
g_result[[2]]
x1 <- rnorm(50, mean = 0, sd = 1)
x2 <- rnorm(50, mean = 0, sd = 2)
e <- rnorm(50, mean = 0, sd = 0.5)
y <- 2 + x1 + 2*x2 + e
data <- cbind(y,x1,x2)
g_result <- g_regression(data, g = "benchmark")
g_result[[1]]
g_result[[2]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.