B2prop: Bayesian comparison of two proportions

View source: R/B2prop.r

B2propR Documentation

Bayesian comparison of two proportions

Description

Cod to compare two proportions using bayesian model with beta priors

Usage

B2prop(
  var1,
  var2,
  n.iter = 11000,
  n.burnin = 1000,
  n.thin = 1,
  prior.beta = c(1, 1, 1, 1)
)

Arguments

var1

variable 1

var2

= variable 2

n.iter

number of iteration

n.burnin

number of iteration used in the update of the model

n.thin

n thin

prior.beta

beta priors (vector of 4 parameters, two first for var1)

Value

list with Stats (descriptive stats) and MCMC (inference)

Author(s)

JuG

Examples

dtf<-data.frame(grp=c(rep("A",15),rep("B", 15)),
                res=c(rbinom(n = 15, size = 1, prob = .5),
                      rbinom(n = 15, size = 1, prob = .49)) )

res <- B2prop(var1 = dtf$res[dtf$grp=="A"], var2 = dtf$res[dtf$grp=="B"])
res

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