Endfunc
r2coefdf(lx,ly)
func
©Find coefficient of determination r^2, adjusted for DOF
©lx is list of x-data points
©ly is list of y-data points
©24 nov 99/[email protected]
local n
dim(lx)
→
n
1
-((n-
1
)*sum((regeq(lx)-ly)^2))/((n-dim(regcoef)-
1
)*sum((ly-mean(ly))^2))
Endfunc
Note that neither of these functions will account for weighting of the data points.
Both functions should be run in Approx mode. Both take the list of x-data and y-data values in the lists
lx and ly. Be sure to run the regression command (CubicReg, ExpReg, etc) before using these
functions, because they depend on the system variables regeq and regcoef being up-to-date.
regeq is a function that is updated by the regression command. It is the regression equation itself, and I
use it in both routines to calculate needed values. regcoef is the list of regression equation coefficients,
and I use it in r2coefdf() to find the degrees of freedom.
The coefficient of determination, without adjustment for degrees of freedom, is defined as
r2
=
1
−
SSE
SSM
SSE is the sum of the squares of the error, defined as
SSE
=
✟
i
=
1
n
yˆi
−
yi
2
SSM is the sum of squares about the mean, defined as
SSM
=
✟
i
=
1
n
yi
−
y
2
Also,
n is the number of data points
yi are the y-data values
yˆi
=
f xi are the estimated y-values, that is, the regression equation evaluated at each x-data value
y is the mean of the y-data values
It is a simple matter to adjust r
2
for degrees of freedom:
r2
=
1
−
(n
−
1 )
$
SSE
(DOF
−
1 )
$
SSM
Here, DOF is the degrees of freedom, defined as
DOF
=
n
−
m
6 - 18
Summary of Contents for TI-92+
Page 52: ...Component side of PCB GraphLink I O connector detail 1 41...
Page 53: ...LCD connector detail PCB switch side 1 42...
Page 54: ...Key pad sheet contact side Key pad sheet key side 1 43...
Page 55: ...Key cap detail 1 44...
Page 57: ...Component side of PCB with shield removed A detail view of the intergrated circuits 1 46...
Page 410: ...void extensionroutine2 void Credit to Bhuvanesh Bhatt 10 4...