BoxPlot: Boxplot with confidence interval and ANOVA on the plot.

Description Usage Arguments Examples

View source: R/BoxPlot.R

Description

classical boxplot function improved with integrated confidence level on the mean for each group ploted on the graph and also ANOVA with p-value and its interpretation given in the legend.

Usage

1
2
BoxPlot(num, grp = NULL, data = NULL, AnoVa = TRUE, risk = 0.05,
  lang = c("en", "fr"), verbose = TRUE, ...)

Arguments

num

a numeric vector to plot boxplot(num~grp). Represents the value that will be compared between the groups.

grp

a qualitative vector (factor) to plot boxplot(num~grp). Represents the groups we will compare.

data

a data.frame (or list) from which the variables in formula should be taken.

AnoVa

boolean to compute or not anova (when multiple groups) to see if they differ in mean.If false the Kruskal-Wallis Rank Sum test is computed instead.

risk

the risk value used for confidence intervals.

lang

lingustic parameter to specify the language of the legend

verbose

boolean to make a test and print the result in the subtitle

...

Other graphical parameters

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
    ## Not run: 
require(CorReg)
repart=c(20,40,40)
X=data.frame(num=c(rnorm(repart[1],10,1),rnorm(repart[2],11,1),rnorm(repart[3],10,1)),
grp=c(rep("A",times=repart[1]),rep("B",times=repart[2]),rep("C",times=repart[3])))


BoxPlot(X$num,X$grp,data=X,ylab="num",main="boxplot with confidence intervals")
#Confidence interval in red with mean in blue.


## End(Not run)

Example output

$stats
          [,1]     [,2]      [,3]
[1,]  8.972003  9.48389  7.768373
[2,]  9.861860 10.09037  9.520371
[3,] 10.294564 10.82923 10.075042
[4,] 10.658600 11.38505 10.748523
[5,] 11.546797 12.84429 12.274751

$n
[1] 20 40 40

$conf
         [,1]     [,2]      [,3]
[1,] 10.01308 10.50580  9.768225
[2,] 10.57605 11.15267 10.381859

$out
[1]  7.887493  7.691353 13.701420 13.647281

$group
[1] 1 1 2 3

$names
[1] "A" "B" "C"

$pval
[1] 0.006581956

$confint
           [,1]     [,2]      [,3]
upper 10.573863 11.17471 10.550863
mean  10.137825 10.87206 10.199690
lower  9.701788 10.56942  9.848517

$risk
[1] 0.05

CorReg documentation built on Sept. 6, 2019, 3 a.m.