From 4ff0fe79f9c4211b6c0375b079c4dfe33000ec3a Mon Sep 17 00:00:00 2001 From: rsquaredin Date: Fri, 9 Jul 2021 17:32:27 +0530 Subject: [PATCH 01/10] refactor: change prefix to ifr_* --- NAMESPACE | 98 +++--- R/ifr-anova.R | 16 +- R/ifr-binom-test.R | 24 +- R/ifr-chisq-assoc-test.R | 20 +- R/ifr-chisq-gof-test.R | 26 +- R/ifr-cochran-q-test.R | 16 +- R/ifr-launch-shiny-app.R | 6 +- R/ifr-levene-test.R | 22 +- R/ifr-mcnemar-test.R | 20 +- R/ifr-os-prop-test.R | 24 +- R/ifr-os-t-test.R | 26 +- R/ifr-os-var-test.R | 26 +- R/ifr-runs-test.R | 26 +- R/ifr-ts-ind-ttest.R | 26 +- R/ifr-ts-paired-ttest.R | 26 +- R/ifr-ts-prop-test.R | 44 +-- R/ifr-ts-var-test.R | 22 +- README.Rmd | 12 +- README.md | 12 +- _pkgdown.yml | 36 ++- docs/404.html | 6 + docs/CONDUCT.html | 6 + docs/LICENSE-text.html | 6 + docs/articles/index.html | 6 + docs/articles/intro.html | 70 +++-- docs/authors.html | 6 + docs/index.html | 25 +- docs/news/index.html | 8 +- docs/pkgdown.yml | 2 +- docs/reference/exam.html | 6 + docs/reference/hsb.html | 6 + docs/reference/ifr_binom_calc.html | 86 +++--- docs/reference/ifr_chisq_assoc_test.html | 60 ++-- docs/reference/ifr_chisq_gof_test.html | 80 ++--- docs/reference/ifr_cochran_qtest.html | 25 +- docs/reference/ifr_launch_shiny_app.html | 16 +- docs/reference/ifr_levene_test.html | 94 +++--- docs/reference/ifr_mcnemar_test.html | 231 +++++++------- docs/reference/ifr_oneway_anova.html | 100 +++--- docs/reference/ifr_os_prop_test.html | 74 +++-- docs/reference/ifr_os_t_test.html | 155 +++++----- docs/reference/ifr_os_var_test.html | 160 +++++----- docs/reference/ifr_runs_test.html | 125 ++++---- docs/reference/ifr_ts_ind_ttest.html | 286 +++++++++--------- docs/reference/ifr_ts_paired_ttest.html | 226 +++++++------- docs/reference/ifr_ts_prop_test.html | 89 +++--- docs/reference/ifr_ts_var_test.html | 108 ++++--- docs/reference/index.html | 36 ++- docs/reference/inferr.html | 6 + docs/reference/treatment.html | 6 + docs/reference/treatment2.html | 6 + docs/sitemap.xml | 34 +-- ...{infer_binom_calc.Rd => ifr_binom_calc.Rd} | 20 +- ..._assoc_test.Rd => ifr_chisq_assoc_test.Rd} | 18 +- ...hisq_gof_test.Rd => ifr_chisq_gof_test.Rd} | 16 +- ..._cochran_qtest.Rd => ifr_cochran_qtest.Rd} | 14 +- ...h_shiny_app.Rd => ifr_launch_shiny_app.Rd} | 8 +- ...nfer_levene_test.Rd => ifr_levene_test.Rd} | 22 +- ...er_mcnemar_test.Rd => ifr_mcnemar_test.Rd} | 18 +- ...er_oneway_anova.Rd => ifr_oneway_anova.Rd} | 14 +- ...er_os_prop_test.Rd => ifr_os_prop_test.Rd} | 22 +- man/{infer_os_t_test.Rd => ifr_os_t_test.Rd} | 22 +- ...nfer_os_var_test.Rd => ifr_os_var_test.Rd} | 22 +- man/{infer_runs_test.Rd => ifr_runs_test.Rd} | 22 +- ...er_ts_ind_ttest.Rd => ifr_ts_ind_ttest.Rd} | 22 +- ...paired_ttest.Rd => ifr_ts_paired_ttest.Rd} | 22 +- ...er_ts_prop_test.Rd => ifr_ts_prop_test.Rd} | 30 +- ...nfer_ts_var_test.Rd => ifr_ts_var_test.Rd} | 18 +- tests/testthat/test-anova.R | 6 +- tests/testthat/test-binom.R | 40 +-- tests/testthat/test-chisq.R | 22 +- tests/testthat/test-chisqgof.R | 24 +- tests/testthat/test-cochran.R | 12 +- tests/testthat/test-indttest.R | 14 +- tests/testthat/test-levene.R | 10 +- tests/testthat/test-mcnemar.R | 10 +- tests/testthat/test-os-vartest.R | 20 +- tests/testthat/test-paired-test.R | 12 +- tests/testthat/test-prop-test.R | 20 +- tests/testthat/test-runs.R | 12 +- tests/testthat/test-ttest.R | 26 +- tests/testthat/test-two-prop-test.R | 56 ++-- tests/testthat/test-two-var-test.R | 14 +- tests/testthat/test-utils.R | 2 +- vignettes/intro.Rmd | 62 ++-- 85 files changed, 1793 insertions(+), 1557 deletions(-) rename man/{infer_binom_calc.Rd => ifr_binom_calc.Rd} (72%) rename man/{infer_chisq_assoc_test.Rd => ifr_chisq_assoc_test.Rd} (78%) rename man/{infer_chisq_gof_test.Rd => ifr_chisq_gof_test.Rd} (77%) rename man/{infer_cochran_qtest.Rd => ifr_cochran_qtest.Rd} (71%) rename man/{infer_launch_shiny_app.Rd => ifr_launch_shiny_app.Rd} (63%) rename man/{infer_levene_test.Rd => ifr_levene_test.Rd} (77%) rename man/{infer_mcnemar_test.Rd => ifr_mcnemar_test.Rd} (78%) rename man/{infer_oneway_anova.Rd => ifr_oneway_anova.Rd} (78%) rename man/{infer_os_prop_test.Rd => ifr_os_prop_test.Rd} (73%) rename man/{infer_os_t_test.Rd => ifr_os_t_test.Rd} (74%) rename man/{infer_os_var_test.Rd => ifr_os_var_test.Rd} (74%) rename man/{infer_runs_test.Rd => ifr_runs_test.Rd} (80%) rename man/{infer_ts_ind_ttest.Rd => ifr_ts_ind_ttest.Rd} (81%) rename man/{infer_ts_paired_ttest.Rd => ifr_ts_paired_ttest.Rd} (75%) rename man/{infer_ts_prop_test.Rd => ifr_ts_prop_test.Rd} (72%) rename man/{infer_ts_var_test.Rd => ifr_ts_var_test.Rd} (77%) diff --git a/NAMESPACE b/NAMESPACE index d39961e..e7643c1 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,54 +1,54 @@ # Generated by roxygen2: do not edit by hand -S3method(infer_binom_calc,default) -S3method(infer_chisq_assoc_test,default) -S3method(infer_chisq_gof_test,default) -S3method(infer_cochran_qtest,default) -S3method(infer_levene_test,default) -S3method(infer_mcnemar_test,default) -S3method(infer_oneway_anova,default) -S3method(infer_os_prop_test,default) -S3method(infer_os_t_test,default) -S3method(infer_os_var_test,default) -S3method(infer_runs_test,default) -S3method(infer_ts_ind_ttest,default) -S3method(infer_ts_paired_ttest,default) -S3method(infer_ts_prop_test,default) -S3method(infer_ts_var_test,default) -S3method(print,infer_binom_calc) -S3method(print,infer_chisq_assoc_test) -S3method(print,infer_chisq_gof_test) -S3method(print,infer_cochran_qtest) -S3method(print,infer_levene_test) -S3method(print,infer_mcnemar_test) -S3method(print,infer_oneway_anova) -S3method(print,infer_os_prop_test) -S3method(print,infer_os_t_test) -S3method(print,infer_os_var_test) -S3method(print,infer_runs_test) -S3method(print,infer_ts_ind_ttest) -S3method(print,infer_ts_paired_ttest) -S3method(print,infer_ts_prop_test) -S3method(print,infer_ts_var_test) -export(infer_binom_calc) -export(infer_binom_test) -export(infer_chisq_assoc_test) -export(infer_chisq_gof_test) -export(infer_cochran_qtest) -export(infer_launch_shiny_app) -export(infer_levene_test) -export(infer_mcnemar_test) -export(infer_oneway_anova) -export(infer_os_prop_test) -export(infer_os_t_test) -export(infer_os_var_test) -export(infer_runs_test) -export(infer_ts_ind_ttest) -export(infer_ts_paired_ttest) -export(infer_ts_prop_calc) -export(infer_ts_prop_group) -export(infer_ts_prop_test) -export(infer_ts_var_test) +S3method(ifr_binom_calc,default) +S3method(ifr_chisq_assoc_test,default) +S3method(ifr_chisq_gof_test,default) +S3method(ifr_cochran_qtest,default) +S3method(ifr_levene_test,default) +S3method(ifr_mcnemar_test,default) +S3method(ifr_oneway_anova,default) +S3method(ifr_os_prop_test,default) +S3method(ifr_os_t_test,default) +S3method(ifr_os_var_test,default) +S3method(ifr_runs_test,default) +S3method(ifr_ts_ind_ttest,default) +S3method(ifr_ts_paired_ttest,default) +S3method(ifr_ts_prop_test,default) +S3method(ifr_ts_var_test,default) +S3method(print,ifr_binom_calc) +S3method(print,ifr_chisq_assoc_test) +S3method(print,ifr_chisq_gof_test) +S3method(print,ifr_cochran_qtest) +S3method(print,ifr_levene_test) +S3method(print,ifr_mcnemar_test) +S3method(print,ifr_oneway_anova) +S3method(print,ifr_os_prop_test) +S3method(print,ifr_os_t_test) +S3method(print,ifr_os_var_test) +S3method(print,ifr_runs_test) +S3method(print,ifr_ts_ind_ttest) +S3method(print,ifr_ts_paired_ttest) +S3method(print,ifr_ts_prop_test) +S3method(print,ifr_ts_var_test) +export(ifr_binom_calc) +export(ifr_binom_test) +export(ifr_chisq_assoc_test) +export(ifr_chisq_gof_test) +export(ifr_cochran_qtest) +export(ifr_launch_shiny_app) +export(ifr_levene_test) +export(ifr_mcnemar_test) +export(ifr_oneway_anova) +export(ifr_os_prop_test) +export(ifr_os_t_test) +export(ifr_os_var_test) +export(ifr_runs_test) +export(ifr_ts_ind_ttest) +export(ifr_ts_paired_ttest) +export(ifr_ts_prop_calc) +export(ifr_ts_prop_group) +export(ifr_ts_prop_test) +export(ifr_ts_var_test) import(magrittr) importFrom(Rcpp,sourceCpp) importFrom(data.table,":=") diff --git a/R/ifr-anova.R b/R/ifr-anova.R index eac0b26..2639fc2 100644 --- a/R/ifr-anova.R +++ b/R/ifr-anova.R @@ -4,8 +4,8 @@ #' @param x numeric; column in \code{data} #' @param y factor; column in \code{data} #' @param ... additional arguments passed to or from other methods -#' @return \code{infer_oneway_anova} returns an object of class \code{"infer_oneway_anova"}. -#' An object of class \code{"infer_oneway_anova"} is a list containing the +#' @return \code{ifr_oneway_anova} returns an object of class \code{"ifr_oneway_anova"}. +#' An object of class \code{"ifr_oneway_anova"} is a list containing the #' following components: #' #' \item{adjusted_r2}{adjusted r squared value} @@ -29,14 +29,14 @@ #' #' @seealso \code{\link[stats]{anova}} #' @examples -#' infer_oneway_anova(mtcars, mpg, cyl) -#' infer_oneway_anova(hsb, write, prog) +#' ifr_oneway_anova(mtcars, mpg, cyl) +#' ifr_oneway_anova(hsb, write, prog) #' @export #' -infer_oneway_anova <- function(data, x, y, ...) UseMethod("infer_oneway_anova") +ifr_oneway_anova <- function(data, x, y, ...) UseMethod("ifr_oneway_anova") #' @export -infer_oneway_anova.default <- function(data, x, y, ...) { +ifr_oneway_anova.default <- function(data, x, y, ...) { x1 <- deparse(substitute(x)) y1 <- deparse(substitute(y)) @@ -64,12 +64,12 @@ infer_oneway_anova.default <- function(data, x, y, ...) { ss_total = k$total, ss_within = k$ssee) - class(result) <- "infer_oneway_anova" + class(result) <- "ifr_oneway_anova" return(result) } #' @export -print.infer_oneway_anova <- function(x, ...) { +print.ifr_oneway_anova <- function(x, ...) { print_owanova(x) } diff --git a/R/ifr-binom-test.R b/R/ifr-binom-test.R index 5dc3d7f..28397bd 100644 --- a/R/ifr-binom-test.R +++ b/R/ifr-binom-test.R @@ -8,8 +8,8 @@ #' @param variable factor; column in \code{data} #' @param ... additional arguments passed to or from other methods #' -#' @return \code{infer_binom_test} returns an object of class \code{"infer_binom_test"}. -#' An object of class \code{"infer_binom_test"} is a list containing the +#' @return \code{ifr_binom_test} returns an object of class \code{"ifr_binom_test"}. +#' An object of class \code{"ifr_binom_test"} is a list containing the #' following components: #' #' \item{exp_k}{expected number of successes} @@ -21,23 +21,23 @@ #' \item{pval_upper}{upper one sided p value} #' @section Deprecated Functions: #' \code{binom_calc()} and \code{binom_test()} have been deprecated. Instead use -#' \code{infer_binom_cal()} and \code{infer_binom_test()}. +#' \code{ifr_binom_cal()} and \code{ifr_binom_test()}. #' @references Hoel, P. G. 1984. Introduction to Mathematical Statistics. #' 5th ed. New York: Wiley. #' #' @seealso \code{\link[stats]{binom.test}} #' @examples #' # using calculator -#' infer_binom_calc(32, 13, prob = 0.5) +#' ifr_binom_calc(32, 13, prob = 0.5) #' #' # using data set -#' infer_binom_test(hsb, female, prob = 0.5) +#' ifr_binom_test(hsb, female, prob = 0.5) #' @export #' -infer_binom_calc <- function(n, success, prob = 0.5, ...) UseMethod("infer_binom_calc") +ifr_binom_calc <- function(n, success, prob = 0.5, ...) UseMethod("ifr_binom_calc") #' @export -infer_binom_calc.default <- function(n, success, prob = 0.5, ...) { +ifr_binom_calc.default <- function(n, success, prob = 0.5, ...) { if (!is.numeric(n)) { stop("n must be an integer", call. = FALSE) @@ -68,18 +68,18 @@ infer_binom_calc.default <- function(n, success, prob = 0.5, ...) { pval_upper = k$upper ) - class(out) <- "infer_binom_calc" + class(out) <- "ifr_binom_calc" return(out) } #' @export -print.infer_binom_calc <- function(x, ...) { +print.ifr_binom_calc <- function(x, ...) { print_binom(x) } #' @export -#' @rdname infer_binom_calc -infer_binom_test <- function(data, variable, prob = 0.5) { +#' @rdname ifr_binom_calc +ifr_binom_test <- function(data, variable, prob = 0.5) { varyable <- deparse(substitute(variable)) fdata <- data[[varyable]] @@ -102,7 +102,7 @@ infer_binom_test <- function(data, variable, prob = 0.5) { n <- length(fdata) k <- table(fdata)[[2]] - infer_binom_calc.default(n, k, prob) + ifr_binom_calc.default(n, k, prob) } #' @importFrom stats pbinom dbinom diff --git a/R/ifr-chisq-assoc-test.R b/R/ifr-chisq-assoc-test.R index 4591e58..681cb3a 100644 --- a/R/ifr-chisq-assoc-test.R +++ b/R/ifr-chisq-assoc-test.R @@ -4,9 +4,9 @@ #' @param data a \code{data.frame} or \code{tibble} #' @param x factor; column in \code{data} #' @param y factor; column in \code{data} -#' @return \code{infer_chisq_assoc_test} returns an object of class -#' \code{"infer_chisq_assoc_test"}. An object of class -#' \code{"infer_chisq_assoc_test"} is a list containing the +#' @return \code{ifr_chisq_assoc_test} returns an object of class +#' \code{"ifr_chisq_assoc_test"}. An object of class +#' \code{"ifr_chisq_assoc_test"} is a list containing the #' following components: #' #' \item{chisquare}{chi square} @@ -25,21 +25,21 @@ #' #' @section Deprecated Function: #' \code{chisq_test()} has been deprecated. Instead use -#' \code{infer_chisq_assoc_test()}. +#' \code{ifr_chisq_assoc_test()}. #' #' @seealso \code{\link[stats]{chisq.test}} #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' @examples -#' infer_chisq_assoc_test(hsb, female, schtyp) +#' ifr_chisq_assoc_test(hsb, female, schtyp) #' -#' infer_chisq_assoc_test(hsb, female, ses) +#' ifr_chisq_assoc_test(hsb, female, ses) #' @export #' -infer_chisq_assoc_test <- function(data, x, y) UseMethod("infer_chisq_assoc_test") +ifr_chisq_assoc_test <- function(data, x, y) UseMethod("ifr_chisq_assoc_test") #' @export -infer_chisq_assoc_test.default <- function(data, x, y) { +ifr_chisq_assoc_test.default <- function(data, x, y) { x1 <- deparse(substitute(x)) y1 <- deparse(substitute(y)) @@ -111,12 +111,12 @@ infer_chisq_assoc_test.default <- function(data, x, y) { ) } - class(result) <- "infer_chisq_assoc_test" + class(result) <- "ifr_chisq_assoc_test" return(result) } #' @export -print.infer_chisq_assoc_test <- function(x, ...) { +print.ifr_chisq_assoc_test <- function(x, ...) { print_chisq_test(x) } diff --git a/R/ifr-chisq-gof-test.R b/R/ifr-chisq-gof-test.R index 8e9d643..9caf6cd 100644 --- a/R/ifr-chisq-gof-test.R +++ b/R/ifr-chisq-gof-test.R @@ -5,8 +5,8 @@ #' @param x factor; column in \code{data} #' @param y expected proportions #' @param correct logical; if TRUE continuity correction is applied -#' @return \code{infer_chisq_gof_test} returns an object of class -#' \code{"infer_chisq_gof_test"}. An object of class \code{"infer_chisq_gof_test"} +#' @return \code{ifr_chisq_gof_test} returns an object of class +#' \code{"ifr_chisq_gof_test"}. An object of class \code{"ifr_chisq_gof_test"} #' is a list containing the following components: #' #' \item{categories}{levels of \code{x}} @@ -23,22 +23,22 @@ #' #' @section Deprecated Function: #' \code{chisq_gof()} has been deprecated. Instead use -#' \code{infer_chisq_gof_test()} +#' \code{ifr_chisq_gof_test()} #' #' @seealso \code{\link[stats]{chisq.test}} #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' @examples -#' infer_chisq_gof_test(hsb, race, c(20, 20, 20, 140)) +#' ifr_chisq_gof_test(hsb, race, c(20, 20, 20, 140)) #' #' # apply continuity correction -#' infer_chisq_gof_test(hsb, race, c(20, 20, 20, 140), correct = TRUE) +#' ifr_chisq_gof_test(hsb, race, c(20, 20, 20, 140), correct = TRUE) #' @export #' -infer_chisq_gof_test <- function(data, x, y, correct = FALSE) UseMethod("infer_chisq_gof_test") +ifr_chisq_gof_test <- function(data, x, y, correct = FALSE) UseMethod("ifr_chisq_gof_test") #' @export -infer_chisq_gof_test.default <- function(data, x, y, correct = FALSE) { +ifr_chisq_gof_test.default <- function(data, x, y, correct = FALSE) { x1 <- deparse(substitute(x)) xcheck <- data[[x1]] @@ -92,12 +92,12 @@ infer_chisq_gof_test.default <- function(data, x, y, correct = FALSE) { varname = varname ) - class(result) <- "infer_chisq_gof_test" + class(result) <- "ifr_chisq_gof_test" return(result) } #' @export -print.infer_chisq_gof_test <- function(x, ...) { +print.ifr_chisq_gof_test <- function(x, ...) { print_chisq_gof(x) } @@ -110,7 +110,9 @@ chi_cort <- function(x, y) { std <- round(diff / sqrt(y), 2) chi <- round(sum(dif2 / y), 4) - list(dev = dev, std = std, chi = chi) + list(dev = dev, + std = std, + chi = chi) } chigof <- function(x, y) { @@ -121,5 +123,7 @@ chigof <- function(x, y) { std <- round(dif / sqrt(y), 2) chi <- round(sum(dif2 / y), 4) - list(dev = dev, std = std, chi = chi) + list(dev = dev, + std = std, + chi = chi) } diff --git a/R/ifr-cochran-q-test.R b/R/ifr-cochran-q-test.R index 9e4d19f..ad828db 100644 --- a/R/ifr-cochran-q-test.R +++ b/R/ifr-cochran-q-test.R @@ -3,8 +3,8 @@ #' equal in the same population. #' @param data a \code{data.frame} or \code{tibble} #' @param ... columns in \code{data} -#' @return \code{infer_cochran_qtest} returns an object of class -#' \code{"infer_cochran_qtest"}. An object of class \code{"infer_cochran_qtest"} +#' @return \code{ifr_cochran_qtest} returns an object of class +#' \code{"ifr_cochran_qtest"}. An object of class \code{"ifr_cochran_qtest"} #' is a list containing the following components: #' #' \item{df}{degrees of freedom} @@ -14,18 +14,18 @@ #' #' @section Deprecated Function: #' \code{cochran_test()} has been deprecated. Instead use -#' \code{infer_cochran_qtest()}. +#' \code{ifr_cochran_qtest()}. #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' #' @examples -#' infer_cochran_qtest(exam, exam1, exam2, exam3) +#' ifr_cochran_qtest(exam, exam1, exam2, exam3) #' @export #' -infer_cochran_qtest <- function(data, ...) UseMethod("infer_cochran_qtest") +ifr_cochran_qtest <- function(data, ...) UseMethod("ifr_cochran_qtest") #' @export -infer_cochran_qtest.default <- function(data, ...) { +ifr_cochran_qtest.default <- function(data, ...) { vars <- vapply(substitute(...()), deparse, NA_character_) fdata <- data[vars] @@ -47,13 +47,13 @@ infer_cochran_qtest.default <- function(data, ...) { pvalue = k$pvalue, q = k$q) - class(result) <- "infer_cochran_qtest" + class(result) <- "ifr_cochran_qtest" return(result) } #' @export #' -print.infer_cochran_qtest <- function(x, ...) { +print.ifr_cochran_qtest <- function(x, ...) { print_cochran_test(x) } diff --git a/R/ifr-launch-shiny-app.R b/R/ifr-launch-shiny-app.R index aa2ae92..3e154fe 100644 --- a/R/ifr-launch-shiny-app.R +++ b/R/ifr-launch-shiny-app.R @@ -2,13 +2,13 @@ #' @description Launches shiny app #' @examples #' \dontrun{ -#' infer_launch_shiny_app() +#' ifr_launch_shiny_app() #' } #' @export #' -infer_launch_shiny_app <- function() { +ifr_launch_shiny_app <- function() { - message("`infer_launch_shiny_app()` has been soft-deprecated and will be removed in the next release. In future, to launch the app, run the below code:\n + message("`ifr_launch_shiny_app()` has been soft-deprecated and will be removed in the next release. In future, to launch the app, run the below code:\n - install.packages('xplorerr')\n - xplorerr::app_inference()\n") check_suggests('descriptr') diff --git a/R/ifr-levene-test.R b/R/ifr-levene-test.R index 5a2ef04..a9d3dfe 100644 --- a/R/ifr-levene-test.R +++ b/R/ifr-levene-test.R @@ -1,5 +1,5 @@ #' @title Levene's test for equality of variances -#' @description \code{infer_levene_test} reports Levene's robust test statistic +#' @description \code{ifr_levene_test} reports Levene's robust test statistic #' for the equality of variances and the #' two statistics proposed by Brown and Forsythe that replace the mean in #' Levene's formula with alternative location estimators. The first alternative @@ -9,8 +9,8 @@ #' @param ... numeric; columns in \code{data} #' @param group_var factor; column in \code{data} #' @param trim_mean trimmed mean -#' @return \code{infer_levene_test} returns an object of class \code{"infer_levene_test"}. -#' An object of class \code{"infer_levene_test"} is a list containing the +#' @return \code{ifr_levene_test} returns an object of class \code{"ifr_levene_test"}. +#' An object of class \code{"ifr_levene_test"} is a list containing the #' following components: #' #' \item{bf}{Brown and Forsythe f statistic} @@ -30,7 +30,7 @@ #' \item{lens}{number of observations for each level of the grouping variable} #' \item{type}{alternative hypothesis} #' @section Deprecated Function: -#' \code{levene_test()} has been deprecated. Instead use \code{infer_levene_test()}. +#' \code{levene_test()} has been deprecated. Instead use \code{ifr_levene_test()}. #' @references #' {Bland, M. 2000. An Introduction to Medical Statistics. 3rd ed. Oxford: Oxford University Press.} #' @@ -39,18 +39,18 @@ #' {Carroll, R. J., and H. Schneider. 1985. A note on Levene’s tests for equality of variances. Statistics and Probability Letters 3: 191–194.} #' @examples #' # using grouping variable -#' infer_levene_test(hsb, read, group_var = race) +#' ifr_levene_test(hsb, read, group_var = race) #' #' # using variables -#' infer_levene_test(hsb, read, write, socst) +#' ifr_levene_test(hsb, read, write, socst) #' #' @export #' -infer_levene_test <- function(data, ...) UseMethod("infer_levene_test") +ifr_levene_test <- function(data, ...) UseMethod("ifr_levene_test") #' @export -#' @rdname infer_levene_test -infer_levene_test.default <- function(data, ..., group_var = NULL, trim_mean = 0.1) { +#' @rdname ifr_levene_test +ifr_levene_test.default <- function(data, ..., group_var = NULL, trim_mean = 0.1) { groupvar <- deparse(substitute(group_var)) varyables <- vapply(substitute(...()), deparse, NA_character_) @@ -98,14 +98,14 @@ infer_levene_test.default <- function(data, ..., group_var = NULL, trim_mean = 0 sd = k$sd, sds = k$sds) - class(out) <- "infer_levene_test" + class(out) <- "ifr_levene_test" return(out) } #' @export #' -print.infer_levene_test <- function(x, ...) { +print.ifr_levene_test <- function(x, ...) { print_levene_test(x) } diff --git a/R/ifr-mcnemar-test.R b/R/ifr-mcnemar-test.R index c8cbbf1..65fd78f 100644 --- a/R/ifr-mcnemar-test.R +++ b/R/ifr-mcnemar-test.R @@ -5,8 +5,8 @@ #' @param data a \code{data.frame} or \code{tibble} #' @param x factor; column in \code{data} #' @param y factor; column in \code{data} -#' @return \code{infer_mcnemar_test} returns an object of class \code{"infer_mcnemar_test"}. -#' An object of class \code{"infer_mcnemar_test"} is a list containing the +#' @return \code{ifr_mcnemar_test} returns an object of class \code{"ifr_mcnemar_test"}. +#' An object of class \code{"ifr_mcnemar_test"} is a list containing the #' following components: #' #' \item{statistic}{chi square statistic} @@ -26,7 +26,7 @@ #' \item{tbl}{two way table} #' @section Deprecated Function: #' \code{mcnermar_test()} has been deprecated. Instead use -#' \code{infer_mcnemar_test()}. +#' \code{ifr_mcnemar_test()}. #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' @@ -36,22 +36,22 @@ #' hb <- hsb #' hb$himath <- ifelse(hsb$math > 60, 1, 0) #' hb$hiread <- ifelse(hsb$read > 60, 1, 0) -#' infer_mcnemar_test(hb, himath, hiread) +#' ifr_mcnemar_test(hb, himath, hiread) #' #' # test if the proportion of students in himath and hiread group is same #' himath <- ifelse(hsb$math > 60, 1, 0) #' hiread <- ifelse(hsb$read > 60, 1, 0) -#' infer_mcnemar_test(table(himath, hiread)) +#' ifr_mcnemar_test(table(himath, hiread)) #' #' # using matrix -#' infer_mcnemar_test(matrix(c(135, 18, 21, 26), nrow = 2)) +#' ifr_mcnemar_test(matrix(c(135, 18, 21, 26), nrow = 2)) #' @export #' -infer_mcnemar_test <- function(data, x = NULL, y = NULL) UseMethod("infer_mcnemar_test") +ifr_mcnemar_test <- function(data, x = NULL, y = NULL) UseMethod("ifr_mcnemar_test") #' @export #' -infer_mcnemar_test.default <- function(data, x = NULL, y = NULL) { +ifr_mcnemar_test.default <- function(data, x = NULL, y = NULL) { if (is.matrix(data) | is.table(data)) { dat <- mcdata(data) @@ -82,13 +82,13 @@ infer_mcnemar_test.default <- function(data, x = NULL, y = NULL) { std_err = k$std_err, tbl = dat) - class(result) <- "infer_mcnemar_test" + class(result) <- "ifr_mcnemar_test" return(result) } #' @export #' -print.infer_mcnemar_test <- function(x, ...) { +print.ifr_mcnemar_test <- function(x, ...) { print_mcnemar_test(x) } diff --git a/R/ifr-os-prop-test.R b/R/ifr-os-prop-test.R index 76225f3..b809ca2 100644 --- a/R/ifr-os-prop-test.R +++ b/R/ifr-os-prop-test.R @@ -1,5 +1,5 @@ #' @title One Sample Test of Proportion -#' @description \code{infer_os_prop_test} compares proportion in one group to a +#' @description \code{ifr_os_prop_test} compares proportion in one group to a #' specified population proportion. #' @param data numeric vector of length 1 or a \code{data.frame} or \code{tibble} #' @param variable factor; column in \code{data} @@ -8,8 +8,8 @@ #' @param alternative a character string specifying the alternative hypothesis, #' must be one of "both" (default), "greater", "less" or "all". You can specify #' just the initial letter. -#' @return \code{infer_os_prop_test} returns an object of class \code{"infer_os_prop_test"}. -#' An object of class \code{"infer_os_prop_test"} is a list containing the +#' @return \code{ifr_os_prop_test} returns an object of class \code{"ifr_os_prop_test"}. +#' An object of class \code{"ifr_os_prop_test"} is a list containing the #' following components: #' #' \item{n}{number of observations} @@ -23,26 +23,26 @@ #' \item{deviation}{deviation of observed from expected} #' \item{std}{standardized resiudals} #' @section Deprecated Function: -#' \code{prop_test()} has been deprecated. Instead use \code{infer_os_prop_test()}. +#' \code{prop_test()} has been deprecated. Instead use \code{ifr_os_prop_test()}. #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' @seealso \code{\link[stats]{prop.test}} \code{\link[stats]{binom.test}} #' @examples #' # use as a calculator -#' infer_os_prop_test(200, prob = 0.5, phat = 0.3) +#' ifr_os_prop_test(200, prob = 0.5, phat = 0.3) #' #' # using data set -#' infer_os_prop_test(hsb, female, prob = 0.5) +#' ifr_os_prop_test(hsb, female, prob = 0.5) #' @export #' -infer_os_prop_test <- function(data, variable = NULL, prob = 0.5, phat = 0.5, +ifr_os_prop_test <- function(data, variable = NULL, prob = 0.5, phat = 0.5, alternative = c("both", "less", "greater", "all")) - UseMethod("infer_os_prop_test") + UseMethod("ifr_os_prop_test") #' @export -#' @rdname infer_os_prop_test +#' @rdname ifr_os_prop_test #' -infer_os_prop_test.default <- function(data, variable = NULL, prob = 0.5, phat = 0.5, +ifr_os_prop_test.default <- function(data, variable = NULL, prob = 0.5, phat = 0.5, alternative = c("both", "less", "greater", "all")) { if (is.numeric(data)) { @@ -73,13 +73,13 @@ infer_os_prop_test.default <- function(data, variable = NULL, prob = 0.5, phat = std = k$std, z = k$z) - class(result) <- "infer_os_prop_test" + class(result) <- "ifr_os_prop_test" return(result) } #' @export #' -print.infer_os_prop_test <- function(x, ...) { +print.ifr_os_prop_test <- function(x, ...) { print_prop_test(x) } diff --git a/R/ifr-os-t-test.R b/R/ifr-os-t-test.R index 44aa943..d5ed7cb 100644 --- a/R/ifr-os-t-test.R +++ b/R/ifr-os-t-test.R @@ -1,5 +1,5 @@ #' @title One Sample t Test -#' @description \code{infer_os_t_test} performs t tests on the equality of means. It tests the +#' @description \code{ifr_os_t_test} performs t tests on the equality of means. It tests the #' hypothesis that a sample has a mean equal to a hypothesized value. #' @param data a \code{data.frame} or \code{tibble} #' @param x numeric; column in \code{data} @@ -9,8 +9,8 @@ #' one of "both" (default), "greater", "less" or "all". You can specify just the #' initial letter #' @param ... additional arguments passed to or from other methods -#' @return \code{infer_os_t_test} returns an object of class \code{"infer_os_t_test"}. -#' An object of class \code{"infer_os_t_test"} is a list containing the +#' @return \code{ifr_os_t_test} returns an object of class \code{"ifr_os_t_test"}. +#' An object of class \code{"ifr_os_t_test"} is a list containing the #' following components: #' #' \item{mu}{a number indicating the true value of the mean} @@ -31,32 +31,32 @@ #' \item{type}{alternative hypothesis} #' \item{var_name}{name of \code{x}} #' @section Deprecated Function: -#' \code{ttest()} has been deprecated. Instead use \code{infer_os_t_test()}. +#' \code{ttest()} has been deprecated. Instead use \code{ifr_os_t_test()}. #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' @seealso \code{\link[stats]{t.test}} #' #' @examples #' # lower tail -#' infer_os_t_test(hsb, write, mu = 50, alternative = 'less') +#' ifr_os_t_test(hsb, write, mu = 50, alternative = 'less') #' #' # upper tail -#' infer_os_t_test(hsb, write, mu = 50, alternative = 'greater') +#' ifr_os_t_test(hsb, write, mu = 50, alternative = 'greater') #' #' # both tails -#' infer_os_t_test(hsb, write, mu = 50, alternative = 'both') +#' ifr_os_t_test(hsb, write, mu = 50, alternative = 'both') #' #' # all tails -#' infer_os_t_test(hsb, write, mu = 50, alternative = 'all') +#' ifr_os_t_test(hsb, write, mu = 50, alternative = 'all') #' #' @export #' -infer_os_t_test <- function(data, x, mu = 0, alpha = 0.05, - alternative = c("both", "less", "greater", "all"), ...) UseMethod("infer_os_t_test") +ifr_os_t_test <- function(data, x, mu = 0, alpha = 0.05, + alternative = c("both", "less", "greater", "all"), ...) UseMethod("ifr_os_t_test") #' @export #' -infer_os_t_test.default <- function(data, x, mu = 0, alpha = 0.05, +ifr_os_t_test.default <- function(data, x, mu = 0, alpha = 0.05, alternative = c("both", "less", "greater", "all"), ...) { x1 <- deparse(substitute(x)) @@ -95,13 +95,13 @@ infer_os_t_test.default <- function(data, x, mu = 0, alpha = 0.05, type = type, var_name = var_name) - class(result) <- "infer_os_t_test" + class(result) <- "ifr_os_t_test" return(result) } #' @export #' -print.infer_os_t_test <- function(x, ...) { +print.ifr_os_t_test <- function(x, ...) { print_ttest(x) } diff --git a/R/ifr-os-var-test.R b/R/ifr-os-var-test.R index a171b59..8639ccd 100644 --- a/R/ifr-os-var-test.R +++ b/R/ifr-os-var-test.R @@ -1,5 +1,5 @@ #' @title One Sample Variance Comparison Test -#' @description \code{infer_os_var_test} performs tests on the equality of standard +#' @description \code{ifr_os_var_test} performs tests on the equality of standard #' deviations (variances).It tests that the standard deviation of a sample is #' equal to a hypothesized value. #' @param data a \code{data.frame} or \code{tibble} @@ -10,8 +10,8 @@ #' must be one of "both" (default), "greater", "less" or "all". You can specify #' just the initial letter #' @param ... additional arguments passed to or from other methods -#' @return \code{infer_os_var_test} returns an object of class \code{"infer_os_var_test"}. -#' An object of class \code{"infer_os_var_test"} is a list containing the +#' @return \code{ifr_os_var_test} returns an object of class \code{"ifr_os_var_test"}. +#' An object of class \code{"ifr_os_var_test"} is a list containing the #' following components: #' #' \item{n}{number of observations} @@ -30,30 +30,30 @@ #' \item{conf}{confidence level} #' \item{type}{alternative hypothesis} #' @section Deprecated Function: -#' \code{os_vartest()} has been deprecated. Instead use \code{infer_os_var_test()}. +#' \code{os_vartest()} has been deprecated. Instead use \code{ifr_os_var_test()}. #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' @seealso \code{\link[stats]{var.test}} #' @examples #' # lower tail -#' infer_os_var_test(mtcars, mpg, 5, alternative = 'less') +#' ifr_os_var_test(mtcars, mpg, 5, alternative = 'less') #' #' # upper tail -#' infer_os_var_test(mtcars, mpg, 5, alternative = 'greater') +#' ifr_os_var_test(mtcars, mpg, 5, alternative = 'greater') #' #' # both tails -#' infer_os_var_test(mtcars, mpg, 5, alternative = 'both') +#' ifr_os_var_test(mtcars, mpg, 5, alternative = 'both') #' #' # all tails -#' infer_os_var_test(mtcars, mpg, 5, alternative = 'all') +#' ifr_os_var_test(mtcars, mpg, 5, alternative = 'all') #' @export #' -infer_os_var_test <- function(data, x, sd, confint = 0.95, - alternative = c("both", "less", "greater", "all"), ...) UseMethod("infer_os_var_test") +ifr_os_var_test <- function(data, x, sd, confint = 0.95, + alternative = c("both", "less", "greater", "all"), ...) UseMethod("ifr_os_var_test") #' @export #' -infer_os_var_test.default <- function(data, x, sd, confint = 0.95, +ifr_os_var_test.default <- function(data, x, sd, confint = 0.95, alternative = c("both", "less", "greater", "all"), ...) { x1 <- deparse(substitute(x)) @@ -92,13 +92,13 @@ infer_os_var_test.default <- function(data, x, sd, confint = 0.95, var_name = varname, xbar = round(k$xbar, 4)) - class(result) <- "infer_os_var_test" + class(result) <- "ifr_os_var_test" return(result) } #' @export #' -print.infer_os_var_test <- function(x, ...) { +print.ifr_os_var_test <- function(x, ...) { print_os_vartest(x) } diff --git a/R/ifr-runs-test.R b/R/ifr-runs-test.R index a7acbe0..b86b7cf 100644 --- a/R/ifr-runs-test.R +++ b/R/ifr-runs-test.R @@ -14,8 +14,8 @@ #' @param mean logical; if TRUE, mean will be used as threshold #' @param threshold threshold to be used for counting runs, specify 0 if data #' is coded as a binary. -#' @return \code{infer_runs_test} returns an object of class \code{"infer_runs_test"}. -#' An object of class \code{"infer_runs_test"} is a list containing the +#' @return \code{ifr_runs_test} returns an object of class \code{"ifr_runs_test"}. +#' An object of class \code{"ifr_runs_test"} is a list containing the #' following components: #' #' \item{n}{number of observations} @@ -28,7 +28,7 @@ #' \item{z}{z statistic} #' \item{p}{p-value of \code{z}} #' @section Deprecated Function: -#' \code{runs_test()} has been deprecated. Instead use \code{infer_runs_test()}. +#' \code{runs_test()} has been deprecated. Instead use \code{ifr_runs_test()}. #' @references #' {Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric Statistical Procedures, 4th edition. : Chapman & Hall/CRC.} #' @@ -38,26 +38,26 @@ #' #' {Swed, F. S., and C. Eisenhart. 1943. Tables for testing randomness of grouping in a sequence of alternatives. Annals of Mathematical Statistics 14: 66–87.} #' @examples -#' infer_runs_test(hsb, read) +#' ifr_runs_test(hsb, read) #' -#' infer_runs_test(hsb, read, drop = TRUE) +#' ifr_runs_test(hsb, read, drop = TRUE) #' -#' infer_runs_test(hsb, read, split = TRUE) +#' ifr_runs_test(hsb, read, split = TRUE) #' -#' infer_runs_test(hsb, read, mean = TRUE) +#' ifr_runs_test(hsb, read, mean = TRUE) #' -#' infer_runs_test(hsb, read, threshold = 0) +#' ifr_runs_test(hsb, read, threshold = 0) #' #' @importFrom stats pnorm #' #' @export #' -infer_runs_test <- function(data, x, drop = FALSE, split = FALSE, mean = FALSE, - threshold = NA) UseMethod("infer_runs_test") +ifr_runs_test <- function(data, x, drop = FALSE, split = FALSE, mean = FALSE, + threshold = NA) UseMethod("ifr_runs_test") #' @export #' -infer_runs_test.default <- function(data, x, drop = FALSE, +ifr_runs_test.default <- function(data, x, drop = FALSE, split = FALSE, mean = FALSE, threshold = NA) { @@ -114,13 +114,13 @@ infer_runs_test.default <- function(data, x, drop = FALSE, var = sd_runs, z = test_stat) - class(result) <- "infer_runs_test" + class(result) <- "ifr_runs_test" return(result) } #' @export #' -print.infer_runs_test <- function(x, ...) { +print.ifr_runs_test <- function(x, ...) { print_runs_test(x) } diff --git a/R/ifr-ts-ind-ttest.R b/R/ifr-ts-ind-ttest.R index 5b57381..e81f57d 100644 --- a/R/ifr-ts-ind-ttest.R +++ b/R/ifr-ts-ind-ttest.R @@ -1,5 +1,5 @@ #' @title Two Independent Sample t Test -#' @description \code{infer_ts_ind_ttest} compares the means of two independent groups in order to determine whether +#' @description \code{ifr_ts_ind_ttest} compares the means of two independent groups in order to determine whether #' there is statistical evidence that the associated population means are significantly different. #' @param data a data frame #' @param x factor; a column in \code{data} @@ -9,8 +9,8 @@ #' must be one of "both" (default), "greater", "less" or "all". You can specify #' just the initial letter #' @param ... additional arguments passed to or from other methods -#' @return \code{infer_ts_ind_ttest} returns an object of class \code{"infer_ts_ind_ttest"}. -#' An object of class \code{"infer_ts_ind_ttest"} is a list containing the +#' @return \code{ifr_ts_ind_ttest} returns an object of class \code{"ifr_ts_ind_ttest"}. +#' An object of class \code{"ifr_ts_ind_ttest"} is a list containing the #' following components: #' #' \item{levels}{levels of \code{x}} @@ -45,30 +45,30 @@ #' \item{confint}{confidence level} #' \item{alternative}{alternative hypothesis} #' @section Deprecated Function: -#' \code{ind_ttest()} has been deprecated. Instead use \code{infer_ts_ind_ttest()}. +#' \code{ind_ttest()} has been deprecated. Instead use \code{ifr_ts_ind_ttest()}. #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' @seealso \code{\link[stats]{t.test}} #' @examples #' # lower tail -#' infer_ts_ind_ttest(hsb, female, write, alternative = 'less') +#' ifr_ts_ind_ttest(hsb, female, write, alternative = 'less') #' #' # upper tail -#' infer_ts_ind_ttest(hsb, female, write, alternative = 'greater') +#' ifr_ts_ind_ttest(hsb, female, write, alternative = 'greater') #' #' # both tails -#' infer_ts_ind_ttest(hsb, female, write, alternative = 'both') +#' ifr_ts_ind_ttest(hsb, female, write, alternative = 'both') #' #' # all tails -#' infer_ts_ind_ttest(hsb, female, write, alternative = 'all') +#' ifr_ts_ind_ttest(hsb, female, write, alternative = 'all') #' @export #' -infer_ts_ind_ttest <- function(data, x, y, confint = 0.95, - alternative = c("both", "less", "greater", "all"), ...) UseMethod("infer_ts_ind_ttest") +ifr_ts_ind_ttest <- function(data, x, y, confint = 0.95, + alternative = c("both", "less", "greater", "all"), ...) UseMethod("ifr_ts_ind_ttest") #' @export #' -infer_ts_ind_ttest.default <- function(data, x, y, confint = 0.95, +ifr_ts_ind_ttest.default <- function(data, x, y, confint = 0.95, alternative = c("both", "less", "greater", "all"), ...) { x1 <- deparse(substitute(x)) @@ -126,14 +126,14 @@ infer_ts_ind_ttest.default <- function(data, x, y, confint = 0.95, upper = g_stat[, 9], var_y = var_y) - class(result) <- "infer_ts_ind_ttest" + class(result) <- "ifr_ts_ind_ttest" return(result) } #' @export #' -print.infer_ts_ind_ttest <- function(x, ...) { +print.ifr_ts_ind_ttest <- function(x, ...) { print_two_ttest(x) } diff --git a/R/ifr-ts-paired-ttest.R b/R/ifr-ts-paired-ttest.R index 70b2476..0a2897c 100644 --- a/R/ifr-ts-paired-ttest.R +++ b/R/ifr-ts-paired-ttest.R @@ -1,5 +1,5 @@ #' @title Paired t test -#' @description \code{infer_ts_paired_ttest} tests that two samples have the +#' @description \code{ifr_ts_paired_ttest} tests that two samples have the #' same mean, assuming paired data. #' @param data a \code{data.frame} or \code{tibble} #' @param x numeric; column in \code{data} @@ -8,8 +8,8 @@ #' @param alternative a character string specifying the alternative hypothesis, must be #' one of "both" (default), "greater", "less" or "all". You can specify just the #' initial letter. -#' @return \code{infer_ts_paired_ttest} returns an object of class \code{"infer_ts_paired_ttest"}. -#' An object of class \code{"infer_ts_paired_ttest"} is a list containing the +#' @return \code{ifr_ts_paired_ttest} returns an object of class \code{"ifr_ts_paired_ttest"}. +#' An object of class \code{"ifr_ts_paired_ttest"} is a list containing the #' following components: #' #' \item{Obs}{number of observations} @@ -32,30 +32,30 @@ #' \item{xy}{string used in printing results of the test} #' @section Deprecated Function: #' \code{paired_ttest()} has been deprecated. Instead use -#' \code{infer_ts_paired_ttest()}. +#' \code{ifr_ts_paired_ttest()}. #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' @seealso \code{\link[stats]{t.test}} #' @examples #' # lower tail -#' infer_ts_paired_ttest(hsb, read, write, alternative = 'less') +#' ifr_ts_paired_ttest(hsb, read, write, alternative = 'less') #' #' # upper tail -#' infer_ts_paired_ttest(hsb, read, write, alternative = 'greater') +#' ifr_ts_paired_ttest(hsb, read, write, alternative = 'greater') #' #' # both tails -#' infer_ts_paired_ttest(hsb, read, write, alternative = 'both') +#' ifr_ts_paired_ttest(hsb, read, write, alternative = 'both') #' #' # all tails -#' infer_ts_paired_ttest(hsb, read, write, alternative = 'all') +#' ifr_ts_paired_ttest(hsb, read, write, alternative = 'all') #' @export #' -infer_ts_paired_ttest <- function(data, x, y, confint = 0.95, - alternative = c("both", "less", "greater", "all")) UseMethod("infer_ts_paired_ttest") +ifr_ts_paired_ttest <- function(data, x, y, confint = 0.95, + alternative = c("both", "less", "greater", "all")) UseMethod("ifr_ts_paired_ttest") #' @export #' -infer_ts_paired_ttest.default <- function(data, x, y, confint = 0.95, +ifr_ts_paired_ttest.default <- function(data, x, y, confint = 0.95, alternative = c("both", "less", "greater", "all")) { x1 <- deparse(substitute(x)) @@ -76,13 +76,13 @@ infer_ts_paired_ttest.default <- function(data, x, y, confint = 0.95, xy = k$xy, df = k$df, alternative = method, confint = confint ) - class(result) <- "infer_ts_paired_ttest" + class(result) <- "ifr_ts_paired_ttest" return(result) } #' @export #' -print.infer_ts_paired_ttest <- function(x, ...) { +print.ifr_ts_paired_ttest <- function(x, ...) { print_paired_ttest(x) } diff --git a/R/ifr-ts-prop-test.R b/R/ifr-ts-prop-test.R index 64e70e6..e8e568d 100644 --- a/R/ifr-ts-prop-test.R +++ b/R/ifr-ts-prop-test.R @@ -15,8 +15,8 @@ #' must be one of "both" (default), "greater", "less" or "all". You can specify #' just the initial letter #' @param ... additional arguments passed to or from other methods -#' @return an object of class \code{"infer_ts_prop_test"}. -#' An object of class \code{"infer_ts_prop_test"} is a list containing the +#' @return an object of class \code{"ifr_ts_prop_test"}. +#' An object of class \code{"ifr_ts_prop_test"} is a list containing the #' following components: #' #' \item{n1}{sample 1 size} @@ -27,36 +27,36 @@ #' \item{sig}{p-value for z statistic} #' \item{alt}{alternative hypothesis} #' @section Deprecated Functions: -#' \code{infer_ts_prop_test()}, \code{infer_ts_prop_grp()} and \code{infer_ts_prop_calc()} have -#' been deprecated. Instead use \code{infer_ts_prop_test()}, -#' \code{infer_ts_prop_group()} and \code{infer_ts_prop_calc()}. +#' \code{ifr_ts_prop_test()}, \code{ifr_ts_prop_grp()} and \code{ifr_ts_prop_calc()} have +#' been deprecated. Instead use \code{ifr_ts_prop_test()}, +#' \code{ifr_ts_prop_group()} and \code{ifr_ts_prop_calc()}. #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' @seealso \code{\link[stats]{prop.test}} #' @examples #' # using variables #' # lower tail -#' infer_ts_prop_test(treatment, treatment1, treatment2, +#' ifr_ts_prop_test(treatment, treatment1, treatment2, #' alternative = 'less') #' #' # using groups #' # lower tail -#' infer_ts_prop_group(treatment2, outcome, female, +#' ifr_ts_prop_group(treatment2, outcome, female, #' alternative = 'less') #' #' # using sample size and proportions #' # lower tail -#' infer_ts_prop_calc(n1 = 30, n2 = 25, p1 = 0.3, p2 = 0.5, alternative = 'less') +#' ifr_ts_prop_calc(n1 = 30, n2 = 25, p1 = 0.3, p2 = 0.5, alternative = 'less') #' #' @export #' -infer_ts_prop_test <- function(data, var1, var2, +ifr_ts_prop_test <- function(data, var1, var2, alternative = c("both", "less", "greater", "all"), ...) - UseMethod("infer_ts_prop_test") + UseMethod("ifr_ts_prop_test") #' @export #' -infer_ts_prop_test.default <- function(data, var1, var2, +ifr_ts_prop_test.default <- function(data, var1, var2, alternative = c("both", "less", "greater", "all"), ...) { var_1 <- deparse(substitute(var1)) @@ -76,30 +76,30 @@ infer_ts_prop_test.default <- function(data, var1, var2, sig = k$sig, z = k$z) - class(result) <- "infer_ts_prop_test" + class(result) <- "ifr_ts_prop_test" return(result) } #' @export -#' @rdname infer_ts_prop_test +#' @rdname ifr_ts_prop_test #' @usage NULL #' -infer_ts_prop_calc <- function(n1, n2, p1, p2, +ifr_ts_prop_calc <- function(n1, n2, p1, p2, alternative = c("both", "less", "greater", "all"), ...) { - .Deprecated("infer_ts_prop_calc()") + .Deprecated("ifr_ts_prop_calc()") } #' @export #' -print.infer_ts_prop_test <- function(x, ...) { +print.ifr_ts_prop_test <- function(x, ...) { print_ts_prop_test(x) } #' @export -#' @rdname infer_ts_prop_test +#' @rdname ifr_ts_prop_test #' -infer_ts_prop_group <- function(data, var, group, +ifr_ts_prop_group <- function(data, var, group, alternative = c("both", "less", "greater", "all")) { var1 <- deparse(substitute(var)) @@ -152,14 +152,14 @@ infer_ts_prop_group <- function(data, var, group, sig = round(sig, 3), z = round(z, 3)) - class(out) <- "infer_ts_prop_test" + class(out) <- "ifr_ts_prop_test" return(out) } #' @export -#' @rdname infer_ts_prop_test +#' @rdname ifr_ts_prop_test #' -infer_ts_prop_calc <- function(n1, n2, p1, p2, +ifr_ts_prop_calc <- function(n1, n2, p1, p2, alternative = c("both", "less", "greater", "all"), ...) { n1 <- n1 n2 <- n2 @@ -197,7 +197,7 @@ infer_ts_prop_calc <- function(n1, n2, p1, p2, sig = round(sig, 3), z = round(z, 3)) - class(out) <- "infer_ts_prop_test" + class(out) <- "ifr_ts_prop_test" return(out) } diff --git a/R/ifr-ts-var-test.R b/R/ifr-ts-var-test.R index e4eec4a..09664de 100644 --- a/R/ifr-ts-var-test.R +++ b/R/ifr-ts-var-test.R @@ -1,5 +1,5 @@ #' @title Two Sample Variance Comparison Test -#' @description \code{infer_ts_var_test} performs tests on the equality of standard +#' @description \code{ifr_ts_var_test} performs tests on the equality of standard #' deviations (variances). #' @param data a \code{data.frame} or \code{tibble} #' @param ... numeric; column(s) in \code{data} @@ -7,8 +7,8 @@ #' @param alternative a character string specifying the alternative hypothesis, #' must be one of "both" (default), "greater", "less" or "all". You can specify #' just the initial letter. -#' @return \code{infer_ts_var_test} returns an object of class \code{"infer_ts_var_test"}. -#' An object of class \code{"infer_ts_var_test"} is a list containing the +#' @return \code{ifr_ts_var_test} returns an object of class \code{"ifr_ts_var_test"}. +#' An object of class \code{"ifr_ts_var_test"} is a list containing the #' following components: #' #' \item{f}{f statistic} @@ -29,25 +29,25 @@ #' \item{lev}{levels of the grouping variable} #' \item{type}{alternative hypothesis} #' @section Deprecated Function: -#' \code{var_test()} has been deprecated. Instead use \code{infer_ts_var_test()}. +#' \code{var_test()} has been deprecated. Instead use \code{ifr_ts_var_test()}. #' @references Sheskin, D. J. 2007. Handbook of Parametric and Nonparametric #' Statistical Procedures, 4th edition. : Chapman & Hall/CRC. #' @seealso \code{\link[stats]{var.test}} #' @examples #' # using grouping variable -#' infer_ts_var_test(hsb, read, group_var = female, alternative = 'less') +#' ifr_ts_var_test(hsb, read, group_var = female, alternative = 'less') #' #' # using two variables -#' infer_ts_var_test(hsb, read, write, alternative = 'less') +#' ifr_ts_var_test(hsb, read, write, alternative = 'less') #' #' @export #' -infer_ts_var_test <- function(data, ..., group_var = NULL, - alternative = c("less", "greater", "all")) UseMethod("infer_ts_var_test") +ifr_ts_var_test <- function(data, ..., group_var = NULL, + alternative = c("less", "greater", "all")) UseMethod("ifr_ts_var_test") #' @export #' -infer_ts_var_test.default <- function(data, ..., group_var = NULL, +ifr_ts_var_test.default <- function(data, ..., group_var = NULL, alternative = c("less", "greater", "all")) { groupvar <- deparse(substitute(group_var)) @@ -100,13 +100,13 @@ infer_ts_var_test.default <- function(data, ..., group_var = NULL, upper = k$upper, vars = k$vars) - class(out) <- "infer_ts_var_test" + class(out) <- "ifr_ts_var_test" return(out) } #' @export #' -print.infer_ts_var_test <- function(x, ...) { +print.ifr_ts_var_test <- function(x, ...) { print_var_test(x) } diff --git a/README.Rmd b/README.Rmd index c96ce25..8fb39a6 100644 --- a/README.Rmd +++ b/README.Rmd @@ -68,31 +68,31 @@ library(inferr) ``` ```{r infer1} -infer_os_t_test(hsb, write, mu = 50, type = 'all') +ifr_os_t_test(hsb, write, mu = 50, type = 'all') ``` #### ANOVA ```{r anova} -infer_oneway_anova(hsb, write, prog) +ifr_oneway_anova(hsb, write, prog) ``` #### Chi Square Test of Independence ```{r chi1} -infer_chisq_assoc_test(hsb, female, schtyp) +ifr_chisq_assoc_test(hsb, female, schtyp) ``` #### Levene's Test ```{r lev1} -infer_levene_test(hsb, read, group_var = race) +ifr_levene_test(hsb, read, group_var = race) ``` #### Cochran's Q Test ```{r cochran} -infer_cochran_qtest(exam, exam1, exam2, exam3) +ifr_cochran_qtest(exam, exam1, exam2, exam3) ``` #### McNemar Test @@ -101,7 +101,7 @@ infer_cochran_qtest(exam, exam1, exam2, exam3) hb <- hsb hb$himath <- ifelse(hsb$math > 60, 1, 0) hb$hiread <- ifelse(hsb$read > 60, 1, 0) -infer_mcnemar_test(hb, himath, hiread) +ifr_mcnemar_test(hb, himath, hiread) ``` ## Getting Help diff --git a/README.md b/README.md index 1603e2e..d944f36 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ devtools::install_github("rsquaredacademy/inferr") #### One Sample t Test ``` r -infer_os_t_test(hsb, write, mu = 50, type = 'all') +ifr_os_t_test(hsb, write, mu = 50, type = 'all') #> One-Sample Statistics #> --------------------------------------------------------------------------------- #> Variable Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] @@ -87,7 +87,7 @@ infer_os_t_test(hsb, write, mu = 50, type = 'all') #### ANOVA ``` r -infer_oneway_anova(hsb, write, prog) +ifr_oneway_anova(hsb, write, prog) #> ANOVA #> ---------------------------------------------------------------------- #> Sum of @@ -114,7 +114,7 @@ infer_oneway_anova(hsb, write, prog) #### Chi Square Test of Independence ``` r -infer_chisq_assoc_test(hsb, female, schtyp) +ifr_chisq_assoc_test(hsb, female, schtyp) #> Chi Square Statistics #> #> Statistics DF Value Prob @@ -132,7 +132,7 @@ infer_chisq_assoc_test(hsb, female, schtyp) #### Levene’s Test ``` r -infer_levene_test(hsb, read, group_var = race) +ifr_levene_test(hsb, read, group_var = race) #> Summary Statistics #> Levels Frequency Mean Std. Dev #> ----------------------------------------- @@ -157,7 +157,7 @@ infer_levene_test(hsb, read, group_var = race) #### Cochran’s Q Test ``` r -infer_cochran_qtest(exam, exam1, exam2, exam3) +ifr_cochran_qtest(exam, exam1, exam2, exam3) #> Test Statistics #> ---------------------- #> N 15 @@ -173,7 +173,7 @@ infer_cochran_qtest(exam, exam1, exam2, exam3) hb <- hsb hb$himath <- ifelse(hsb$math > 60, 1, 0) hb$hiread <- ifelse(hsb$read > 60, 1, 0) -infer_mcnemar_test(hb, himath, hiread) +ifr_mcnemar_test(hb, himath, hiread) #> Controls #> --------------------------------- #> Cases 0 1 Total diff --git a/_pkgdown.yml b/_pkgdown.yml index 9e9188a..d6d0a35 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -28,6 +28,10 @@ navbar: href: reference/index.html - text: "News" href: news/index.html + - text: "Blog" + href: https://blog.rsquaredacademy.com + - text: "Online Courses" + href: https://rsquared-academy.thinkific.com right: - icon: fa-github href: https://github.com/rsquaredacademy/inferr @@ -45,31 +49,31 @@ reference: - title: Parametric Tests contents: - - infer_binom_calc - - infer_binom_test - - infer_levene_test - - infer_os_prop_test - - infer_os_t_test - - infer_os_var_test - - infer_ts_ind_ttest - - infer_ts_paired_ttest - - infer_ts_prop_test - - infer_ts_var_test + - ifr_binom_calc + - ifr_binom_test + - ifr_levene_test + - ifr_os_prop_test + - ifr_os_t_test + - ifr_os_var_test + - ifr_ts_ind_ttest + - ifr_ts_paired_ttest + - ifr_ts_prop_test + - ifr_ts_var_test - title: Non-parametric Tests contents: - - infer_chisq_assoc_test - - infer_chisq_gof_test - - infer_cochran_qtest - - infer_mcnemar_test - - infer_runs_test + - ifr_chisq_assoc_test + - ifr_chisq_gof_test + - ifr_cochran_qtest + - ifr_mcnemar_test + - ifr_runs_test - title: ANOVA contents: - - infer_oneway_anova + - ifr_oneway_anova - title: Data desc: > diff --git a/docs/404.html b/docs/404.html index d2cad67..681d5bd 100644 --- a/docs/404.html +++ b/docs/404.html @@ -106,6 +106,12 @@ News + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses
  • + +
  • + Blog +
  • +
  • + Online Courses