home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / DATABASE / SCRIVNER.LBR / CORREL2.SCR < prev    next >
Text File  |  2000-06-30  |  2KB  |  42 lines

  1. #announce Calculating a population correlation coefficient.
  2.               Population Correlation Coefficients
  3.               ===================================
  4.  
  5.  
  6. [[def4.0]] [[de This is a comment the def4.0 defines the format as floating point of field 4 ]]
  7. [[d n=0]]
  8.  
  9.  
  10. +----------------------------------------------------------------------------+
  11. |    x           y            x^2              y^2              xy           |
  12. +----------------------------------------------------------------------------+
  13. #input mac_number,,Enter the number of points
  14. #repeat #include correl.inc,,mac_number
  15. [[d n=mac_number]]
  16. ----------------------------------------------------------------------------
  17.  
  18.  [[t   sx ]]    [[t   sy ]]  [[t sxs   ]]    [[t sys    ]]   [[t sxy ]] 
  19.  
  20. ===========================================================================
  21.  
  22.  
  23. Population coefficient is given by           sum(xy) - sum(x)*sum(y)/n
  24.                                     -------------------------------------------------
  25.                                     sqr[((sum(x)^2)-(sum(x)^2)/n))*((sum(y)^2)-((sum(y)^2)/n)]
  26.  
  27.  
  28.                                  =           [[o sxy ]] - [[o a= sx*sy/n]]
  29.                                     ---------------------------------------
  30.                                              sqr[ [[o b=sxs-((sx^2)/n)]] * [[o c=sys-((sy^2)/n)]] ]
  31.  
  32. [[def5.1]]
  33.                                  =     [[o a=sxy-a]]
  34.                                     ------------------ 
  35.                                        [[o b=(b*c)^0.5 ]]
  36.  
  37.  
  38. [[def5.4]]
  39.  
  40.                                  =  [[ a/b   ]]
  41.  
  42.