Scilab programs for Classical Statistics
In this page you can access the programs solving elementary tasks for
Statistics.
The programs are divided into groups:
1. _func some basic auxiliary
functions
2. st1Desc descriptive statistics (describe
measured data)
3. st2Int confidence intervals
(range for estimated parameter)
4. st3Test Tests of hypotheses (probability
that the estimate is correct)
5. st4Anal Analysis of data (ANOVA and regression
analysis)
After extraction you can find the directory SciStat.
In this directory, you will find the above-mentioned directories with
programs for individual areas.
Examples of statistical program usage are in the directory Help2func -
they begin with T_. If you wish to
use a program, it is recommended to start with the corresponding T_ program
and simply modify
it according to your needs. For your convenience, help is available directly
in the statistical program.
To display it, enter the program name without any arguments.
A set of examples (to be solved in exercises) can be found in the directory
Examples.
Here is the list of statistical
programs and here are the
programs in alphabetical order.
How to use the programs.
From the example given, it is necessary to
- Decide whether the task is confidence interval, test, ANOVA,
regression.
- Determine the type of variable (continuous or discrete)
- What should be estimated/tested (expectation, variance, regression
etc.)
- Determine the direction of interval/test (left, both, right).
- Decide about confidence level (alpha)
- Determine the size of the sample.
- Formulate zero hypothesis H0 and the alternative HA.
- Compute p-value
- If p-value is smaller the alpha, reject H0, if it is greater, do not
reject.
Example
The products should have average weight 1.2 kg. On the basis of a sample
of 30 products,
test average weight on the level of confidence alpha = 0.05.
Solution
- The task is testing.
- The variable is continuous (weight of the product).
- Expectation is to be tested.
- The direction is both (the weight can be less or greater).
- Confidence level is 0.05.
- The sample size is 30.
- H0: The average weight is 1.2 kg; HA: the average weight is not 1.2 kg
(is larger or smaller).
- For p-value we use the function
p-value=t_test(x,m0,alt),
where x is the sample, m0 is the average according to the zero
hypothesis mo = 1.2,
alt is the direction alt = <>. The result is pv = 1*10^(-6).
- The H0 is rejected. The average weight of products is not 1.2 kg.
Program
exec("ScIntro.sce",-1), mode(2)
x=[1.2
0.8 0.9
1.4 0.8
0.9 1
0.9 1.1
0.9...
0.9 1
0.8 1.1
0.9 1.3
0.8 1.1
1.4 0.8...
1.2
0.8 0.9
0.7 1.1
0.9 1.3
0.8 0.9
1];
m0=1.2;
alt='<>';
[pval,t,df]=t_test(x,m0,alt)
How to set data
- plain data
x - sample
- sorted data
x.d - data
x.f - frekvencies
- computed moments
x.m - average / ratio
x.v - variance
x.n - count