```Date: Mon, 7 Jun 2010 14:36:28 -0400 Reply-To: My Name Sender: "SAS(r) Discussion" From: My Name Subject: Re: Newbie Loop Question Comments: To: Ricardo Gonçalves da Silva In-Reply-To: <5B1372272ABB7B4DB178622784D52BC107BDB70DA2@MOR-EXMBPRD01.bvnet.bv> Content-Type: text/plain; charset=UTF-8 DATA PT; LAM1=0.5; LAM2=0.75; LAM3=0.9; LAM4=0.95; LAM5=0.99; LAM6=0.999; do NA=100 to 10000 by 100; do NB=100 to 10000 by 100; do NC=100 to 10000 by 100; NABC=NA+NB+NC; NBC=NB+NC; PDA_HAT1=1-(1-LAM1)**(1/NABC); PDA_HAT2=1-(1-LAM2)**(1/NABC); PDA_HAT3=1-(1-LAM3)**(1/NABC); PDA_HAT4=1-(1-LAM4)**(1/NABC); PDA_HAT5=1-(1-LAM5)**(1/NABC); PDA_HAT6=1-(1-LAM6)**(1/NABC); * PDA_HAT7=1-(1-LAM7)**(1/NABC); output; end; end; end; keep PDA_HAT1 PDA_HAT2 PDA_HAT3 PDA_HAT4 PDA_HAT5 PDA_HAT6; RUN; ---- Original message ---- >Date: Mon, 7 Jun 2010 14:48:49 -0300 >From: "SAS(r) Discussion" (on behalf of Ricardo GonÃ§alves da Silva ) >Subject: Newbie Loop Question >To: SAS-L@LISTSERV.UGA.EDU > >Dear Users, > >The code bellow estimates PDA_HAT1 to PDA_HAT7 using the values of NA, NB and NC pre-selected. >I would like to construct a loop to in order to vary the values of NA, NB and NC from 100 to 10.000 in steps of 100. >How can I do this? I think that the values LAM1 to LAM7 also need to enter in the looping. > >Thanks in advance, > >Rick > >DATA LIB.PT; >NA=100; >NB=400; >NC=300; > >LAM1=0.5; >LAM2=0.75; >LAM3=0.9; >LAM4=0.95; >LAM5=0.99; >LAM6=0.999; > >NABC=NA+NB+NC; >NBC=NB+NC; > >PDA_HAT1=1-(1-LAM1)**(1/NABC); >PDA_HAT2=1-(1-LAM2)**(1/NABC); >PDA_HAT3=1-(1-LAM3)**(1/NABC); >PDA_HAT4=1-(1-LAM4)**(1/NABC); >PDA_HAT5=1-(1-LAM5)**(1/NABC); >PDA_HAT6=1-(1-LAM6)**(1/NABC); >PDA_HAT7=1-(1-LAM7)**(1/NABC); > >keep PDA_HAT1 PDA_HAT2 PDA_HAT3 PDA_HAT4 PDA_HAT5 PDA_HAT6; >RUN; > > > > >----------------------------------------- >Esta mensagem e seus anexos podem conter informaÃ§Ãµes confidenciais >ou privilegiadas. Se vocÃª nÃ£o Ã© o destinatÃ¡rio dos mesmos vocÃª nÃ£o >estÃ¡ autorizado a utilizar o material para qualquer fim. >Solicitamos que vocÃª apague a mensagem e avise imediatamente ao >remetente. O conteÃºdo desta mensagem e seus anexos nÃ£o representam >necessariamente a opiniÃ£o e a intenÃ§Ã£o da empresa, nÃ£o implicando >em qualquer obrigaÃ§Ã¢o ou responsabilidade da parte da mesma. > >This message may contain confidential and/or privileged >information. If you are not the addressee or authorized to receive >this for the addressee, you must not use, copy, disclose or take >any action based on this message or any information herein. >If you have received this message in error, please advise the >sender immediately by reply e-mail and delete this message. The >contents of this message and its attachments do not necessarily >express the opinion or the intention of the company, and do not >implies any legal obligation or responsibilities from this >company. > ```

Back to: Top of message | Previous page | Main SAS-L page