1. how to do factorial analysis in SAS
2. fractional factorial design for conjoint analysis using SAS QC
3. Problem with macro: FACTORIAL
I'm trying to write this small macro:
calculate N! Example if N=4 we will have 1*2*3*4=24 =4!
The following macro very well when N is not zero, but when N=0 It doesn't
work.
Can someone help.
Thanks a lot.
%macro FACT(N=);
%*--------------------------------------------------------;
%* Return N! Example if N=4 we will have 1*2*3*4=24 =4! ;
%*--------------------------------------------------------;
data fac;
FACT=1;
%If &N=0 %then FACT=1;
%do I=1 %to &N;
FACT =FACT*&I;
%end;
proc print label;
var FACT;
run;
%mend FACT;
%FACT(N=4);
%FACT(N=0);
4. RE : Problem with macro: FACTORIAL
5. a very crude macro on calculating factorial..
Hello all,
I am trying to write a macro that takes in a number and calcualtes the
factorial from 1 to n in the ascending order. I have written it and it
is executing properly but i need suggestions to achieve it in lesser
number of steps. I am a beginner in SAS and so not very good in
building proper logic into the code.can number of loops be reduced?
any suggestions would be of great help .
Thanks
Rao.
/*-------Macro to calculate the factorial from 1 to n in the ascending
order-----*/
dm log 'clear';
dm output 'clear';
%macro factorial(n); /*---parameter to the macro----*/
data dd;
do i = &n to 1 by -1;
j = 1;
m = i;
k = 1;
do until (m<=1);
j = j * m;
k = m - 1;
m = k;
end;
output;
end;
drop m k ;
run;
proc sort;
by i;
run;
proc print noobs label;
label i = 'Integer'
j = 'factorial';
run;
%mend factorial;
6. Creating Fractional Factorial Design
7. How do I generate a Resolution V Fractional Factorial Design