BF_Power_analysis: Bayes Factor Power Analysis

View source: R/BF_power_analysis.R

BF_Power_analysisR Documentation

Bayes Factor Power Analysis

Description

Bayes Factor Power Analysis

Usage

BF_power_analysis(pars, Model)

Arguments

pars

list(N, beta_M, beta_Y, sigma_M, sigma_Y, R, burnin, reps) for "Simple", list(N, beta_M, beta_Y, ssq_m_star, lambda, Sigma_Y, M_ind, Mcut, cutoff_M, R, burnin, reps) for "MCat", list(N, beta_M, beta_Y, ssq_y_star, tau, sigma_M, Y_ind, Ycut, cutoff_Y, R, burnin, reps) for "YCat", and list(N, beta_M, beta_Y, ssq_m_star, ssq_y_star, lambda, Sigma_Y, M_ind, Mcut, cutoff_M, R, burnin, reps) for "MYCat"

Model

can be either "Simple", "MCat", "YCat", "MYCat".

Details

Model

For further information about the models, see

  • PartialMed for "Simple"

  • MeasurementMCat for "MCat"

  • MeasurementYCat for "YCat"

  • MeasurementMYCat for "MYCat"

Value

The function returns the Bayes factor distribution obtained from "reps" datasets generated with the input parameter values

Examples

pars = NULL
pars$M_ind = 2
pars$Y_ind = 2
pars$Mcut = pars$Ycut = 8
pars$N = 50
pars$beta_M = c(.5,1)
pars$beta_Y = c(.7, 1.5, 0)
pars$ssq_m_star = c(.5,.3)
pars$lambda = c(0,-.5) #the intercepts for the latent M indicators w. measurement error
pars$ssq_y_star = c(.2,.2)
pars$tau = c(0,-.5)
pars$cutoff_M = matrix(c(-100, 0, 1.6, 2, 2.2, 3.3, 6,  100,
                      -100, 0, 1, 2, 3, 4, 5, 100) ,ncol= pars$Mcut, byrow = TRUE)
pars$cutoff_Y =  matrix(c(-100, 0, 1.6, 2, 2.2, 3.3, 6,  100,
                         -100, 0, 1, 2, 3, 4, 5, 100) ,ncol= pars$Ycut, byrow = TRUE)
pars$R = 10000
pars$burnin = 2000
pars$reps = 100  

BF_Power_analysis(pars = pars, model = "MYCat")    # The analysis takes several minutes

arashl1364/BFMediate documentation built on Oct. 11, 2023, 5:54 p.m.