likelihood: Calculate likelihood of data under model

Description Usage Arguments Value Examples

View source: R/likelihood.R

Description

Calculate likelihood of data under model

Usage

1
2
likelihood(sample_mean = 0, sample_se = 0.1, sample_df = 99,
  model = c("H0", "normal", "uniform"), ..., steps = 2000)

Arguments

sample_mean

the observed sample mean

sample_se

the observed sample standard error

sample_df

the observed sample degrees of freedom

model

the model under which to calculate likelihood (H0, normal or uniform

...

model parameters (mean, sd and tail for normal, lower and upper for uniform)

steps

the number of steps to integrate over

Value

double

Examples

1
2
3
lNull <- likelihood(0.5, 1/sqrt(30), 29, "H0")
lTheory <- likelihood(0.5, 1/sqrt(30), 29, "normal", mean = 0, sd = 1, tail = 1)
BayesFactor <- lNull/lTheory

debruine/bfrr documentation built on March 7, 2020, 5:47 p.m.