Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
qddyy committed Oct 7, 2024
1 parent a082653 commit 1fdf10c
Show file tree
Hide file tree
Showing 44 changed files with 501 additions and 536 deletions.
8 changes: 7 additions & 1 deletion R/AnsariBradley.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
#'
#' @aliases twosample.ansari
#'
#' @export AnsariBradley
#' @examples
#' pmt(
#' "twosample.ansari",
#' alternative = "greater", n_permu = 0
#' )$test(Table2.8.1)$print()
#'
#' @export
#'
#' @importFrom R6 R6Class
#' @importFrom stats pnorm
Expand Down
3 changes: 3 additions & 0 deletions R/CDF.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#'
#' @aliases onesample.cdf
#'
#' @examples
#' pmt("onesample.cdf")$test(Table1.2.1)$plot(style = "graphic")
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
8 changes: 8 additions & 0 deletions R/ChiSquare.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#'
#' @aliases table.chisq
#'
#' @examples
#' t <- pmt(
#' "table.chisq", n_permu = 0
#' )$test(Table5.4.2)$print()
#'
#' t$type <- "asymp"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
22 changes: 22 additions & 0 deletions R/Correlation.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@
#'
#' @aliases association.corr
#'
#' @examples
#' pmt(
#' "association.corr", method = "pearson",
#' alternative = "greater", n_permu = 10000
#' )$test(Table5.1.2)$print()
#'
#' t <- pmt(
#' "association.corr", method = "spearman",
#' alternative = "two_sided", n_permu = 10000
#' )$test(Table5.1.2)$print()
#'
#' t$type <- "asymp"
#' t
#'
#' t <- pmt(
#' "association.corr", method = "kendall",
#' alternative = "greater", n_permu = 0
#' )$test(Table5.2.2)$print()
#'
#' t$type <- "asymp"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
13 changes: 13 additions & 0 deletions R/Difference.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@
#'
#' @aliases twosample.difference
#'
#' @examples
#' pmt(
#' "twosample.difference", method = "mean",
#' alternative = "greater", n_permu = 0
#' )$test(Table2.1.1)$print()$plot(
#' style = "graphic", breaks = seq(-20, 25, length.out = 9)
#' )
#'
#' pmt(
#' "twosample.difference", method = "mean",
#' alternative = "greater", n_permu = 1000
#' )$test(Table2.3.1)$print()
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
8 changes: 8 additions & 0 deletions R/Friedman.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#'
#' @aliases rcbd.friedman
#'
#' @examples
#' t <- pmt(
#' "rcbd.friedman", n_permu = 0
#' )$test(Table4.5.3)$print()
#'
#' t$type <- "asymp"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
8 changes: 8 additions & 0 deletions R/JonckheereTerpstra.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#'
#' @aliases ksample.jt
#'
#' @examples
#' t <- pmt(
#' "ksample.jt", alternative = "greater"
#' )$test(Table3.4.1)$print()
#'
#' t$type <- "asymp"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
5 changes: 5 additions & 0 deletions R/KolmogorovSmirnov.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#'
#' @aliases twosample.ks
#'
#' @examples
#' pmt(
#' "twosample.ks", n_permu = 0
#' )$test(Table2.8.1)$print()
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
12 changes: 12 additions & 0 deletions R/KruskalWallis.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
#'
#' @aliases ksample.kw
#'
#' @examples
#' pmt(
#' "ksample.kw", type = "asymp"
#' )$test(Table3.2.2)$print()
#'
#' t <- pmt(
#' "ksample.kw", type = "permu"
#' )$test(Table3.2.3)$print()
#'
#' t$type <- "asymp"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
8 changes: 8 additions & 0 deletions R/OneWay.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#'
#' @aliases ksample.oneway
#'
#' @examples
#' t <- pmt(
#' "ksample.oneway", n_permu = 0
#' )$test(Table3.1.2)$print()
#'
#' t$type <- "asymp"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
8 changes: 8 additions & 0 deletions R/Page.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#'
#' @aliases rcbd.page
#'
#' @examples
#' t <- pmt(
#' "rcbd.page", alternative = "less"
#' )$test(Table4.4.3)
#'
#' t$type <- "asymp"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
18 changes: 18 additions & 0 deletions R/PairedDifference.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@
#'
#' @aliases paired.difference
#'
#' @examples
#' pmt(
#' "paired.difference",
#' alternative = "greater", scoring = "none", n_permu = 0
#' )$test(Table4.1.1)$print()
#'
#' pmt(
#' "paired.difference", n_permu = 0
#' )$test(Table4.1.3)$print()
#'
#' t <- pmt(
#' "paired.difference", scoring = "rank",
#' alternative = "greater", n_permu = 0
#' )$test(Table4.1.1)$print()
#'
#' t$type <- "asymp"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
12 changes: 12 additions & 0 deletions R/Quantile.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
#'
#' @aliases onesample.quantile
#'
#' @examples
#' pmt(
#' "onesample.quantile", prob = 0.5,
#' null_value = 75, alternative = "greater",
#' type = "asymp", correct = FALSE
#' )$test(Table1.1.1)$print()
#'
#' pmt(
#' "onesample.quantile",
#' prob = 0.25, conf_level = 0.90
#' )$test(Table1.2.1)$conf_int
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
8 changes: 8 additions & 0 deletions R/RCBDOneWay.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#'
#' @aliases rcbd.oneway
#'
#' @examples
#' t <- pmt(
#' "rcbd.oneway", n_permu = 5000
#' )$test(Table4.4.3)$print()
#'
#' t$type <- "asymp"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
6 changes: 6 additions & 0 deletions R/RatioMeanDeviance.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#'
#' @aliases twosample.rmd
#'
#' @examples
#' pmt(
#' "twosample.rmd",
#' alternative = "greater", n_permu = 0
#' )$test(Table2.8.1)$print()
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
6 changes: 6 additions & 0 deletions R/ScoreSum.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#'
#' @aliases twosample.scoresum
#'
#' @examples
#' pmt(
#' "twosample.scoresum", scoring = "expon",
#' alternative = "greater", n_permu = 0
#' )$test(Table2.6.2)$print()
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
8 changes: 7 additions & 1 deletion R/SiegelTukey.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
#'
#' @aliases twosample.siegel
#'
#' @export SiegelTukey
#' @examples
#' pmt(
#' "twosample.siegel",
#' alternative = "greater", n_permu = 0
#' )$test(Table2.8.1)$print()
#'
#' @export
#'
#' @importFrom R6 R6Class

