If you don't want to reshape the data, a roll-your-own approach with a Double DoW can do it. Something like data have; input var1-var3; cards; 1 2 3 4 5 6 7 8 9 ; data _null_ ; do until (lastobs) ; set have end=lastobs ; n_v + n(of var:) ; sum_v + sum(of var:) ; end ; lastobs = 0 ; do until (lastobs) ; set have end=lastobs ; array vv var: ; do j = 1 to dim(vv) ; sumsq + ( vv - (sum_v / n_v) )**2 ; end ; end ; std = sqrt( sumsq/(n_v-1) ) ; put std= ; run ; richard_hu2003 wrote: Hi folks, I need to compute Standard Deviation of ALL Observations of MULTIPLE Variables. PROC MEANS can compute std of EACH variable. STD function can compute std of EACH observation. Is there a way to compute std of all observations (data points) of multiple variables? For example, I have 3 variables, var1, var2, var3 and 3 observations. var1 var2 var3 1 2 3 4 5 6 7 8 9 PROC MEANS can compute std of EACH variable and return std1 of (1, 4, 7), std2 of (2, 5, 8), std3 (3, 6, 9). STD function in data step can compute std of EACH observation and return std_1_ of (1,2,3), std_2_ of (4, 5, 6) and std_2_ of (7, 8, 9). But I want to get ONE single standard deviation of all 12 data points, std_all of (1,2,3,4,5,6,7,8,9). Thanks.
... View more