org.statcato.statistics.inferential
Class CIOnePopProp
java.lang.Object
org.statcato.statistics.inferential.ConfidenceInterval
org.statcato.statistics.inferential.CIOnePopProp
public class CIOnePopProp
- extends ConfidenceInterval
Confidence interval class for one population proportion.
- Since:
- 1.0
- Version:
- %I%, %G%
- Author:
- Margaret Yau
Constructor Summary |
CIOnePopProp(double confidenceLevel,
int n,
double p,
int type)
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 |
NORMAL
public static int NORMAL
BINOMIAL
public static int BINOMIAL
CIOnePopProp
public CIOnePopProp(double confidenceLevel,
int n,
double p,
int type)
- Constructor
- Parameters:
confidenceLevel
- confidence level, between 0 and 1n
- sample sizep
- sample proportiontype
- type of distribution for calculating critical value
marginOfError
public double marginOfError()
- Returns the margin of error. E = z_(alpha/2) * sqrt(p*q/n).
- 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 the z distribution to find z_(alpha/2), where alpha is
the significance level (1 - confidence level).
- Specified by:
criticalValue
in class ConfidenceInterval
- Returns:
- critical value