- Notifications
You must be signed in to change notification settings - Fork5
Visualise the Results of Inferential Statistics using 'ggplot2'
License
okgreece/gginference
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Visualise the results of F test to compare two variances, Student’st-test, test of equal or given proportions, Pearson’s chi-squared testfor count data and test for association/correlation between pairedsamples.
# CRAN installation:install.packages("gginference")# Or the development version from GitHub:# install.packages("devtools")devtools::install_github("okgreece/gginference")
The rejection regions for one sample t-test with normal population andσ2 unknown are calculated usingggttest function. Thefollowing table shows the rejection regions which is calculated withgginference depending the specified parameters int.test.
| H0 | H1 | Rejection Region ofgginference | Parameters oft.test |
|---|---|---|---|
| μ = μ0 | μ < μ0 | R = {z < − za} |
|
| μ > μ0 | R = {z > za} |
| |
| μ ≠ μ0 | R = {|z| > za/2} |
|
where
ggttest is also used to calculate rejection region for one samplet-test with normal population and n < 30 and σ2 unknown.
| H0 | H1 | Rejection Region ofgginference | Parameters oft.test |
|---|---|---|---|
| μ = μ0 | μ < μ0 | R = {t < − tn − 1, a} |
|
| μ > μ0 | R = {t > tn − 1, a} |
| |
| μ ≠ μ0 | R = {|t| > tn − 1, a/2} |
|
where
Next table shows the rejection regions of two independent samples t-testwith normal populations and σ12 =σ22.ggttest is also used to visualize thistest.
| H0 | H1 | Rejection Region ofgginference | Parameters oft.test |
|---|---|---|---|
| μ1 − μ2 = d0 | μ1 − μ2 < d0 | R = {t < − tn1 + n2 − 2, a} |
|
| μ1 − μ2 > d0 | R = {t > tn1 + n2 − 2, a} |
| |
| μ1 − μ2 ≠ d0 | R = {|t| > tn1 + n2 − 2, a/2} |
|
where
ggttest is used to visualize two independent samples t-test withnormal populations and σ12
σ22. The followingtable shows the rejection regions of this test.
| H0 | H1 | Rejection Region ofgginference | Parameters oft.test |
|---|---|---|---|
| μ1 − μ2 = d0 | μ1 − μ2 < d0 | R = {t < − tν, a} |
|
| μ1 − μ2 > d0 | R = {t > tν, a} |
| |
| μ1 − μ2 ≠ d0 | R = {|t| > tν, a/2} |
|
where
and ν degrees of freedom with
ggttest is used also to visualize the results of the paired sampleStudent’s t-test. Next table shows th rejection region of this test.
| H0 | H1 | Rejection Region ofgginference | Parameters oft.test |
|---|---|---|---|
| μ1 − μ2 = d0 | μ1 − μ2 < d0 | R = {t < − tn − 1, a} |
|
| μ1 − μ2 > d0 | R = {t > tn − 1, a} |
| |
| μ1 − μ2 ≠ d0 | R = {|t| > tn − 1, a/2} |
|
where
ggproptest() is used to visualize one-proportion z-test. The rejectionregions are shown below.
| H0 | H1 | Rejection Region ofgginference | Parameters ofprop.test() |
|---|---|---|---|
| p = p0 | p < p0 | R = {z < − za} |
|
| p > p0 | R = {z > za} |
| |
| p ≠ p0 | R = {|z| > za/2} |
|
where
The results of two-proportion z-test are visualized usingggproptest()and next table shows the rejection regions.
| H0 | H1 | Rejection Region ofgginference | Parameters ofprop.test() |
|---|---|---|---|
| p1 − p2 = d0 | p1 − p2 < d0 | R = {z < − za} |
|
| p1 − p2 > d0 | R = {z > za} |
| |
| p1 − p2 ≠ d0 | R = {|z| > za/2} |
|
where
ggvartest is used to visualize the results of the paired sampleStudent’s t-test. The rejection region that is used in this test isshown below.
| H0 | H1 | Rejection Region ofgginference | Parameters ofvar.test |
|---|---|---|---|
| σ12 / σ22 = 1 | σ12 / σ22 < 1 | R = {F > Fn1 − 1, n2 − 1, 1 − a} |
|
| σ12 / σ22 > 1 | R = {F > Fn1 − 1, n2 − 1, a} |
| |
| σ12 / σ22≠ 1 | R = {F > Fn1 − 1, n2 − 1, a/2} |
|
where
ggcortest is usesd to visualize the results of test for correlationbetween paired samples. The following table shows the rejection regionof this test.
| H0 | H1 | Rejection Region ofgginference | Parameters ofcor.test |
|---|---|---|---|
| 𝜚 = 0 | 𝜚 ≠ 0 | R = {|t| > tn − 2, a/2} |
|
where
The results of Pearson’s chi-squared test for count data are visulizedusingggchisqtest. Next table shows the rejection region of this test.
| H0 | H1 | Rejection Region ofgginference | Parameters ofchisq.test |
|---|---|---|---|
| Two variables are independent | Two variables are not independent | R = {X2 > χa/22} |
|
where
ggaov is used to visualize the results of ANOVA F-test. Table belowshows rejection region of Anova F-stest.
| H0 | H1 | Rejection Region ofgginference | Parameters ofaov |
|---|---|---|---|
| H0 : μ1 = μ2=... = μk | Not all three population means are equal | R = {F > Fk − 1, n − k, a} |
|
where
If you encounter a bug, please feel free to open anissue with a minimalreproducible example.
About
Visualise the Results of Inferential Statistics using 'ggplot2'
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.
















