TeachHistConfInterv {TeachHist} | R Documentation |
Histogram to Visualize Confidence Intervalls
Description
The TeachHistConfInterv 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 confidence intervals.
Usage
TeachHistConfInterv(
SampleMean = 0,
StandardError = 1,
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,
Mean = NULL
)
Arguments
SampleMean |
(default=0) Value for sample mean. |
StandardError |
(default=1) Standard error from sample. |
DegreeFreedom |
(default=NULL) required for t-test (when IsSdEstimated=TRUE) |
Confidence |
(default=0.95) 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.5) 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. |
Mean |
(default=NULL) Value for sample mean. Depreciated. Use SampleMean instead. |
Details
The TeachHistConfInterv function supports confidence intervals based on the t-distribution (IsSdEstimated=TRUE) and the z-distribution (IsSdEstimated=FALSE).
Value
Returns a histogram with confidence interval
Examples
TeachHistConfInterv()
TeachHistConfInterv(SampleMean=2, StandardError=0.2, IsSdEstimated = FALSE)
TeachHistConfInterv(SampleMean=2, StandardError=0.2, DegreeFreedom = 35, IsSdEstimated = TRUE)