diff --git a/pkg/BayesFactor/NEWS b/pkg/BayesFactor/NEWS index e0818ff..32300bd 100644 --- a/pkg/BayesFactor/NEWS +++ b/pkg/BayesFactor/NEWS @@ -5,6 +5,7 @@ CHANGES * New function correlationBF - implements Jeffreys' correlation Bayes factor tests * Fixed rare bug that prevented sampling posteriors in some circumstances * Sampling regression models now provides estimate intercept. This may break some old code if you were referring to columns by number instead of name. + * Fixed bug preventing recompute() from working in some cases. CHANGES IN BayesFactor VERSION 0.9.12-2 diff --git a/pkg/BayesFactor/R/methods-BFmodel.R b/pkg/BayesFactor/R/methods-BFmodel.R index 554738a..0f42b77 100644 --- a/pkg/BayesFactor/R/methods-BFmodel.R +++ b/pkg/BayesFactor/R/methods-BFmodel.R @@ -147,6 +147,7 @@ setMethod('compare', signature(numerator = "BFoneSample", denominator = "missing if( attr(terms(formula, data = data),"intercept") == 0 ){ numBF = 0 errorEst = 0 + bf = list() }else{ t = (mean(y) - mu) / sd(y) * sqrt(N) complement = ifelse(!is.null(attr(nullInterval,"complement")),TRUE,FALSE) @@ -212,6 +213,7 @@ setMethod('compare', signature(numerator = "BFindepSample", denominator = "missi if( length(attr(terms(formula, data = data),"term.labels")) == 0 ){ numBF = 0 errorEst = 0 + bf = list() }else{ t = t.test(formula = formula,data=data, var.eq=TRUE)$statistic complement = ifelse(!is.null(attr(nullInterval,"complement")),TRUE,FALSE) @@ -262,6 +264,7 @@ setMethod('compare', signature(numerator = "BFmetat", denominator = "missing", d if( numerator@identifier$formula=="d = 0" ){ numBF = 0 errorEst = 0 + bf = list() }else{ complement = ifelse(!is.null(attr(nullInterval,"complement")),TRUE,FALSE) bf = meta.ttest.tstat(t=data$t, n1=data$n1, n2=data$n2, @@ -307,6 +310,7 @@ setMethod('compare', signature(numerator = "BFcorrelation", denominator = "missi if( numerator@identifier$formula=="rho = 0" ){ numBF = 0 errorEst = 0 + bf = list() }else{ complement = ifelse(!is.null(attr(nullInterval,"complement")),TRUE,FALSE) bf = corr.test.bf(y=data$y, x=data$x, @@ -353,6 +357,7 @@ setMethod('compare', signature(numerator = "BFproportion", denominator = "missin if( numerator@identifier$formula=="p = p0" ){ numBF = 0 errorEst = 0 + bf = list() }else{ complement = ifelse(!is.null(attr(nullInterval,"complement")),TRUE,FALSE) bf = prop.test.bf(y=data$y, N=data$N, p=numerator@prior$p0,