home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
educ
/
pstat1.zip
/
SIMCORR.DOC
< prev
Wrap
Text File
|
1986-12-17
|
5KB
|
103 lines
SIMCORR
Joseph C. Hudson
4198 Warbler Dr. Flint, MI 48504
Simcorr produces pseudo-ramdom samples from a bivariate
normal population. The main use of this program is to illustrate
the meaning of the correlation coefficient. Simcorr can help
develop a feeling for the variability in the relationship
between the population and sample correlation coefficients. The
amount of variability might suprize some.
Simcorr was written using the Turbo Graphics Toolbox to
generate graphs of the simulated samples. Two files from this
toolbox must be present when Simcorr is run. These are the error
message and 4x6 font files. To keep things together, these files
have been renamed SIMCORR.MSG and SIMCORR.FON. They must be
on the default drive when SIMCORR is run. When you type SIMCORR
with these two files and SIMCORR.COM on the default drive, the
following screen begins to develop:
________________________________________________________________
Sampling from a Bivariate Normal Population
Mean of X: 0.00 Stan Dev of X: 1.00
Mean of Y: 100.00 Stan Dev of Y: 10.00
Correlation: 0.20 Sample Size: 45
Observed XBar: 0.2431 Obs S. D. of X: 0.8376
Observed YBar: 101.6787 Obs S. D. of Y: 9.1961
Obs Correlation: 0.1646 Output Files: c:simco
Z statistic: 0.2376 Prob of larger |Z|: 0.8122
You may now type
G to see graph,
N to give a name for output files
S to save random data to disk
Q to quit
When the graph is on screen, you may type:
N to give a name for output files
S to save graph to disk
P to redo with new parameters
D to redo with same parameters, new rndm data, see this screen
G to redo with same parameters, new rndm data, see graph only
Q to quit
________________________________________________________________
Simcorr Page 2
The user enters the first 6 numbers shown.generates the
rest of the screen. The standard deviations must be positive,
and the correlation must be between -1 and 1. Sample size must
be at least 4 and at most 110. If you want to save either the
simulated data or a graph to disk, you must use "N" to
give a name for the output files. A name of 5 characters or
less must be specified. You can specify a dirve designator if
you wish. The program will add the characters SDA to data file
names and GRF to graph files. File extensions begin with .001
and progress upward with succeeding saves. If you change names,
the numbered extensions begin over at .001.
The second block of numbers are computed by the program
from the random sample. The last row of this block shows the Z
statistic and the prob value for an approximate hypothesis test
that the sample comes from a population with the correlation
that you specified against the alternate hypothesis that the
correlation is some other value. Snedecor and Cochran [1, p186]
discuss this test.
The graph shows the scatter plot of the random sample and
the population regression line. The center of the graph is the
center of the population, (MuX, MuY). The graph shows 4 standard
deviations on either side of each mean. Note that this is the
population regression line, not the sample regression line. If
both population standard deviations are 1, the slope of the
line is the correlation you specified, not the computed
correlation from the sample. If the prob value is low, you
should notice a marked difference between the line drawn and
the sample regression line, which you can imagine drawn through
the center of the scatter of points with slope the sample
correlation.
The menu does not appear when the graph is on screen, so
you have to remember the commands. The important ones are P, D,
and G. Using P starts everything over again. D generates new
data and lets you see the summary statistics. G generates new
data and skips the summary screen, going directly to the graph
after the data is generated.
The source code is included on the disk. Many references
are made to Turbo Graphics Toolbox routines, so the source will
not be too useful without this. SIMCORR.PAS is placed in the
public domain with no promises of accuracy or appropriateness
for any purpose. If you use the code in your application, I
would appreciate attribution.
Reference
1. Snedecor, G.W. and W.C. Cochran, Statistical Methods, Sixth
Edition, Iowa State University Press, Ames, Iowa, 1976.
nedecor, G.W