
Plots to illustrate Normal Approximation to the Binomial---hypothesis tests or confidence intervals.
normalApproxBinomial(p0= if (number.vars==1) .5 else 0,
p1=NA, p2=NA,
p.hat=if (number.vars==1) .75 else 0,
n=1,
xlim=if (number.vars==1) c(0,1) else c(-1,1),
ylim=c(0, 5),
type=c("hypothesis","confidence"),
alpha.left=if (type=="hypothesis") 0 else .025,
alpha.right=if (type=="hypothesis") .05 else .025,
xlab=if (number.vars==1)
"w = p = population proportion"
else
"w = p[1] - p[2] :: population proportions", ...,
number.vars=if (!is.na(p1) && !is.na(p2)) 2 else 1)
Null hypothesis value of
Alternate hypothesis value of
Second sample value of
Observed value of
Number of observations (for example, number of coins tossed).
Standard xyplot
arguments...
"hypothesis" for a Hypothesis Test graph, or "confidence" for a Confidence Interval graph.
Additional arguments forwarded to NTplot
.
Number of variables. 1 for a one-sample test, 2 for two-sample tests and paired tests.
"trellis"
object.
This is a wrapper function for the plots in NTplot
.
# NOT RUN {
NTplot(distribution.name="binomial", n=20, ylim=c(0,4.2), p1=.8)
NTplot(distribution.name="binomial", n=20, type="confidence", ylim=c(0,4.2))
# }
# NOT RUN {
NTplot(distribution.name="binomial", n=20, zaxis=TRUE, z1axis=TRUE,
p1=.8678, ylim=c(0, 5.2))
NTplot(p0=.4, p.hat=.65, p1=.7, distribution.name="binomial", n=15)
NTplot(p.hat=.65, distribution.name="binomial", n=15, type="confidence")
# }
# NOT RUN {
## these are interactive and won't work in R CMD check
if (interactive())
NTplot(distribution.name="binomial", n=20, ylim=c(0,4.2), p1=.8, shiny=TRUE)
if (interactive())
NTplot(p0=.4, p.hat=.65, p1=.7, distribution.name="binomial", n=15, shiny=TRUE)
if (interactive())
NTplot(p.hat=.65, distribution.name="binomial", n=15, type="confidence", shiny=TRUE)
# }
Run the code above in your browser using DataLab