org.statcato.statistics.inferential
Class CI2PopMeanSigmaKnown
java.lang.Object
org.statcato.statistics.inferential.ConfidenceInterval
org.statcato.statistics.inferential.CI2PopMeanSigmaKnown
public class CI2PopMeanSigmaKnown
- extends ConfidenceInterval
Confidence interval class for two population mean,
sigma (population standard deviation) known.
- Since:
- 1.0
- Version:
- %I%, %G%
- Author:
- Margaret Yau
Constructor Summary |
CI2PopMeanSigmaKnown(double confidenceLevel,
int n1,
int n2,
double xBar1,
double xBar2,
double sigma1,
double sigma2)
Constructor |
Method Summary |
double |
criticalValue()
Returns the critical value corresponding to the given confidence level. |
double |
marginOfError()
Returns the margin of error. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CI2PopMeanSigmaKnown
public CI2PopMeanSigmaKnown(double confidenceLevel,
int n1,
int n2,
double xBar1,
double xBar2,
double sigma1,
double sigma2)
- Constructor
- Parameters:
confidenceLevel
- confidence level, between 0 and 1n1
- sample size 1n2
- sample size 2xBar1
- sample mean 1xBar2
- sample mean 2sigma1
- population standard deviation 1sigma2
- population standard deviation 2
marginOfError
public double marginOfError()
- Returns the margin of error.
E = z_(alpha/2) * sqrt(sigma1^2 / n1 + sigma2^2 / n2)
- Specified by:
marginOfError
in class ConfidenceInterval
- Returns:
- margin of error
criticalValue
public double criticalValue()
- Returns the critical value corresponding to the given confidence level.
Uses Student's t distribution to find t_(alpha/2), where alpha is
the significance level (1 - confidence level).
- Specified by:
criticalValue
in class ConfidenceInterval
- Returns:
- critical value