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;
What you see looks correct to me:
For a mean that is not zero you see higher t-values of course. t-values will often become significant then (rejecting null-hypothesis of mean=0).
Koen
What you see looks correct to me:
For a mean that is not zero you see higher t-values of course. t-values will often become significant then (rejecting null-hypothesis of mean=0).
Koen
Thanks for the prompt and clear response. I see where I went off the rails.
Gene
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.