LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2010, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 10 Dec 2010 15:05:28 -0500
Reply-To:     Arthur Tabachneck <art297@ROGERS.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Arthur Tabachneck <art297@ROGERS.COM>
Subject:      Re: Potential DOW-Loop Problem?
Comments: To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>

Gerhard,

According to my notes you've contributed at least one percent of the SAS-L monthly posts for 77 months. Surely, during that time, you must have confronted a post proposing the use of a DO-Whitlock loop! No?

Art ------- On Fri, 10 Dec 2010 14:04:39 -0500, Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE> wrote:

>I'm missing the "example code"! You should at least TRY to do your >homework yourself before you ask for help. If there is some code, there >would be someone for sure to help you finding some mistakes. > >By the way: what is a DOW-loop? A Day-Of-Week loop? A Dust-Or-Water loop? >Don't know what that is... > >And note, that in SAS most of the loop constructs are automatic. You don't >need a loop for stepping through sashelp.class. > >data a; > set sashelp.class; >run; > >is enough. > >Gerhard > > > > >On Fri, 10 Dec 2010 18:57:54 +0100, Dominik Becker ><dombecksoz@GOOGLEMAIL.COM> wrote: > >>Dear all, >> >>I am quite new to SAS' looping facilities, so I'd be glad if someone >>could help me out. Web research suggested that it could be related to >>a DOW-Loop, but I'm neither sure about this nor able to implement this >>on my own. >> >>I have data that indicate whether a country was an autocracy (demo=0) >>or a democracy (demo=1) in a certain year. Now three things can happen >>over time: An autocracy can become a democracy, both autocracies and >>democracies can remain stable, and democracies may break down. >>My aim is to compute a 'censor' variable that takes 1 if a former >>democracy breaks down, 0 for both stable democracies and democratized >>countries (i.e. the censored ones), and missing for stable >>autocracies. >> >>In a second step, I would have to specify in a variable 'duration' how >>long each democracy persists. >> >>Below I attach some illustrative code. The last two columns is what I >>would like to achieve. Thanks a lot for any suggestions! >> >>Best, >>Dominik >> >> >>*** EXAMPLE CODE ***; >> >>country year demo censor duration >>1 1 0 0 3 >>1 2 0 0 3 >>1 3 1 0 3 >>1 4 1 0 3 >>1 5 1 0 3 >>2 1 1 0 5 >>2 2 1 0 5 >>2 3 1 0 5 >>2 4 1 0 5 >>2 5 1 0 5 >>3 1 0 . . >>3 2 0 . . >>3 3 0 . . >>3 4 0 . . >>3 5 0 . . >>4 1 1 1 2 >>4 2 1 1 2 >>4 3 0 1 2 >>4 4 0 1 2 >>4 5 0 1 2


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