Here is a short presentation I gave in the summer, a quick test of your macro skills:
Test your macro from ray4hz
You can also watch my video as you go through the ppt above.
Now I want to show you two examples of using the macro.
The first "setr" macro will generate a column of random number in the datasets.
https://gist.github.com/4083348
With the first "setr", the second "setcat" macro can create a categorical variable with the assigned number of observations for each group in random sequence. This is good for data simulation.
https://gist.github.com/4083405
We can simply use the following code:
%setcat(indsn=all, outdsn=dis, rn=0, varname=Reasons, len=40,
cat=Disease Progression|Adverse event|Subject Choice|Investigator discretion,
ncat=2|2|3|3);
Then we will get the new dataset "dis" we want like this:
Easy enough, right? Thanks for coming to my blog! See you next time!
No comments:
Post a Comment