Implement a set of statistics registers in the style of a pocket calculator.
The available routines are:
def Clear(): clear the stats registers
def Show(): print the contents of the stats registers
def Add(x, y): add an X,Y pair
def Subtract(x, y): remove an X,Y pair
def AddWeighted(x, y, z): add an X,Y pair with weight Z
def SubtractWeighted(x, y, z): remove an X,Y pair with weight Z
def Mean(): arithmetic mean of X & Y
def StdDev(): standard deviation on X & Y
def StdErr(): standard error on X & Y
def LinearRegression(): linear regression
def LinearRegressionVariance(): est. errors of slope & intercept
def LinearRegressionCorrelation(): the regression coefficient
def CorrelationCoefficient(): relation of errors in slope & intercept
| see: | http://stattrek.com/AP-Statistics-1/Regression.aspx?Tutorial=Stat |
|---|
pocket calculator Statistical Registers, Pete Jemian, 2003-Apr-18
pocket calculator Statistical Registers class
add an X,Y pair to the statistics registers
| Parameters: |
|
|---|
add a weighted X,Y+/Z trio to the statistics registers
| Parameters: |
|
|---|
relation of errors in slope and intercept
| Returns: | correlation coefficient |
|---|---|
| Return type: | float |
Evaluate a linear fit at the given value: 
| Parameters: | x (float) – independent value, x |
|---|---|
| Returns: | y |
| Return type: | float |
For (x,y) data pairs added to the registers, fit and find (a,b) that satisfy:

| Returns: | (a, b) for fit of y=a+b*x |
|---|---|
| Return type: | (float, float) |
the regression coefficient
| Returns: | (corr_a, corr_b) – is this correct? |
|---|---|
| Return type: | (float, float) |
| See: | http://stattrek.com/AP-Statistics-1/Correlation.aspx?Tutorial=Stat Look at “Product-moment correlation coefficient” |
est. errors of slope & intercept
| Returns: | (var_a, var_b) – is this correct? |
|---|---|
| Return type: | (float, float) |
standard deviation on X & Y
| Returns: | standard deviation of mean X and Y values |
|---|---|
| Return type: | (float, float) |
standard error on X & Y
| Returns: | standard error of mean X and Y values |
|---|---|
| Return type: | (float, float) |
remove an X,Y pair from the statistics registers
| Parameters: |
|
|---|