TeachHistHypTest {TeachHist}R Documentation

Histogram to Visualize Hypothesis Tests

Description

The TeachHistHypTest function is a variation of the TeachHistDens function of this package. It generates a histogram with two horizontal axis. One axis displays z-values the other one the dimension of the displayed variable and it is optimized to visualize hypothesis testing.

Usage

TeachHistHypTest(
  NullHyp,
  StandardError,
  SampleMean,
  DegreeFreedom = NULL,
  Confidence = 0.95,
  TestType = "BothTails",
  IsSdEstimated = FALSE,
  NOfSimData = 10000,
  XAxisMax = 5,
  AxisFontSize = 10,
  LabelSize = 3,
  BinWidth = 0.5,
  PrintDensities = FALSE,
  PrintRelFreq = TRUE,
  PlotNormCurv = TRUE,
  RandVarName = "Means",
  SeedValue = NULL
)

Arguments

NullHyp

required! Value for null hypotheses.

StandardError

required!

SampleMean

required! SampleMean is the mean from the research sample to support the alternative/research hypotheses.

DegreeFreedom

required for t-test (IsSdEstimated=TRUE)

Confidence

(default=0.950 Confidence level.

TestType

(default="BothTails") User can also choose TestType="LeftTail" or TestType="RightTail"

IsSdEstimated

(default=FALSE) standard deviation or standard error are known. Set to FALSE, if estimated.

NOfSimData

(default=10000) Number of simulated data points. Higher NOfSimData results in better precision but possibly not all points are considered.

XAxisMax

(default=5) X-axis ranges from negative to positive XAxisMax. If XAxisMax is not high enough, some of the simulated points might not be considered.

AxisFontSize

(default=10) Font size for axis labels.

LabelSize

(default=3) Size of the labels inside the diagram.

BinWidth

(default= 0.51) BinWidth expressed in standard deviations.

PrintDensities

(default=FALSE) Set PrintDensities=TRUE to print densities in the histogram.

PrintRelFreq

(default=TRUE) Set PrintRelFreq=FALSE to suppress the printing of relative frequencies in the histogram.

PlotNormCurv

(default=TRUE) If TRUE normal curve is plotted

RandVarName

(default="Means") Variable name that is plotted in histogram at x-axis.

SeedValue

(default=NULL) Can be any integer and makes simulated points reproducible.

Details

The TeachHistHypTest function upports t-test (IsSdEstimated=TRUE) and z-test (IsSdEstimated=FALSE). It also supports TestType="BothTails", TestType="LeftTail", and TestType="RightTail".

Value

Returns a histogram

Examples

TeachHistHypTest(70,2,77)
TeachHistHypTest(70,2,77, DegreeFreedom = 35,  IsSdEstimated = TRUE)
TeachHistHypTest(70,2,65, DegreeFreedom = 35,  IsSdEstimated = TRUE, TestType = "LeftTail")

[Package TeachHist version 0.2.1 Index]