public class TestingOnProportion extends Object
| Constructor and Description |
|---|
TestingOnProportion() |
| Modifier and Type | Method and Description |
|---|---|
String |
getSummary() |
void |
report() |
void |
run(String successLabel,
double pHat,
int sampleSize,
double p) |
void |
run(String successLabel,
double pHat,
int sampleSize,
double pNull,
double significanceLevel)
The method return the p-value for both one-tail and two-tails testing of proportion of success for a categorical variable
|
String |
toString() |
boolean |
willRejectH0(double significanceLevel,
boolean twoTails)
The method reject null hypothesis if the p-value calculated from the sample is smaller than the significance level
|
public void run(String successLabel, double pHat, int sampleSize, double p)
public void run(String successLabel, double pHat, int sampleSize, double pNull, double significanceLevel)
pHat - the point estimate $p_{hat}$ of sample proportion $p_{bar}$sampleSize - the sample size of sample drawn from the populationpNull - the null value $p_0$ for true $p$ of the population under $H_0$significanceLevel - the significance level $alpha$ which is usually 0.05public boolean willRejectH0(double significanceLevel,
boolean twoTails)
significanceLevel - the significance level, usually about 0.05twoTails - true if the testing is two tails; false otherwisepublic String getSummary()
public void report()
Copyright © 2017. All rights reserved.