Esteemed advisers:
I’ve been experimenting with Proc Expand. Specifically, with the transformation MOVTVALUE. The documentation says: “They can be viewed as combinations of the moving average (CUAVE, MOVAVE, CMOVAVE) and the moving standard deviation (CUSTD, MOVSTD, CMOVSTD), respectively”. So I was expecting that for a normal distribution, MOVTVALUE would cluster around a value of 0 regardless of the mean of the distribution.
But that’s not what I found. See code below where I created two normal distributions with a mean of 0 and 1. I then used Proc Expand to compute MOVTVALUE and then plotted the result and computed the mean of the t-values.
The plot of t-values for a normal distrubution with a mean of 0 looks as I would expect with values clusters around of mean of (near) zero. But the plot for t-values for normal distribution of a mean of 1 looks very different.
What am I misunderstanding? Thanks in advance for any insights you can provide.
data have;
call streaminit(123);
do i=1 to 100;
test0=rand('normal',0);
test1=rand('normal',1);
output;
end;
run;
proc expand data=have out=out method=none;
id i;
convert test0=tvalue0/transout=(movtvalue 5);
convert test1=tvalue1/transout=(movtvalue 5);
run;
proc sgplot data=out;
series x=i y=tvalue0 /
name='tvalue0' legendlabel="tvalue0" markers markerattrs=(symbol=circlefilled);
series x=i y=tvalue1 /
name='tvalue1' legendlabel="tvalue1" markers markerattrs=(symbol=circlefilled);
xaxis grid;
yaxis grid label='t-value';
run;
proc means data=out mean;
var tvalue0 tvalue1;
run;
... View more