plot.htest: Plotting distribution of statistic for object "htest"

Description Usage Arguments Value Examples

View source: R/plot.htest.R

Description

Plotting distribution of statistic for object "htest"

Usage

1
2
## S3 method for class 'htest'
plot(x, ...)

Arguments

x

object of class "htest"

...

further arguments to ggplot

Value

a ggplot or NULL

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require(moonBook)
require(webr)
## chi-square test
x=chisq.test(table(mtcars$am,mtcars$cyl))
plot(x)

#Welch Two Sample t-test
x=t.test(mpg~am,data=mtcars)
plot(x)

x=t.test(BMI~sex,data=acs)
plot(x)

# F test to compare two variances
x=var.test(age~sex,data=acs,alternative="less")
plot(x)

# Paired t-test
x=t.test(iris$Sepal.Length,iris$Sepal.Width,paired=TRUE)
plot(x)

# One sample t-test
plot(t.test(acs$age,mu=63))

# Two sample t-test
x=t.test(age~sex, data=acs,conf.level=0.99,alternative="greater",var.equal=TRUE)
plot(x)

cardiomoon/webr documentation built on May 12, 2020, 4:12 a.m.