Learn R Programming

NNS (version 11.5)

NNS.ANOVA: NNS ANOVA: Nonparametric Analysis of Variance

Description

Performs a distribution-free ANOVA using partial moment statistics to evaluate differences between control and treatment groups. Returns a certainty metric (0-1) indicating separation likelihood rather than traditional p-values. Includes bootstrapped effect size bounds.

Usage

NNS.ANOVA(
  control,
  treatment,
  means.only = FALSE,
  medians = FALSE,
  confidence.interval = 0.95,
  tails = "Both",
  pairwise = FALSE,
  plot = TRUE,
  robust = FALSE
)

Value

Returns a list containing:

  • Control_Statistic: Mean/median of control group

  • Treatment_Statistic: Mean/median of treatment group

  • Grand_Statistic: Grand mean/median

  • Control_CDF: CDF value at grand statistic (control)

  • Treatment_CDF: CDF value at grand statistic (treatment)

  • Certainty: Separation certainty (0-1)

  • Effect_Size_LB: Lower bound of treatment effect (if CI requested)

  • Effect_Size_UB: Upper bound of treatment effect (if CI requested)

  • Confidence_Level: Confidence level used (if CI requested)

Arguments

control

Numeric vector of control group observations

treatment

Numeric vector of treatment group observations

means.only

Logical; FALSE (default) uses full distribution analysis. Set TRUE for mean-only comparison

medians

Logical; FALSE (default) uses means. Set TRUE for median-based analysis

confidence.interval

Numeric [0,1]; confidence level for effect size bounds (e.g., 0.95)

tails

Character; specifies CI tail(s): "both", "left", or "right"

pairwise

logical; FALSE (default) Returns pairwise certainty tests when set to pairwise = TRUE.

plot

Logical; TRUE (default) generates distribution plot

robust

logical; FALSE (default) Generates 100 independent random permutations to test results, and returns / plots 95 percent confidence intervals along with robust central tendency of all results for pairwise analysis only.

Author

Fred Viole, OVVO Financial Systems

References

Viole, F. and Nawrocki, D. (2013) "Nonlinear Nonparametric Statistics: Using Partial Moments" (ISBN: 1490523995)

Viole, F. (2017) "Continuous CDFs and ANOVA with NNS" tools:::Rd_expr_doi("10.2139/ssrn.3007373")

Examples

Run this code
 if (FALSE) {
### Binary analysis and effect size
set.seed(123)
x <- rnorm(100) ; y <- rnorm(100)
NNS.ANOVA(control = x, treatment = y)

### Two variable analysis with no control variable
A <- cbind(x, y)
NNS.ANOVA(A)

### Medians test
NNS.ANOVA(A, means.only = TRUE, medians = TRUE)

### Multiple variable analysis with no control variable
set.seed(123)
x <- rnorm(100) ; y <- rnorm(100) ; z <- rnorm(100)
A <- cbind(x, y, z)
NNS.ANOVA(A)

### Different length vectors used in a list
x <- rnorm(30) ; y <- rnorm(40) ; z <- rnorm(50)
A <- list(x, y, z)
NNS.ANOVA(A)
}

Run the code above in your browser using DataLab