Solutions

In[80]:=

(*1*)<<Statistics`LinearRegression`Clear[x] ; A = {{-1, -0.5}, ...  DisplayFunctionIdentity] ; Show[%, %%, DisplayFunction$DisplayFunction]

Out[84]//TableForm=

Estimate SE TStat PValue
1 1.2100000000000004` 0.09327379053088819` 12.972561671537317` 0.005889771297636681`
x 1.7800000000000002` 0.07615773105863911` 23.372545049030606` 0.0018255657161612149`

Standard error for a: 0.0932738

Standard error for b: 0.0761577

[Graphics:../HTMLFiles/ex03_solutions_92.gif]

Out[89]=

⁃Graphics⁃

At this point, an important notice: if you happen to make an error when handling a function which is not built-in but has to be loaded from a package, you might lose the usage of the function. For example, if Regress or ParameterTable ceases to work, you can reset them using the function Remove. Another thing that might seem weird is the use of three indices in obtaining the standard error. This is because we suppressed output when calculating the parameter table. Try different indices to see what's going on. The Print command simply prints its arguments. I have also used the function Fit because it's easier to extract the interpolating function from it than from Regress.

In[100]:=

(*2*)<<Statistics`LinearRegression`A = {{0, 1.6}, {0.5, 3.8}, {1, 6.3} ...  DisplayFunctionIdentity] ; Show[%, %%, DisplayFunction$DisplayFunction]

Out[103]//TableForm=

Estimate SE TStat PValue
1 -0.27759773566017004` 0.9906477341916134` -0.28021841274052356` 0.8056344379922049`
^x 1.9822427194101417` 0.7210834698402897` 2.7489781728725275` 0.110771850164056`
^x x 0.5797396699383677` 0.3061816734223823` 1.8934499359751293` 0.19880855659516317`

Standard error for a: 0.990648

Standard error for b: 0.721083

Standard error for c: 0.306182

[Graphics:../HTMLFiles/ex03_solutions_100.gif]

Out[109]=

⁃Graphics⁃


Created by Mathematica  (April 10, 2007) Valid XHTML 1.1!