glmB: Fitting Generalized Linear Models using bayesian inference...

View source: R/glmB.R

glmBR Documentation

Fitting Generalized Linear Models using bayesian inference (family = binomial)

Description

Generalized Linear Models using bayesian inference (logistic regression)

Usage

glmB(
  formula,
  data = NULL,
  graphOutput = FALSE,
  nIter = 10000,
  thin = 1,
  returnCodaSamples = FALSE,
  priorPrec = c(0.001, 0.001)
)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

an optional data frame containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which blm is called.

graphOutput

regression parameters graphical output (MCMC Trace and posterior density)

nIter

number of iterations

thin

thinning interval for monitors

returnCodaSamples

if TRUE, return the cosa samples output as a mcmc.list

priorPrec

precisions of alpha and beta dnorm distributions

Details

Models for glm are specified symbolically. A typical model has the form response ~ terms where response is the (numeric) response vector and terms is a series of terms which specifies a linear predictor for response.

Value

regression parameters

Author(s)

JuG

Examples

dtf1 <- data.frame(Y = rbinom(n = 60 ,size=1,prob = .3), X = rnorm(60, 10,2))
mod1 <- glmB(Y ~ X , data= dtf1)
dtf2 <- data.frame(Y = rbinom(n = 60 ,size=1,prob = .3), X = rnorm(60, 10,2), X2 = rnorm(60, 10,2))
mod2 <- glmB(Y ~ X + X2, data= dtf2 )
mod3 <- glmB(Y ~ X + X2, data= dtf2 ,priorPrec = c(.001, .1) )

jgodet/utilitR documentation built on May 16, 2024, 12:01 p.m.