# The equations describe the formulae for an confidence interval of the mean
e <- equations(o~x+c*s/sqrt(n), "v_o=\\bar{x}+c\\cdot\\frac{s^2}{n}",
u~x-c*s/sqrt(n), "v_u=\\bar{x}-c\\cdot\\frac{s^2}{n}",
e~c*s/sqrt(n), "e =c\\cdot\\frac{s^2}{\\sqrt{n}}",
l~2*e, "l =2\\cdot e"
)
e <- variables(e,
x=0, "\\bar{x}",
c=2.58, dbl(2),
s=1, pos(5), "s^2",
n=25, pos(5),
l=pos(5),
e=pos(5),
u="v_u", o="v_o")
print(e)
# Find the confidence interval length
ns <- num_solve('l', e)
# Compute everything that is possible
ns <- num_solve('', e)
toLatex(ns)
Run the code above in your browser using DataLab