Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Standard deviation in teradtaa

Status
Not open for further replies.

raasclaat

IS-IT--Management
Apr 4, 2001
1
US
Does anyone know how to clculate the variance of a series in Teradata
 
Try this ...
Try this ...
/****************************/
create table abc (age integer);
insert into abc (29);
insert into abc (25);
insert into abc (21);
insert into abc (18);

SELECT
COUNT(age) AS total_count
,AVG(((age)(FLOAT))) AS avg_age
,SQRT(ABS((SUM(Age**2) / total_count) - AVG(Age)**2)) AS std_dev

FROM
(SELECT age
FROM abc ) A ;
/**********************************************/
 
Hi,
In V2r4 we added 2 new functions

STDDEV_POP
STDDEV_SAMP


In v2r4.1 we added

COVAR_SAMP, REGR_R2, REGR_COUNT, REGR_AVGX
REGR_AVGY, REGR_SXX, REGR_SYY, REGR_SXY

to complete the set.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top