|
|
Archives of the TeradataForum
Message Posted: Tue, 19 Dec 2006 @ 17:55:45 GMT
Subj: | | Re: Standard deviation for multiple columns |
|
From: | | Duell, Bob |
I don't think there is a Teradata equivalent. Both stddev_samp and stddev_pop are Teradata "aggregate" functions, while the STD data step
function in SAS operates on *values*, not columns. In other words, std(x,y) returns the standard deviation of the two current values of x and y
*for each row*, i.e.:
proc sql;
select x, y, std(x,y) as std_x_y
from mytable;
quit;
x y std_x_y
-------- ------- --------
1 2 0.707107
2 3 0.707107
4 5 0.707107
6 7 0.707107
If you REALLY need to find the standard deviation of different columns taken as one series, I suppose you can UNION each column into one
derived table, such as:
Select stddev_samp(x)
>From (select x from table union all select y from table)
| |