Prev: How to read SAS datasets in a zip file
Next: Help on Creating single observation from multiple observations
From: pigpigpig on 22 Apr 2010 14:55 Hello, I am stuck in the looping.. I have 3 cutoffs, cutoff
From: pigpigpig on 22 Apr 2010 15:06 On Apr 22, 2:55 pm, pigpigpig <pigzhu...(a)gmail.com> wrote: > Hello, I am stuck in the looping.. > > I have 3 cutoffs, cutoff1, cutoff2, cutoff3, each cutoff can range from 0.1 to 0.9, I want to try different combinations of these cutoffs and get my minimum loan loss: For example: cutoff1=0.1 cutoff2=0.1 cutoff3=0.1 cutoff1=0.1 cutoff2=0.1 cutoff3=0.2 cutoff1=0.1 cutoff2=0.1 cutoff3=0.3 cutoff1=0.1 cutoff2=0.1 cutoff3=0.4 cutoff1=0.1 cutoff2=0.1 cutoff3=0.5 cutoff1=0.1 cutoff2=0.1 cutoff3=0.6 cutoff1=0.1 cutoff2=0.1 cutoff3=0.7 cutoff1=0.1 cutoff2=0.1 cutoff3=0.8 cutoff1=0.1 cutoff2=0.1 cutoff3=0.9 There are 9*9*9=729 different combinations. How can write the loop Do cutoff1=0.1 do cutoff2=0.1 to 0.9 by 0.1 do cutoff3=0.1 to 0.9 by 0.1 cutoff1+0.1 end end; end ; I don't know where to start and end.. Much appreciated for any help Thanks, Lana
From: barryd on 22 Apr 2010 15:13
On Apr 22, 3:06 pm, pigpigpig <pigzhu...(a)gmail.com> wrote: > On Apr 22, 2:55 pm, pigpigpig <pigzhu...(a)gmail.com> wrote:> Hello, I am stuck in the looping.. > > > I have 3 cutoffs, cutoff1, cutoff2, cutoff3, > > each cutoff can range from 0.1 to 0.9, > I want to try different combinations of these cutoffs and get my > minimum loan loss: > > For example: > cutoff1=0.1 cutoff2=0.1 cutoff3=0.1 > cutoff1=0.1 cutoff2=0.1 cutoff3=0.2 > cutoff1=0.1 cutoff2=0.1 cutoff3=0.3 > cutoff1=0.1 cutoff2=0.1 cutoff3=0.4 > cutoff1=0.1 cutoff2=0.1 cutoff3=0.5 > cutoff1=0.1 cutoff2=0.1 cutoff3=0.6 > cutoff1=0.1 cutoff2=0.1 cutoff3=0.7 > cutoff1=0.1 cutoff2=0.1 cutoff3=0.8 > cutoff1=0.1 cutoff2=0.1 cutoff3=0.9 > > There are 9*9*9=729 different combinations. > > How can write the loop > > Do cutoff1=0.1 > do cutoff2=0.1 to 0.9 by 0.1 > do cutoff3=0.1 to 0.9 by 0.1 > > cutoff1+0.1 > > end > end; > end ; > > I don't know where to start and end.. Much appreciated for any help > > Thanks, > Lana Lana, You're nearly there. Just extend the first do loop and place an output statement in the middle of all three do loops. N.B. - keep an eye on those semi-colons. i.e. Do cutoff1=0.1 TO 0.9 BY 0.1; do cutoff2=0.1 to 0.9 by 0.1; do cutoff3=0.1 to 0.9 by 0.1; OUTPUT; end ; end; end ; Regards, BPD |