Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Imports: AlgDesign,
flipFormat,
flipTransformations,
Rcpp (>= 0.12.10),
rstan
rstan,
flipU
Suggests: testthat,
foreign
LinkingTo: Rcpp
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ importFrom(flipFormat,FormatAsPercent)
importFrom(flipFormat,FormatWithDecimals)
importFrom(flipFormat,HistTable)
importFrom(flipFormat,MaxDiffTableClasses)
importFrom(flipFormat,TrimWhitespace)
importFrom(flipU,TrimWhitespace)
importFrom(rstan,extract)
importFrom(rstan,rstan_options)
importFrom(rstan,sampling)
Expand Down
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ IntegrateDesignAndData <- function(design, version, best, worst, seed, questions
}

#' @importFrom flipData CalibrateWeight CleanSubset CleanWeights
#' @importFrom flipFormat TrimWhitespace
#' @importFrom flipU TrimWhitespace
cleanAndCheckData <- function(design, version = NULL, best, worst, alternative.names, subset = NULL, weights = NULL,
characteristics = NULL, seed, questions.left.out = 0)
{
Expand Down
10 changes: 5 additions & 5 deletions R/max-diff.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Memberships <- function(object)
#' \code{print.CorrespondenceAnalysis}
#' @param x FitMaxDiff object.
#' @param ... further arguments passed to or from other methods.
#' @importFrom flipFormat HistTable MaxDiffTableClasses FormatAsPercent FormatWithDecimals
#' @importFrom flipFormat HistTable MaxDiffTableClasses FormatAsPercent FormatAsReal
#' @importFrom stats median quantile
#' @export
print.FitMaxDiff <- function(x, ...)
Expand All @@ -193,7 +193,7 @@ print.FitMaxDiff <- function(x, ...)
footer <- paste0(footer, "Filters have been applied; ")
if (!is.null(x$weights))
footer <- paste0(footer, "Weights have been applied; Effective sample size: ",
FormatWithDecimals(x$effective.sample.size, 2), "; ")
FormatAsReal(x$effective.sample.size, 2), "; ")
footer <- paste0(footer, "Number of questions: ", x$n.questions, "; ")
if (x$questions.left.out > 0)
{
Expand All @@ -203,8 +203,8 @@ print.FitMaxDiff <- function(x, ...)
footer <- paste0(footer, "Alternatives per question: ", x$n.alternatives.per.task, "; ")
if (x$algorithm != "HB")
{
footer <- paste0(footer, "Log-likelihood: ", FormatWithDecimals(x$log.likelihood, 2), "; ")
footer <- paste0(footer, "BIC: ", FormatWithDecimals(x$bic, 2), "; ")
footer <- paste0(footer, "Log-likelihood: ", FormatAsReal(x$log.likelihood, 2), "; ")
footer <- paste0(footer, "BIC: ", FormatAsReal(x$bic, 2), "; ")
}

footer <- if (!x$lc && x$algorithm != "HB" && !x$is.mixture.of.normals)
Expand Down Expand Up @@ -246,7 +246,7 @@ print.FitMaxDiff <- function(x, ...)
probs <- x$respondent.probabilities
stats.table <- matrix(NA, nrow = ncol(probs), ncol = 1)
for (i in 1:ncol(probs))
stats.table[i, 1] <- FormatWithDecimals(mean(probs[, i], na.rm = TRUE) * 100, 1)
stats.table[i, 1] <- FormatAsReal(mean(probs[, i], na.rm = TRUE) * 100, 1)
colnames(stats.table) <- "Mean Probability (%)"

HistTable(100 * probs, title = title, subtitle = subtitle, footer = footer,
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# flipMaxDiff

Made a couple of code changes that prevented it from running correctly