Skip to content

Commit

Permalink
bump to devel
Browse files Browse the repository at this point in the history
extract two sample examples to a separate script
  • Loading branch information
IndrajeetPatil committed Sep 12, 2023
1 parent c121c87 commit 93e4677
Show file tree
Hide file tree
Showing 13 changed files with 111 additions and 320 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: statsExpressions
Title: Tidy Dataframes and Expressions with Statistical Details
Version: 1.5.2
Version: 1.5.2.9000
Authors@R:
person(given = "Indrajeet",
family = "Patil",
Expand Down Expand Up @@ -35,7 +35,7 @@ Imports:
insight (>= 0.19.4),
magrittr,
parameters (>= 0.21.1),
performance (>= 0.10.4),
performance (>= 0.10.5),
PMCMRplus (>= 1.9.7),
purrr (>= 1.0.2),
rlang,
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# statsExpressions 1.5.2.9000

# statsExpressions 1.5.2

- Fixes failures on R-devel due to changes in the formula interface for a paired test.
Expand Down
85 changes: 2 additions & 83 deletions R/two_sample_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,89 +25,8 @@
#' ```
#'
#' @examplesIf identical(Sys.getenv("NOT_CRAN"), "true")
#' # for reproducibility
#' set.seed(123)
#' library(statsExpressions)
#'
#' # parametric -------------------------------------
#'
#' # between-subjects design
#' two_sample_test(
#' data = sleep,
#' x = group,
#' y = extra,
#' type = "p"
#' )
#'
#' # within-subjects design
#' two_sample_test(
#' data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")),
#' x = condition,
#' y = desire,
#' paired = TRUE,
#' subject.id = subject,
#' type = "p"
#' )
#'
#' # non-parametric ----------------------------------
#'
#' # between-subjects design
#' two_sample_test(
#' data = sleep,
#' x = group,
#' y = extra,
#' type = "np"
#' )
#'
#' # within-subjects design
#' two_sample_test(
#' data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")),
#' x = condition,
#' y = desire,
#' paired = TRUE,
#' subject.id = subject,
#' type = "np"
#' )
#'
#' # robust ----------------------------------
#'
#' # between-subjects design
#' two_sample_test(
#' data = sleep,
#' x = group,
#' y = extra,
#' type = "r"
#' )
#'
#' # within-subjects design
#' two_sample_test(
#' data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")),
#' x = condition,
#' y = desire,
#' paired = TRUE,
#' subject.id = subject,
#' type = "r"
#' )
#'
#' #' # Bayesian ------------------------------
#'
#' # between-subjects design
#' two_sample_test(
#' data = sleep,
#' x = group,
#' y = extra,
#' type = "bayes"
#' )
#'
#' # within-subjects design
#' two_sample_test(
#' data = dplyr::filter(bugs_long, condition %in% c("HDHF", "HDLF")),
#' x = condition,
#' y = desire,
#' paired = TRUE,
#' subject.id = subject,
#' type = "bayes"
#' )
#' @example man/examples/examples-two_sample_test_within.R
#' @example man/examples/examples-two_sample_test_between.R
#' @export
two_sample_test <- function(data,
x,
Expand Down
8 changes: 4 additions & 4 deletions man/centrality_description.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/corr_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/examples/examples-centrality_description.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ set.seed(123)

# ----------------------- parametric -----------------------

centrality_description(iris, Species, Sepal.Length)
centrality_description(iris, Species, Sepal.Length, type = "parametric")

# ----------------------- non-parametric -------------------

centrality_description(mtcars, am, wt, type = "n")
centrality_description(mtcars, am, wt, type = "nonparametric")

# ----------------------- robust ---------------------------

centrality_description(ToothGrowth, supp, len, type = "r")
centrality_description(ToothGrowth, supp, len, type = "robust")

# ----------------------- Bayesian -------------------------

centrality_description(sleep, group, extra, type = "b")
centrality_description(sleep, group, extra, type = "bayes")
8 changes: 4 additions & 4 deletions man/examples/examples-corr_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ set.seed(123)

# ----------------------- parametric -----------------------

corr_test(mtcars, wt, mpg)
corr_test(mtcars, wt, mpg, type = "parametric")

# ----------------------- non-parametric -------------------

corr_test(mtcars, wt, mpg, type = "n")
corr_test(mtcars, wt, mpg, type = "nonparametric")

# ----------------------- robust ---------------------------

corr_test(mtcars, wt, mpg, type = "r")
corr_test(mtcars, wt, mpg, type = "robust")

# ----------------------- Bayesian -------------------------

corr_test(mtcars, wt, mpg, type = "b")
corr_test(mtcars, wt, mpg, type = "bayes")
6 changes: 3 additions & 3 deletions man/examples/examples-one_sample_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ one_sample_test(mtcars, wt, test.value = 3)

# ----------------------- non-parametric -------------------

one_sample_test(mtcars, wt, test.value = 3, type = "n")
one_sample_test(mtcars, wt, test.value = 3, type = "nonparametric")

# ----------------------- robust ---------------------------

one_sample_test(mtcars, wt, test.value = 3, type = "r")
one_sample_test(mtcars, wt, test.value = 3, type = "robust")

# ----------------------- Bayesian -------------------------

one_sample_test(mtcars, wt, test.value = 3, type = "b")
one_sample_test(mtcars, wt, test.value = 3, type = "bayes")
24 changes: 24 additions & 0 deletions man/examples/examples-two_sample_test_between.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ----------------------- between-subjects -------------------------------------

# for reproducibility
set.seed(123)

# ----------------------- parametric ---------------------------------------

# unequal variance
two_sample_test(ToothGrowth, supp, len, type = "parametric")

# equal variance
two_sample_test(ToothGrowth, supp, len, type = "parametric", var.equal = TRUE)

# ----------------------- non-parametric -----------------------------------

two_sample_test(ToothGrowth, supp, len, type = "nonparametric")

# ----------------------- robust --------------------------------------------

two_sample_test(ToothGrowth, supp, len, type = "robust")

# ----------------------- Bayesian ---------------------------------------

two_sample_test(ToothGrowth, supp, len, type = "bayes")
23 changes: 23 additions & 0 deletions man/examples/examples-two_sample_test_within.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ----------------------- within-subjects -------------------------------------

# data
df <- dplyr::filter(bugs_long, condition %in% c("LDLF", "LDHF"))

# for reproducibility
set.seed(123)

# ----------------------- parametric ---------------------------------------

two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "parametric")

# ----------------------- non-parametric -----------------------------------

two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "nonparametric")

# ----------------------- robust --------------------------------------------

two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "robust")

# ----------------------- Bayesian ---------------------------------------

two_sample_test(df, condition, desire, subject.id = subject, paired = TRUE, type = "bayes")
6 changes: 3 additions & 3 deletions man/one_sample_test.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 93e4677

Please sign in to comment.