1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
SELECT SPRODECAR/NBVAL AS COVARIANCE,
covariance/VARPX AS PENTE,
moyenney-(moyennex*pente) AS ORIGINE,
((nbval*sprodxy)-(somx*somy)) /(sqr(((nbval*SX2) - (somx*somx)) * ((nbval*Sy2) - (somy*somy)))) AS COEFFCORRELATION, coeffcorrelation^2 AS COEFFDETERMINATION
FROM (SELECT
Count(X) AS NBVAL,
Sum(X) AS SOMX,
Sum(Y) AS SOMY,
Sum([x]*[y]) AS SPRODXY,
VarP([x]) AS VARPX,
Sum([X]*[x]) AS SX2,
Sum([Y]*[y]) AS SY2,
sum( (x-(select avg(x) from matable)) * (y-(select avg(y) from matable))) AS SPRODECAR,
avg(x) as MOYENNEX,
avg(y) as MOYENNEY
FROM matable) AS etape1; |
Partager