Skip to content

Commit

Permalink
Add approximate attr
Browse files Browse the repository at this point in the history
All the FALSEs #345
  • Loading branch information
mattansb committed Jun 14, 2021
1 parent a45141f commit 2654d44
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions R/cohens_d.R
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ glass_delta <- function(x,
attr(out, "mu") <- mu
attr(out, "ci") <- ci
attr(out, "ci_method") <- ci_method
attr(out, "approximate") <- FALSE
return(out)
}

Expand Down
5 changes: 4 additions & 1 deletion R/effectsize.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ effectsize.BFBayesFactor <- function(model, type = NULL, verbose = TRUE, ...) {
stop("No effect size for this type of BayesFactor object.")
}

bayestestR::describe_posterior(res, ...)
out <- bayestestR::describe_posterior(res, ...)
attr(out, "approximate") <- FALSE
out
}


Expand Down Expand Up @@ -188,6 +190,7 @@ effectsize.easycorrelation <- function(model, ...) {

out <- model[, r_cols, drop = FALSE]
class(out) <- c("effectsize_table", "see_effectsize_table", "data.frame")
attr(out, "approximate") <- FALSE
out
}

Expand Down
3 changes: 3 additions & 0 deletions R/rank_effectsizes.R
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ rank_biserial <- function(x,
attr(out, "mu") <- mu
attr(out, "ci") <- ci
attr(out, "ci_method") <- ci_method
attr(out, "approximate") <- FALSE
return(out)
}

Expand Down Expand Up @@ -303,6 +304,7 @@ rank_epsilon_squared <- function(x,
class(out) <- c("effectsize_table", "see_effectsize_table", class(out))
attr(out, "ci") <- ci
attr(out, "ci_method") <- ci_method
attr(out, "approximate") <- FALSE
return(out)
}

Expand Down Expand Up @@ -349,6 +351,7 @@ kendalls_w <- function(x,
class(out) <- c("effectsize_table", "see_effectsize_table", class(out))
attr(out, "ci") <- ci
attr(out, "ci_method") <- ci_method
attr(out, "approximate") <- FALSE
return(out)
}

Expand Down
12 changes: 10 additions & 2 deletions R/xtab.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,16 @@ phi <- function(x, y = NULL, ci = 0.95, adjust = FALSE, CI, ...) {
nc <- 1
}

chisq_to_phi(
out <- chisq_to_phi(
chisq = .chisq(Obs, Exp),
n = sum(Obs),
nrow = nr,
ncol = nc,
ci = ci,
adjust = adjust
)
attr(out, "approximate") <- FALSE
out
}

#' @rdname phi
Expand Down Expand Up @@ -198,14 +200,16 @@ cramers_v <- function(x, y = NULL, ci = 0.95, adjust = FALSE, CI, ...) {
nc <- 1
}

chisq_to_cramers_v(
out <- chisq_to_cramers_v(
chisq = .chisq(Obs, Exp),
n = sum(Obs),
nrow = nr,
ncol = nc,
ci = ci,
adjust = adjust
)
attr(out, "approximate") <- FALSE
out
}


Expand Down Expand Up @@ -273,6 +277,7 @@ oddsratio <- function(x, y = NULL, ci = 0.95, log = FALSE, ...) {
attr(res, "ci") <- ci
attr(res, "ci_method") <- ci_method
attr(res, "log") <- log
attr(res, "approximate") <- FALSE
return(res)
}

Expand Down Expand Up @@ -340,6 +345,7 @@ riskratio <- function(x, y = NULL, ci = 0.95, log = FALSE, ...) {
attr(res, "ci") <- ci
attr(res, "ci_method") <- ci_method
attr(res, "log") <- log
attr(res, "approximate") <- FALSE
return(res)
}

Expand Down Expand Up @@ -397,6 +403,7 @@ cohens_h <- function(x, y = NULL, ci = 0.95, ...) {
class(out) <- c("effectsize_table", "see_effectsize_table", class(out))
attr(out, "ci") <- ci
attr(out, "ci_method") <- ci_method
attr(out, "approximate") <- FALSE
return(out)
}

Expand Down Expand Up @@ -463,6 +470,7 @@ cohens_g <- function(x, y = NULL, ci = 0.95, ...) {
class(out) <- c("effectsize_table", "see_effectsize_table", class(out))
attr(out, "ci") <- ci
attr(out, "ci_method") <- ci_method
attr(out, "approximate") <- FALSE
return(out)
}

Expand Down

0 comments on commit 2654d44

Please sign in to comment.