Fit a Linear Regression Model - Maple Programming Help

Fit a Linear Regression Model

 Description Fit a linear regression model to a data set.

Define a Matrix containing the values of the independent variable(s). Each column represents the values of a single variable.

 > $\mathrm{Matrix}\left(\left[\left[{-}{38}{,}{91}{,}{-}{1}{,}{63}{,}{-}{23}{,}{-}{63}\right]\right],\mathrm{scan}=\mathrm{columns}\right)$
 $\left[\begin{array}{r}\colorbox[rgb]{0,0,0}{{-}}\colorbox[rgb]{0,0,0}{{38}}\\ \colorbox[rgb]{0,0,0}{{91}}\\ \colorbox[rgb]{0,0,0}{{-}}\colorbox[rgb]{0,0,0}{{1}}\\ \colorbox[rgb]{0,0,0}{{63}}\\ \colorbox[rgb]{0,0,0}{{-}}\colorbox[rgb]{0,0,0}{{23}}\\ \colorbox[rgb]{0,0,0}{{-}}\colorbox[rgb]{0,0,0}{{63}}\end{array}\right]$ (1)

Define a Vector containing the values of the dependent variable.

 > $\mathrm{Vector}\left(\left[{31}{,}{-}{50}{,}{-}{80}{,}{43}{,}{25}{,}{94}\right]\right)$
 $\left[\begin{array}{r}\colorbox[rgb]{0,0,0}{{31}}\\ \colorbox[rgb]{0,0,0}{{-}}\colorbox[rgb]{0,0,0}{{50}}\\ \colorbox[rgb]{0,0,0}{{-}}\colorbox[rgb]{0,0,0}{{80}}\\ \colorbox[rgb]{0,0,0}{{43}}\\ \colorbox[rgb]{0,0,0}{{25}}\\ \colorbox[rgb]{0,0,0}{{94}}\end{array}\right]$ (2)

Specify the component functions, and then fit a linear regression model to the data set.

 >
 $\colorbox[rgb]{0,0,0}{{-}}\colorbox[rgb]{0,0,0}{{20.3461271452096}}\colorbox[rgb]{0,0,0}{{-}}\colorbox[rgb]{0,0,0}{{0.925804839711395}}\colorbox[rgb]{0,0,0}{{}}\colorbox[rgb]{0,0,0}{{t}}\colorbox[rgb]{0,0,0}{{+}}\colorbox[rgb]{0,0,0}{{0.0116487167164782}}\colorbox[rgb]{0,0,0}{{}}{\colorbox[rgb]{0,0,0}{{t}}}^{\colorbox[rgb]{0,0,0}{{2}}}$ (3)
 Commands Used