#announce Calculating a population correlation coefficient. Population Correlation Coefficients =================================== [[def4.0]] [[de This is a comment the def4.0 defines the format as floating point of field 4 ]] [[d n=0]] +----------------------------------------------------------------------------+ | x y x^2 y^2 xy | +----------------------------------------------------------------------------+ #input mac_number,,Enter the number of points #repeat #include correl.inc,,mac_number [[d n=mac_number]] ---------------------------------------------------------------------------- [[t sx ]] [[t sy ]] [[t sxs ]] [[t sys ]] [[t sxy ]] =========================================================================== Population coefficient is given by sum(xy) - sum(x)*sum(y)/n ------------------------------------------------- sqr[((sum(x)^2)-(sum(x)^2)/n))*((sum(y)^2)-((sum(y)^2)/n)] = [[o sxy ]] - [[o a= sx*sy/n]] --------------------------------------- sqr[ [[o b=sxs-((sx^2)/n)]] * [[o c=sys-((sy^2)/n)]] ] [[def5.1]] = [[o a=sxy-a]] ------------------ [[o b=(b*c)^0.5 ]] [[def5.4]] = [[ a/b ]]