Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 19 Dec 2006 @ 17:55:45 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


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)


     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023