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.
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
)Returns a histogram with confidence interval
(default=0) Value for sample mean.
(default=1) Standard error from sample.
(default=NULL) required for t-test (when IsSdEstimated=TRUE)
(default=0.95) Confidence level.
(default="BothTails") User can also choose TestType="LeftTail" or TestType="RightTail"
(default=FALSE) standard deviation or standard error are known. Set to FALSE, if estimated.
(default=10000) Number of simulated data points. Higher NOfSimData results in better precision but possibly not all points are considered.
(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.
(default=10) Font size for axis labels.
(default=3) Size of the labels inside the diagram.
(default= 0.5) BinWidth expressed in standard deviations.
(default=FALSE) Set PrintDensities=TRUE to print densities in the histogram.
(default=TRUE) Set PrintRelFreq=FALSE to suppress the printing of relative frequencies in the histogram.
(default=TRUE) If TRUE normal curve is plotted
(default="Means") Variable name that is plotted in histogram at x-axis.
(default=NULL) Can be any integer and makes simulated points reproducible.
(default=NULL) Value for sample mean. Depreciated. Use SampleMean instead.
The TeachHistConfInterv function supports confidence intervals based on the t-distribution (IsSdEstimated=TRUE) and the z-distribution (IsSdEstimated=FALSE).
TeachHistConfInterv()
TeachHistConfInterv(SampleMean=2, StandardError=0.2, IsSdEstimated = FALSE)
TeachHistConfInterv(SampleMean=2, StandardError=0.2, DegreeFreedom = 35, IsSdEstimated = TRUE)
Run the code above in your browser using DataLab