diff --git a/R/auditCommonFunctions.R b/R/auditCommonFunctions.R index e147a671..a4acd5e0 100644 --- a/R/auditCommonFunctions.R +++ b/R/auditCommonFunctions.R @@ -742,7 +742,7 @@ "min_precision_test", "min_precision_rel_val", "by", "prior_method", "prior_n", "prior_x", "alpha", "beta", "critical_items", "critical_negative", "critical_action", - "stratum", "pooling" + "stratum", "pooling", "hurdle" )) jaspResults[["evaluationContainer"]] <- container @@ -2704,6 +2704,9 @@ if (options[["method"]] == "stringer.binomial" && options[["lta"]]) { method <- "stringer.lta" } + if (options[["bayesian"]] && options[["hurdle"]] && options[["method"]] == "binomial") { + method <- "hurdle.beta" + } if (options[["separateMisstatement"]] && options[["values"]] != "" && options[["values.audit"]] != "") { result <- .jfaSeparatedMisstatementEvaluationState(options, sample, prior, planningOptions, evaluationContainer) @@ -2807,6 +2810,9 @@ "poisson" = gettext("The results are computed using the gamma distribution."), "hypergeometric" = gettext("The results are computed using the beta-binomial distribution.") ) + if (options[["hurdle"]] && options[["method"]] == "binomial") { + message <- gettext("The results are computed using the hurdle beta model") + } } # Custom message for stringer bound with LTA diff --git a/inst/qml/auditBayesianEvaluation.qml b/inst/qml/auditBayesianEvaluation.qml index f2cde5b9..28ede484 100644 --- a/inst/qml/auditBayesianEvaluation.qml +++ b/inst/qml/auditBayesianEvaluation.qml @@ -85,6 +85,8 @@ Form enable: !data.use_stats enable_pooling: variables.use_strata enable_partial: !variables.use_strata && variables.use_id && variables.use_book && variables.use_real && ((population.n_items > 0 && population.n_units > 0) || data.use_population) && likelihood.use_binomial + hide_hurdle: false + enable_hurdle: !algorithm.use_partial && !variables.use_strata && variables.use_id && variables.use_book && variables.use_real && likelihood.use_binomial } Evaluation.IntervalType { bayesian: true; test: objectives.use_materiality } } diff --git a/inst/qml/common/planning/Algorithm.qml b/inst/qml/common/planning/Algorithm.qml index a5ade786..1c93e031 100644 --- a/inst/qml/common/planning/Algorithm.qml +++ b/inst/qml/common/planning/Algorithm.qml @@ -26,10 +26,13 @@ Group { readonly property bool use_pooling: pooling.checked readonly property bool use_partial: partial.checked + readonly property bool use_hurdle: hurdle.checked property bool enable: true property bool hide_pooling: true + property bool hide_hurdle: true property bool enable_pooling: true property bool enable_partial: true + property bool enable_hurdle: true title: qsTr("Algorithm") enabled: enable @@ -75,4 +78,26 @@ Group helpPage: "Audit/pooling" } } + + Row + { + spacing: 5 * preferencesModel.uiScale + enabled: enable_hurdle + visible: !hide_hurdle + + CheckBox + { + id: hurdle + text: qsTr("Hurdle model") + name: "hurdle" + enabled: !partial.checked + info: qsTr("This algoritm enables you to consider the individal taints.") + } + + HelpButton + { + toolTip: qsTr("Click to learn more about this algorithm") + helpPage: "Audit/hurdle" + } + } }