Skip to contents

Creates an object representing the prior distribution on coefficients for BAS that corresponds to the test-based Bayes Factors.

Usage

testBF.prior(g)

Arguments

g

a scalar used in the covariance of Zellner's g-prior, Cov(beta) = sigma^2 g (X'X)^-

Value

returns an object of class "prior", with the family and hyerparameters.

Details

Creates a prior object structure used for BAS in `bas.glm`.

See also

g.prior, bas.glm

Other beta priors: CCH(), EB.local(), IC.prior(), Jeffreys(), TG(), beta.prime(), g.prior(), hyper.g(), hyper.g.n(), intrinsic(), robust(), tCCH()

Author

Merlise Clyde

Examples


testBF.prior(100)
#> $family
#> [1] "testBF.prior"
#> 
#> $g
#> [1] 100
#> 
#> $class
#> [1] "g-prior"
#> 
#> $hyper
#> [1] 100
#> 
#> $hyper.parameters
#> $hyper.parameters$g
#> [1] 100
#> 
#> $hyper.parameters$loglik_null
#> NULL
#> 
#> 
#> attr(,"class")
#> [1] "prior"
library(MASS)
data(Pima.tr)

# use g = n
bas.glm(type ~ .,
  data = Pima.tr, family = binomial(),
  betaprior = testBF.prior(nrow(Pima.tr)),
  modelprior = uniform(), method = "BAS"
)
#> 
#> Call:
#> bas.glm(formula = type ~ ., family = binomial(), data = Pima.tr, 
#>     betaprior = testBF.prior(nrow(Pima.tr)), modelprior = uniform(), 
#>     method = "BAS")
#> 
#> 
#>  Marginal Posterior Inclusion Probabilities: 
#> Intercept      npreg        glu         bp       skin        bmi        ped  
#>    1.0000     0.4252     1.0000     0.0706     0.1264     0.6139     0.8075  
#>       age  
#>    0.6705