example10.mws

Example 10: Regression

by Zavan Karian

> restart: with(plots, display): libname:="C:/mylib/statistics",libname: with(stat):

Warning, the name randomize has been redefined

> X := [1,2,3,4,5];

X := [1, 2, 3, 4, 5]

> Y := [2,3,1,5,4];

Y := [2, 3, 1, 5, 4]

> r:= Correlation(X,Y);

r := .6000000000

> A := BivariateNormalS(100, 225, 400, 625, 0.9, 200):

> A[1..5];

[[117.6375935, 420.3172719], [103.5309099, 389.5765...
[[117.6375935, 420.3172719], [103.5309099, 389.5765...

> r := Correlation(A);

r := .9021624098

> y := LinReg(A, x);

y := 249.3232275+1.510706938*x

> Y := PolyReg(A, 3, x);

Y := 262.2843502+.8090075132*x+.1007968389e-1*x^2-....

> ScatPlot(A);

[Maple Plot]

> ScatPlotLine(A);

[Maple Plot]

>