Expand Down
11 changes: 11 additions & 0 deletions R/Sign.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@
#'
#' @aliases paired.sign
#'
#' @examples
#' t <- pmt(
#' "paired.sign",
#' alternative = "greater", n_permu = 0
#' )$test(
#' rep(c(+1, -1), c(12, 5)), rep(0, 17)
#' )$print()
#'
#' t$type <- "asymp"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
20 changes: 20 additions & 0 deletions R/Studentized.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@
#'
#' @aliases multcomp.studentized
#'
#' @examples
#' t <- pmt(
#' "multcomp.studentized", method = "bonferroni"
#' )$test(Table3.3.1)$print()
#'
#' t$type <- "asymp"
#' t
#'
#' t$scoring <- "rank"
#' t
#'
#' t$method <- "tukey"
#' t
#'
#' t$scoring <- "none"
#' t
#'
#' t$type <- "permu"
#' t
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
15 changes: 15 additions & 0 deletions R/Wilcoxon.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@
#'
#' @aliases twosample.wilcoxon
#'
#' @examples
#' pmt(
#' "twosample.wilcoxon",
#' alternative = "greater", n_permu = 0
#' )$test(Table2.1.1)$print()
#'
#' pmt(
#' "twosample.wilcoxon",
#' alternative = "less", n_permu = 0
#' )$test(Table2.6.1)$print()
#'
#' pmt(
#' "twosample.wilcoxon", conf_level = 0.90
#' )$test(Table2.6.2)$conf_int
#'
#' @export
#'
#' @importFrom R6 R6Class
Expand Down
Loading

0 comments on commit 1fdf10c

Please sign in to comment.