home *** CD-ROM | disk | FTP | other *** search
- # include <stdio.h>
- # include <math.h>
- # include "miscio.h"
- # include "sumstats.h"
-
-
- float storedata[10][2];
- float sales[10];
- int numobs;
- int numiv;
- int i;
- int numcol;
- float minima[10];
- float maxima[10];
- float range[10];
- float sumxx[10];
- float mean[10];
- float variance[10];
- float stddev[10];
- float semean[10];
- float mode[10];
-
-
-
- main()
- {
- storedata[0][0] = 305.0;
- storedata[0][1] = 35.0;
- storedata[1][0] = 130.0;
- storedata[1][1] = 98.0;
- storedata[2][0] = 189.0;
- storedata[2][1] = 83.0;
- storedata[3][0] = 175.0;
- storedata[3][1] = 76.0;
- storedata[4][0] = 101.0;
- storedata[4][1] = 93.0;
- storedata[5][0] = 269.0;
- storedata[5][1] = 77.0;
- storedata[6][0] = 421.0;
- storedata[6][1] = 44.0;
- storedata[7][0] = 195.0;
- storedata[7][1] = 57.0;
- storedata[8][0] = 282.0;
- storedata[8][1] = 31.0;
- storedata[9][0] = 203.0;
- storedata[9][1] = 92.0;
- numobs = 10;
- numiv = 2;
- SummaryStats(&storedata[0][0],numobs,numiv,minima,maxima,range,sumxx,mean,variance,stddev,semean,mode);
- for ( i = 0; i <= numiv-1; ++i ) {
- printf("summary statistics FOR storedata\n");
- printf(" variable #%d\n", i);
- printf("number OF observations = %4d\n", numobs);
- printf("minima = %8.3f\n", minima[i]);
- printf("maxima = %8.3f\n", maxima[i]);
- printf("range = %8.3f\n", range[i]);
- printf("mean = %8.3f\n", mean[i]);
- printf("sum = %8.3f\n", sumxx[i]);
- printf("variance = %8.3f\n", variance[i]);
- printf("standard deviation = %8.3f\n", stddev[i]);
- printf("standard error OF mean = %8.3f\n", semean[i]);
- printf("mode = %8.3f\n", mode[i]);
- printf("\n");
- }
- printf( "press carriage return TO END PROGRAM. ");
- scanf("");
- }