home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / APPS / STATISTI / EPDISK.ZIP / PDEMO < prev    next >
Encoding:
Text File  |  1989-02-14  |  7.4 KB  |  327 lines

  1. ; Demo file for EASIPLOT
  2. ; All lines beginning with a ';' will be ignored
  3.  
  4. ; An 'e' at the start of a line is short for 'echo' - the line will be 
  5. ; copied to the output but there will be no other effect
  6.  
  7. E                         EASIPLOT - DEMONSTRATION
  8. E Welcome to this demonstration of EASIPLOT. EASIPLOT is a 
  9. E graphics package which graphs data from EASISTAT or other 
  10. E programs. 
  11. E This is a demonstration of how EASISTAT works with EASIPLOT
  12. E to produce graphs of EASISTAT's data. Each time EASISTAT 
  13. E pauses to allow you read a message (as now) you can either 
  14. E press 'E' to finish the demonstration, or 'K' to take 
  15. E temporary control at the keyboard, or any other key to allow
  16. E the demonstration to proceed. If you do press 'K' then when
  17. E you want to return to the demonstration type "INPUT CLOSE".
  18. E This demonstration uses data in the file EXAMPLE.DAT, which 
  19. E must be present on the disk for the demonstration to work.
  20. p
  21. E EASIPLOT and EASISTAT are Shareware programs. If you find 
  22. E them useful then please become a registered user by sending
  23. E a cheque for thirty pounds sterling to:
  24. E   ARC Scientific Limited,
  25. E   257 Woodstock Road,
  26. E   Oxford OX2 7AE.
  27. E   Tel. 0865 310167 
  28. E You will receive up-to-date versions of the programs and a 
  29. E full printed manual for EASISTAT. Please pass unmodified 
  30. E copies of these programs on to friends and colleagues 
  31. E together with the other files which are supplied with them.
  32. p
  33. E For further information about how to use EASIPLOT please
  34. E read the file called EASIPLOT.DOC. 
  35. E Now we'll start the demonstration.
  36. E First we read in the data set from the file EXAMPLE.DAT
  37. p
  38. d example.dat
  39. E We'll start by producing a frequency distribution of HDA in
  40. E column 16, a measure of emotional distress. (After all, 
  41. E this program was written by a psychiatrist.)
  42. E To do this we will issue the BASICS command with the G option 
  43. E specified, like this:
  44. E BASICS G C16
  45. p
  46. BASICS G C16
  47. E Now the graph file called GRAPH.ME has been written to 
  48. E disk. Next we will run EASIPLOT to display the graph. The 
  49. E only thing you really need to know is how to quit 
  50. E EASIPLOT, which you do by pressing 'Q' when the graph is 
  51. E displayed. Then you will return to this demonstration. 
  52. E Information about the options available in EASIPLOT are 
  53. E described in the file EASIPLOT.DOC.
  54. E You may wish to hide the menu displayed at the bottom of 
  55. E screen so that you can see the graph properly. To do this 
  56. E press 'M' and to get it back press 'M' again. You may also 
  57. E wish to view this graph as a histogram rather then a line 
  58. E chart. If so press 'V' (for vertical bar chart).
  59. E Press a key (not 'K' or 'E') when you are ready to run 
  60. E EASIPLOT and view the graph.
  61. p
  62. sys easiplot
  63. E Well, you got back here OK. If EASIPLOT didn't work 
  64. E properly then you may need to configure your system and you
  65. E may want to consult the file EASIPLOT.DOC before continuing
  66. E with this demonstation. If you wish to leave the 
  67. E demonstration press 'E', then type QUIT (ENTER) YES (ENTER).
  68. p
  69. E
  70. E Still here? Good.
  71. E Now let's see a breakdown of GHQ scores (more emotional
  72. E distress) by social class. First we use the ANOVA function
  73. E to provide the data in the correct groups, like this:
  74. E ANOVA G C15
  75. E 5
  76. E C5=1
  77. E C5=2
  78. E C5=3
  79. E C5=4
  80. E C5=5
  81. E
  82. E Press a key to continue
  83. p
  84. ANOVA G C15
  85. 5
  86. C5=1
  87. C5=2
  88. C5=3
  89. C5=4
  90. C5=5
  91. E
  92. E Now we'll display the graph. To see the means of each group 
  93. E when the graph is showing press 'R', then '3' then ENTER. 
  94. p
  95. sys easiplot
  96. E Next is a histogram of GHQ cases and non-cases (scores less
  97. E than 12) against social class. We use the CHISQ function to
  98. E provide the data:
  99. E CHISQ G
  100. E 2
  101. E 5
  102. E C15<12
  103. E C15>12
  104. E C5=1
  105. E C5=2
  106. E C5=3
  107. E C5=4
  108. E C5=5
  109. E
  110. E Press a key to continue
  111. p
  112. CHISQ G
  113. 2
  114. 5
  115. C15<12
  116. C15>12
  117. C5=1
  118. C5=2
  119. C5=3
  120. C5=4
  121. C5=5
  122. E Press a key to view the graph. When it is showing 'X' will 
  123. E swap over the groupings and '3' will make the blocks solid.
  124. system easiplot
  125. E
  126. E And now let's use the Kolmogorov Smirnov statistic to 
  127. E compare the age distributions of the GHQ cases and non-cases.
  128. KOLM G C5
  129. C15<12
  130. C15>=12
  131. E
  132. E The graph file contains data about the cumulative 
  133. E frequency of the Age variable in each group, and when the 
  134. E graph is plotted these two frequencies are displayed as the
  135. E default.
  136. p
  137. system easiplot
  138. E
  139. E Now let's try plotting HDA against GHQ. Hopefully they'll 
  140. E correlate fairly well. To provide the graphing data we use 
  141. E the REGRESS function:
  142. E REGRESS G C15 C16
  143. REGRESS G C15 C16
  144. E To view the regression line when the graph is showing press
  145. E 'R', then '1' then ENTER. 
  146. p
  147. sys easiplot
  148. E To finish the demonstration we'll give examples of how 
  149. E EASISTAT can be used to produce graphs of mathematical 
  150. E functions. We can use the first four columns to hold our 
  151. E variables and there are 100 rows.
  152. E Press a key to continue
  153. p
  154. der c1 0
  155. der c2 0
  156. der c3 0
  157. der c4 0
  158.  
  159. fo c1 8 4
  160. fo c2 6 4
  161. fo c3 6 4
  162. fo c4 8 4
  163. label c1 X
  164. label c2 SIN(X)
  165. label c3 COS(X)
  166. E
  167. E Now we'll use EASISTAT to produce the data to plot trigonometric 
  168. E functions.
  169. der c1 6.283*(row-1)/99
  170.        ; 2PI
  171. der c2 sin(c1)
  172. der c3 cos(c1)
  173. E
  174. E Press a key to continue
  175. p
  176. E
  177. E And then we'll output the data to a graph file using the 
  178. E COMPONENTS function:
  179. co g 3
  180. c1
  181. c2
  182. c3
  183. o graph.me
  184. e DATATYPE:XY1,3
  185. e DATATYPE:XY2,3
  186. o close
  187. E That last bit was clever trick to add more information to 
  188. E the graph file. Press a key to see the graphs (they look 
  189. E good as line graphs, press 'L' when they appear).
  190. p
  191. sys easiplot
  192. E We'll try for a pseudo-3D one now. It's called the frilly 
  193. E circle.
  194. fo c4 8 4
  195. label c4 SIN(8*X)
  196. der c4 sin(c1*8)
  197. co g 3
  198. c2
  199. c4
  200. c3
  201. o graph.me
  202. e MINX:-1.5
  203. e MAXX:1.5
  204. e XINC:1
  205. e MINY:-2
  206. e MAXY:2
  207. e YINC:1
  208. o close
  209. E
  210. E Change it to a line graph first by pressing 'L', then to
  211. E see the third dimension press '3'.
  212. p
  213. sys easiplot
  214. E The equation for that curve was:
  215. E   X=SIN(theta)  Y=SIN(8*theta)  and  Z=COS(theta)
  216. E
  217. E We can use the same data in a different way. 
  218. co g 3
  219. c3
  220. c4
  221. c1
  222. o graph.me
  223. e MINX:-1
  224. e MAXX:2
  225. e XINC:1
  226. e MINY:-1
  227. e MAXY:2.5
  228. e YINC:1
  229. o close
  230. E
  231. E Once again change it to a line graph first by pressing
  232. E 'L', then to see the third dimension press '3'. 
  233. p
  234. sys easiplot
  235. E
  236. E That was:
  237. E  X=COS(theta)  Y=SIN(8*theta)  Z=theta
  238. E
  239. E Now we'll rescale the points and make a helix.
  240. der c1 15*(row-1)/99
  241. der c2 sin(c1)
  242. der c3 cos(c1)
  243. co g 3
  244. c2
  245. c3
  246. c1
  247. o graph.me
  248. e MINX:-1
  249. e MAXX:2
  250. e XINC:1
  251. e MINY:-1.5
  252. e MAXY:3
  253. e YINC:1
  254. o close
  255. E
  256. E Again press 'L' and '3'
  257. sys easiplot
  258. E
  259. E Now here's one of the normal distribution. It involves a 
  260. E bit of number crunching because EASISTAT has to work out 
  261. E some of the probabilities long-hand:
  262. der c1 (row-50)/20
  263. label c2 PHI(X)
  264. der c2 pn(c1)
  265. label c3 p(X)
  266. der c3 exp(0-c1*c1/2)/((3.14159*2) POW 0.5)
  267. co g 3
  268. c1
  269. c2
  270. c3
  271. o graph.me
  272. e DATATYPE:XY1,3
  273. o close
  274. sys easiplot
  275.  
  276. E OK that's all for now.
  277. E The demonstration is finishing, leaving you in control of 
  278. E EASISTAT. To leave EASISTAT type:
  279. E QUIT
  280. E YES
  281. E Please read the file called EASIPLOT.DOC to learn more 
  282. E about EASIPLOT. If you like it then please become a 
  283. E registered user.
  284. E ARC Scientific Limited,
  285. E 257 Woodstock Road,
  286. E Oxford OX2 7AE.
  287.  
  288.