home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / statstcs / mystat.arc / MYSTAT.TXT < prev    next >
Text File  |  1987-02-15  |  21KB  |  576 lines

  1. @  0 18
  2.              MYSTAT, the personal version of SYSTAT
  3.  
  4. MYSTAT has commands that let you enter, transform and analyze data.
  5. To use a command, simply type the name of the command, the options
  6. you wish and hit the [Enter] key.  For example, to begin this 
  7. introduction you typed the INTRO command name and hit the [Enter] key.
  8.  
  9. >INTRO [Enter]
  10.  
  11. You can abbreviate command names and options to just the first two characters
  12. and use upper and lower case letters interchangeably.  Thus you could just as
  13. well have typed
  14.  
  15. >in [Enter]
  16.  
  17. to start this introductory tutorial.  One exception to this rule is the
  18. STEM command, which requires a minimum of STE to distinguish it from STATS.
  19. @ 18  6
  20. If a command is too long to fit on a single line, end the first line with a
  21. comma, hit [Enter], and continue the command on the next line.  For example
  22.  
  23. >stats pop rainfall / mean sd skewness kurtosis minimum maximum , [Enter]
  24. >range variance sem sum [Enter]
  25. @  6  5
  26.                         *** MYSTAT Menu ***
  27.  
  28. MYSTAT displays the names of all the commands you can use on a menu.
  29. We reproduce this menu on the next screen.  
  30. @  5 23
  31.  MYSTAT   A Personal Version of SYSTAT
  32.  
  33.    >>>>>>>>>>  DEMO        HELP        INTRO       SYSTAT      <<<<<<<<<<
  34.    ----------  ----------  ----------  ----------  ----------  ----------
  35.    EDIT        USE         SAVE        PUT         SORT        RANK
  36.    SUBMIT      OUTPUT      NOTE        FORMAT      MENU        CHAR
  37.    NAMES       WEIGHT      -           -           -           -  
  38.    ----------  ----------  ----------  ----------  ----------  ----------  
  39.    PLOT        TPLOT       HISTOGRAM   BOX         STEM        TTEST
  40.    STATS       TABULATE    PEARSON     SIGN        WILCOXON    FRIEDMAN
  41.    KS          CATEGORY    MODEL       ESTIMATE    QUIT
  42.  
  43.  
  44.  
  45.  
  46.     >
  47.  
  48.  
  49.  
  50.  
  51.  
  52.           Enter HELP or other command.  QUIT returns you to DOS.
  53. @ 23 18
  54. To find out what one of these commands does or how to specify it, use the HELP
  55. command.  Just type the word HELP and hit [Enter].
  56.  
  57. >HELP [Enter]
  58.  
  59. MYSTAT will display very short descriptions of all commands.  To obtain more
  60. information about a particular command, type HELP and the name of the command.
  61. MYSTAT then will display a description of the command, a syntax description
  62. of the command and one or more examples of typical uses of the command.
  63. Comments on the examples appear in parentheses (...).
  64. After you read the help description, hit [Enter] to return to the menu.
  65.  
  66. For example, to learn about the USE command, type
  67.  
  68. >HELP USE [Enter]
  69.  
  70. MYSTAT then would display the following screen
  71. @ 18 10
  72. The USE command reads the variables in a MYSTAT file.
  73.  
  74. USE <file>
  75.  
  76. Example:
  77.  
  78. USE MYDATA  (reads from MYDATA.SYS in default drive/directory)
  79. USE B:MYDATA (reads MYDATA.SYS from B: drive)
  80. USE '\SYSTAT\NEWDATA.SYS' (fully qualified names must have .SYS extension)
  81. @ 10 16
  82. In syntax descriptions
  83.  
  84. <file>  means any valid MYSTAT file name.  Basic MYSTAT file names are one
  85.         to eight letters and/or numerals, beginning with a letter.
  86.         You can append a drive letter to a file name.  MYSTAT assumes
  87.         a file extension of .SYS for system data files.  If you specify a
  88.         fully qualified file name, it must appear in quotes and include the
  89.         .SYS extension.  On a floppy-only system, it's best to leave the
  90.         working disk in drive A: and USE and SAVE all data from drive B:
  91.  
  92.         MYDATA
  93.         'MYDATA.SYS'
  94.         B:NEWDATA
  95.         'B:NEWDATA.SYS'
  96.         '\DATADIR\MYDATA.SYS'
  97. @ 16  6
  98. Next, one could ask about the STATS command.
  99.  
  100. >HELP STATS
  101.  
  102. which would produce the following screen.
  103. @  6 17
  104.       The STATS command produces basic statistics.  If you
  105.       choose no options, it will produce N,  MINIMUM,  MAXIMUM,
  106.       MEAN,  SD.   Otherwise, it will produce just the option(s)
  107.       you choose.  If you use BY to get subgroup statistics, the
  108.       file must be sorted by the grouping variable(s) and BY must
  109.       follow all statistics options.
  110.  
  111.       STATS [<var1>,<var2>,<...>]
  112.         [/MEAN,SD,SKEWNESS,KURTOSIS,MINIMUM,MAXIMUM,RANGE,VARIANCE,SEM,SUM]
  113.           [BY <var3>,<var4>,<...>]
  114.  
  115.       Examples:
  116.  
  117.       STATS  (basic statistics for whole file)
  118.       STATS VAR1,VAR2 / SEM (standard error of the mean)
  119.       STATS / BY GROUPS (basic statistics for cases in each group)
  120. @ 17 21
  121. In syntax descriptions
  122.  
  123. [...]   brackets enclose optional specifications
  124.  
  125. <var>   means any valid MYSTAT variable name.  MYSTAT variable names
  126.         are one to eight letters and/or numerals, and/or underscores
  127.         beginning with a letter.  If a variable contains character
  128.         instead of numeric data, follow the name with a $.  Values of
  129.         character variables may contain up to 12 digits.  MYSTAT also
  130.         provides singly subscripted numeric variables with subscripts
  131.         up to 99.
  132.  
  133.         VAR_1        numeric variable
  134.         NAME$        character variable
  135.         MEASURE(3)   subscripted numeric variable
  136.         ITEM(1-5)    range for a subscripted variable,
  137.                      i.e.  ITEM(1)...ITEM(5)
  138.  
  139. [<var1>,<var2>,<...>] means an optional list of variable names.  If you
  140.         omit this MYSTAT will use all the numeric variables in the file.
  141. @ 21 11
  142. Having learned the syntax and use of the commands with HELP, we'll
  143. employ USE and STATS to obtain some descriptive statistics on data in 
  144. the CITIES.SYS file created by DEMO.
  145. We type
  146.  
  147. >USE CITIES [Enter]
  148.  
  149. This tells MYSTAT to read the data from a MYSTAT file named CITIES.SYS from
  150. the default disk drive/directory. In response, MYSTAT clears the screen and
  151. displays the names of all the variables in the file.
  152. @ 11 20
  153. VARIABLES IN MYSTAT FILE ARE:
  154.      CITY$         STATE$            POP          RAINFALL       LOGPOP
  155.  
  156.  
  157. DATA IS STORED IN SINGLE PRECISION
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171. Press ENTER <-' or RETURN
  172. @ 20 16
  173. From this display one can see that there are five variables in the file.
  174. Three are numeric and CITY$ and STATE$ are character.  There are no array
  175. variables. This file stores data in single precision (approximately 9
  176. decimal digits).  This option was chosen when this file was created.  The
  177. storage option (single or double precision) does not affect computations,
  178. which always uses double precision arithmetic (at least 15 digits precision).
  179.  
  180. After one presses [Enter], MYSTAT returns to the menu.  One then can
  181. enter the STATS command.    In DEMO, we showed the output for STATS
  182. with no options.  Here, we type
  183.  
  184. >STATS RAINFALL / MEAN SD RANGE [Enter]
  185.  
  186. This command requests the mean, standard deviation, and range of one 
  187. variable, rainfall.  This produces the output in the next screen
  188. @ 16 19
  189.  TOTAL OBSERVATIONS:    8
  190.  
  191.  
  192.                       RAINFALL
  193.  
  194.    N OF CASES                8
  195.    MEAN                 35.520
  196.    STANDARD DEV         18.032
  197.    RANGE                52.210
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  Press ENTER <-' or RETURN
  207. @ 19  8
  208. After you press [Enter], MYSTAT returns to the menu.  Type the command
  209.  
  210. >QUIT [Enter]
  211.  
  212. to leave MYSTAT and return to DOS.  Before MYSTAT returns you to DOS, it
  213. prints a summary of the commands used.  To save this command log
  214. in a file, issue an OUTPUT command before QUIT. (See below.)
  215. @  8 15
  216.  
  217.  
  218.  MYSTAT PROCESSING FINISHED
  219.  
  220.  INPUT STATEMENTS FOR THIS JOB:
  221.  
  222.  
  223.  USE CITIES
  224.  STATS RAINFALL / MEAN SD RANGE
  225.  
  226.  
  227.  
  228.  
  229. A:>
  230. @ 15 17
  231.                      ***  MYSTAT Operation  ***
  232.  
  233. You can operate MYSTAT in three modes.
  234.  
  235. 1 Interactive analyses with a menu.  This is the default.
  236. 2 Interactive analyses without a menu.
  237. 3 Batch mode, where MYSTAT reads a series of commands from a file.
  238.  
  239. When you first use MYSTAT, you should use the menu to
  240. remind you what commands are available.  After you become proficient
  241. with MYSTAT, you can use the MENU command to turn the MYSTAT menu off.
  242.  
  243. At times you may use the SUBMIT command.  This treats commands in a file as
  244. though they were typed on the keyboard.  The DEMO command you have seen
  245. before SUBMITs a file containing a series of MYSTAT commands that create a
  246. file named CITIES.SYS and analyze the data in it.
  247. @ 17 13
  248.                 Output Destination and Appearance
  249.  
  250. OUTPUT routes output to the console (screen), a file, or the printer.
  251.  
  252. NOTE   allows you to write comments on your output.
  253.  
  254. FORMAT determines the number of digits (0-9) to the right of the decimal point 
  255.        in all numerical output.  The default value is 3.  Use the UNDERFLOW 
  256.        option to print tiny numbers in exponential form.
  257.  
  258. CHAR   allows you to choose IBM screen/printer graphics characters or generic
  259.        characters that will print on any printer.
  260. @ 13 17
  261.           ***  MYSTAT Data Input, Editing, Transformations  ***
  262.  
  263. The EDIT command starts the MYSTAT full screen data editor.  Use the
  264. editor to create new or edit existing MYSTAT files and to create new 
  265. or transform existing variables.
  266.  
  267. Imagine you wished to change an incorrect value in the CITIES.SYS file that
  268. contained the square root of the rainfall for each city.  Edit the file
  269. by typing
  270.  
  271. >EDIT CITIES [Enter]
  272.  
  273. MYSTAT first reads the file, and then displays the first 15 cases and five
  274. variables of a file in the worksheet.  The other cases and variables
  275. still are available but off the screen.  The cursor resides at the first case
  276. and first variable of the worksheet.
  277. @ 17 18
  278. _MYSTAT Editor____________________________________________________________
  279.     Case |__CITY$_______STATE$________POP________RAINFALL_______LOGPOP____
  280.        1 |XXXNew York          NY   7164742.0            57.0         15.8
  281.        2 |Los Angeles          CA   3096721.0             7.8         14.9
  282.        3 |    Chicago          IL   2992472.0            34.0         14.9
  283.        4 |     Dallas          TX    974234.0            33.9         13.8
  284.        5 |    Phoenix          AZ    853266.0            14.9         13.7
  285.        6 |      Miami          FL    346865.0            60.0         12.8
  286.        7 | Washington          DC    638432.0            37.7         13.4
  287.        8 |Kansas City          MO    448159.0            38.8         13.0
  288.        9 |
  289.       10 |
  290.       11 |
  291.       12 |
  292.       13 |
  293.       14 |
  294. ______15_|________________________________________________________________
  295. @ 18 22
  296. Move around the rows and columns with either Wordstar-like keyboard
  297. cursor commands or PC special keys:
  298.  
  299.    Q           W           E           R
  300.   Esc         Home      up ^ arrow    PgUp
  301. (toggle)                   |
  302.  
  303.          A           S           D           F
  304.         Ins         <--         -->         Del
  305.     (left page) left arrow   right arrow  (right page)
  306.  
  307.               Z           X           C
  308.              End     down | arrow    PgDn
  309.                           v
  310.  
  311. Either  D [Enter]  or  [-->]  move the cursor one cell to the right.
  312. If you pass the end of the screen, the worksheet will scroll to the next
  313. case or variable.  To change a value or to enter a new value, use these
  314. keys to go to the cell you want, then type the new value and hit [Enter]
  315. or a special cursor key.  Enclose character values or variable names in
  316. quotes.  Enter a missing value as a period.
  317. @ 22 20
  318. To use MYSTAT EDIT commands, type either Q [Enter] or [Esc].  This
  319. moves the cursor to the command line.  Enter the command(s) as usual.  To
  320. return to the worksheet enter either Q [Enter] or [Esc].
  321.  
  322. EDIT commands are:
  323.  
  324. Q (or Escape key)                     toggles between worksheet/command line
  325. FIND <expression>                     moves cursor to selected case
  326. FORMAT <#>                            sets number of decimals MYSTAT displays
  327. SAVE <filename>                       saves new/edited data to MYSTAT file
  328. LET <statement>                       transforms variables
  329. IF <expression> THEN LET <statement>  conditionally transforms variables
  330. REPEAT <#>                            fill a data template with missing values
  331. HELP                                  help for edit commands
  332. QUIT                                  return to main menu
  333.  
  334. To leave the editor, toggle to the command line and type
  335.  
  336. >quit [Enter]
  337. @ 20  9
  338. FIND displays the values in the worksheet starting at a specified case.
  339.  
  340. >FIND RAINFALL = 14.9
  341.  
  342. would position the cursor at case 10, the first case that meets the
  343. condition.  If the first case that meets the condition is not currently
  344. displayed, the editor displays a new set of cases on the screen, starting
  345. with the target case.
  346. @  9 23
  347.     LET and IF ... THEN LET transform existing or create new variables.
  348.                LET <var> = <expression>
  349.                IF <expression> THEN LET <var> = <expression>
  350.  An expression may contain any MYSTAT variables, operators and/or functions.
  351.  
  352. +     addition                  CASE current case number
  353. -     subtraction               URAN uniform random number
  354. *     multiplication            NRAN normal random number
  355. /     division
  356. ^     exponentiation            INT integer truncation
  357.                                 SQR square root
  358. <     less than                 LOG natural log
  359. <= =< less than or equal        EXP exponential function
  360. =     equal to                  ABS absolute value
  361. <>    not equal to
  362. >= => greater than or equal     SIN sine
  363.       to                        COS cosine
  364. AND   logical and               TAN tangent
  365. OR    logical or                ASN arcsine
  366.                                 ACS arccosine
  367. CDF   standard normal CDF       ATN arctangent
  368. IDF   inverse normal CDF        ATH hyperbolic arctangent (Fisher's Z)
  369. @ 23 15
  370. Transform numeric variables:
  371.  
  372. >LET X2 = X^2
  373. >LET logit1 = 1 / (1 + EXP(A + B*X) )
  374. >let Z = ATH(r)
  375.  
  376. Transform numeric variables conditionally:
  377.  
  378. >IF sex$ = 'male' THEN LET  IQ = 0
  379. >if group > 2 then let newgroup = 2
  380.  
  381. Transform a coded value to a missing value:
  382.  
  383. >IF a = -9 THEN LET a = .
  384. @ 15 13
  385.               Use REPEAT to Create a file with random data
  386.  
  387. >EDIT          (invoke the full-screen data editor for a new data set)
  388.  
  389. Define variable names such as A, B, etc., remembering to put names in quotes.
  390. Hit [Esc] to get to the command line
  391.  
  392. >REPEAT 20     (create 20 cases with missing values for each variable)
  393. >LET A=URAN    (fill the values of variable A with uniform random values)
  394.  . . .         (etc. for all variables)
  395. >SAVE RANDOM   (save made up data to file RANDOM.SYS)
  396. >QUIT          (leave the editor)
  397. @ 13 22
  398.                  ***  MYSTAT File Input and Output  ***
  399.  
  400. When you have edited the values and performed the transformations, you
  401. must save the data into a new MYSTAT data file.  The SAVE command is
  402. completely parallel to the USE command.
  403.  
  404. >SAVE b:newfile [Enter]
  405.  
  406. places the data in a MYSTAT file called NEWFILE.SYS on the B: drive.
  407.  
  408. You can use MYSTAT files you created in the data editor or with SAVE and
  409. other MYSTAT commands.  You can even write your data to a comma-delimited 
  410. ASCII file to use with other programs.
  411.  
  412. USE  reads the values of variables in a MYSTAT (or SYSTAT) file.
  413.  
  414. SAVE saves your data into a MYSTAT file.  You must use SAVE in the editor
  415.      or before the commands SORT, RANK or ESTIMATE to create a file.
  416.  
  417. PUT  works like SAVE, except that MYSTAT puts data into a raw, comma-
  418.      delimited ASCII data file instead of saving it to a MYSTAT file.
  419. @ 22 16
  420.               ***  Other MYSTAT Data Manipulation  ***
  421.  
  422. You can weight each observation in your file by the value of a variable.
  423. You can also sort the cases in your datasets by as many as 10 numeric and/or
  424. character variables.  You can also rank the values of any variables. Use
  425. SAVE before these commands to create a file with sorted or ranked data to
  426. use in other commands.
  427.  
  428. WEIGHT  allows you to specify a weighting variable.  MYSTAT truncates the
  429.         value of the weighting variable and duplicates the case that many
  430.         times before reading the next case.
  431.  
  432. SORT    sorts (reorders) the cases in a file in ascending order on selected 
  433.         variables.
  434.  
  435. RANK    converts values of specified variables to their ranks.
  436. @ 16  8
  437.                   ***  Descriptive Statistics  ***
  438.  
  439. STATS provides complete descriptive statistics on numerical variables 
  440.       including the sum, mean, standard error of the mean, minimum, maximum,
  441.       range, standard deviation, variance, skewness and kurtosis.  Use the
  442.       BY option to obtain descriptive statistics for subgroups if you
  443.       first SORT the file by the grouping variable(s).
  444. @  8 14
  445.                   *** Graphical Data Analysis ***
  446.  
  447. PLOT      creates a two-way plot of one or more Y variables on a vertical
  448.           scale against an X variable on a horizontal scale.  The plotting
  449.           symbol can represent a third variable.
  450.  
  451. HISTOGRAM displays a histogram for one or more variables.
  452.  
  453. BOX       creates a boxplot for one or more variables.
  454.  
  455. STEM      produces a stem-and-leaf diagram for one or more variables.
  456.  
  457. TPLOT     plots a series of data values. 
  458. @ 14  6
  459.                       *** Distributional Forms ***
  460.  
  461. KS  Kolmogorov-Smirnov tests whether a sample came from a specified type of
  462.     distribution (such as normal) or whether two variables have the same
  463.     distribution.
  464. @  6  7
  465.             *** Frequencies and Contingency Table Analysis ***
  466.  
  467. TABULATE  produces frequency and n-way crosstabulation tables.
  468.           For two-way tables TABULATE provides Chi-square test statistics,
  469.           association coefficients and PRE statistics with their asymptotic
  470.           standard errors.
  471. @  7 11
  472.             *** Independent and Dependent Group Tests ***
  473.  
  474. TTEST    does either dependent (paired) or independent t-tests.
  475.  
  476. SIGN     computes a sign test on all pairs of specified variables.
  477.  
  478. WILCOXON calculates a Wilcoxon signed-rank test on pairs of variables.
  479.  
  480. FRIEDMAN computes a Friedman nonparametric analysis of variance
  481.          on selected variables.
  482. @ 11  5
  483.                       *** Correlations ***
  484.  
  485. PEARSON computes a matrix of Pearson product moment correlations.
  486.         Use RANK and PEARSON to compute Spearman rank-order correlations.
  487. @  5 23
  488.                        *** Linear Models ***
  489.  
  490. Use the CATEGORY, MODEL, SAVE and ESTIMATE commands to analyze regression,
  491. ANOVA and ANACOVA models including those with factor by covariate interactions
  492. and unbalanced designs. For unbalanced designs MYSTAT uses Yates' method of
  493. weighted squares of means. You can also perform extensive residual analyses.
  494.  
  495. CATEGORY  specifies the number of categories for one or more variables used
  496.           as categorical predictors (factors).  A CATEGORY variable must 
  497.           have integer values from 1 to k, where k is the no. of categories.
  498.  
  499. MODEL     specifies a model to estimate.  If you specify CONSTANT (an 
  500.           intercept term), it must be first.
  501.  
  502. SAVE      saves a file containing model variables, estimates, residuals,
  503.           standard error of prediction, leverage, Cook's D and studentized
  504.           residuals.  MYSTAT names these ESTIMATE, RESIDUAL, SEPRED, LEVERAGE,
  505.           COOK and STUDENT.  MYSTAT lists cases with extreme studentized
  506.           residuals or leverage and prints the Durbin-Watson statistic
  507.           and autocorrelation coefficient.
  508.  
  509. ESTIMATE  causes MYSTAT to estimate the specified model.
  510. @ 23 15
  511.                          Regression Analysis
  512.  
  513. Simple linear regression with no constant (intercept) in the model:
  514.  
  515. >USE DATAFILE 
  516. >MODEL Y = X
  517. >ESTIMATE
  518.  
  519. Multiple linear regression with constant and save file for residuals analysis:
  520.  
  521. >USE NEWDATA
  522. >SAVE RESIDS
  523. >MODEL Y = CONSTANT + X + Z
  524. >ESTIMATE
  525. @ 15 18
  526.                                ANOVA
  527.  
  528. One-way design, factor SEX has two levels with values 1 and 2:
  529.  
  530. >CATEGORY SEX=2
  531. >MODEL IQ=CONSTANT+SEX
  532. >ESTIMATE
  533.  
  534.  
  535. Two-way ANOVA with an A by B interaction term (A*B):
  536.  
  537. >CATEGORY A=2,B=3 
  538. >MODEL Y = CONSTANT + A + B + A*B
  539. >ESTIMATE
  540.  
  541. A has two levels, 1 and 2, and B has three levels, 1, 2, and 3.  
  542.  
  543. @ 18 12
  544.                         Analysis of Covariance
  545.  
  546. A and B are factors, C is a covariate:
  547.  
  548. >CATEGORY A=2,B=3
  549. >MODEL Y = CONSTANT + A + B + C + A*B + A*C + A*B*C
  550. >ESTIMATE
  551. >MODEL Y = CONSTANT+C+A+B+A*B
  552. >ESTIMATE
  553.  
  554. The first model includes factor by covariate interactions, the second does not.
  555. @ 12 20
  556.                             Residual Analyses
  557.  
  558. If you specify SAVE with a linear model, MYSTAT automatically identifies
  559. possible outliers and reports serial correlation diagnostics.  Use the
  560. variables in the residuals file you save to perform additional tests.
  561.  
  562. >MODEL Y = CONSTANT + X1 + X2
  563. >SAVE RESIDS   (save information in RESIDS.SYS file)
  564. >ESTIMATE      (estimate model and get automatic diagnostics)
  565.  
  566. >USE RESIDS        (get file containing residual and model variables)
  567. >PLOT RESIDUAL*ESTIMATE  (scatterplot of residuals and estimated values)
  568. >PLOT RESIDUAL*X1  (assess nonlinearity in relation of X1 to Y)
  569. >TPLOT RESIDUAL    (assess possible serial pattern to residuals)
  570. >STEM RESIDUAL     (look at shape of residual distribution)
  571. >KS RESIDUAL /NORMAL  (test normality of residuals)
  572. >BOX LEVERAGE      (see if any leverage values extreme relative to others)
  573.  
  574. Use your imagination!
  575. @ 20  0
  576.