org.statcato.statistics.inferential
Class HypothesisTest1Prop
- java.lang.Object
-
- org.statcato.statistics.inferential.HypothesisTest1Prop
-
public class HypothesisTest1Prop extends java.lang.ObjectA hypothesis test for 1 population proportion.- Since:
- 1.0
-
-
Constructor Summary
Constructors Constructor and Description HypothesisTest1Prop(int n, double p, double confidenceLevel, int testType)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringcriticalValue()Returns the critical value corresponding to the given confidence level and type of test.doublepValue(double pHat)Returns the p-value corresponding to pHat in a z distribution.doubletestStatistics(double pHat)Returns the test statistics for the given sample proportion pHat.
-
-
-
Constructor Detail
-
HypothesisTest1Prop
public HypothesisTest1Prop(int n, double p, double confidenceLevel, int testType)Constructor.- Parameters:
n- sample sizep- hypothesized proportionconfidenceLevel- confidence leveltestType- (as defined inHypothesisTest)
-
-
Method Detail
-
testStatistics
public double testStatistics(double pHat)
Returns the test statistics for the given sample proportion pHat.z = (pHat - p) / sqrt(p * (1-p) / n)
- Parameters:
pHat- hypothesized population proportion- Returns:
- test statistic z score
-
criticalValue
public java.lang.String criticalValue()
Returns the critical value corresponding to the given confidence level and type of test. Uses the z distribution.- Returns:
- critical value
- See Also:
HypothesisTest
-
pValue
public double pValue(double pHat)
Returns the p-value corresponding to pHat in a z distribution.- Parameters:
pHat- sample proportion- Returns:
- p-value
-
-
DMelt 3.0 © DataMelt by jWork.ORG