f

#### Re: Changes and frequency of changes

```On Sat, 28 Apr 2007 15:08:15 -0400, mcolowasth@YAHOO.CO.UK wrote:

>Hi,
>
>I observe variable x over time (from 1999-2005) for a large number of
>firms, w. I have computed the change in variable x from one year to the
>next.
>
>Now, I would like to identify whether variable x has changed from one year
>to the next for each firm as well as how often it changed for each firm(in
>some cases I expect no change in this variable i.e. 0).
>
>Any suggestions on how to do this in sas?
>
>Thanks

Generate test data, since original poster did not provide it:

data observed;
do firm = 'a', 'b';
do year = 1999 to 2005;
x = 2 + round(ranuni(135),0.3);
output;
end;
end;
run;

Result:

Obs    firm    year     x

1     a      1999    2.9
2     a      2000    2.9
3     a      2001    2.9
4     a      2002    2.0
5     a      2003    2.3
6     a      2004    2.9
7     a      2005    2.3
8     b      1999    2.9
9     b      2000    2.6
10     b      2001    2.9
11     b      2002    2.6
12     b      2003    2.6
13     b      2004    2.3
14     b      2005    2.0

Here is a solution with a couple of dorfmanic touches:

data whether  (keep = firm year x whether)
howoften (keep = firm howoften)
;
set observed;
by firm;
changed = not not dif(fuzz(x) );
if first.firm then howoften = 0;
else do;
whether   = changed;
howoften ++ changed;
end;
output whether;
if last.firm then output howoften;
run;

The formula for CHANGED first quantifies any difference, then the double
boolean negation maps zero to zero and anything else to one.

WHETHER:

Obs    firm    year     x     whether

1     a      1999    2.9       .
2     a      2000    2.9       0
3     a      2001    2.9       0
4     a      2002    2.0       1
5     a      2003    2.3       1
6     a      2004    2.9       1
7     a      2005    2.3       1
8     b      1999    2.9       .
9     b      2000    2.6       1
10     b      2001    2.9       1
11     b      2002    2.6       1
12     b      2003    2.6       0
13     b      2004    2.3       1
14     b      2005    2.0       1

HOWOFTEN:

Obs    firm    howoften

1      a          4
2      b          5
```
 0
nospam1405 (4666)
4/29/2007 3:22:28 AM
comp.soft-sys.sas 142828 articles. 3 followers.

0 Replies
526 Views

Similar Articles

[PageSpeed] 49

Similar Artilces:

Re: Changes and frequency of changes #2
mcolowasth@YAHOO.CO.UK wrote: > >Hi, > >I observe variable x over time (from 1999-2005) for a large number of >firms, w. I have computed the change in variable x from one year to the >next. > >Now, I would like to identify whether variable x has changed from one year >to the next for each firm as well as how often it changed for each firm(in >some cases I expect no change in this variable i.e. 0). > >Any suggestions on how to do this in sas? > >Thanks How big a change counts as a 'change'? Or are the data already rounded off, or saved in such a way that any difference would count? I think this could be done in a single PROC EXPAND, depending on what you are after. And what is this going to do for you? HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330 _________________________________________________________________ Get a FREE Web site, company branded e-mail and more from Microsoft Office Live! http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/ ...

Re: A SAS patch changed the way PROC SQL worked and changed the
No sure why, but it should be the same on UNIX as the PC. There were some changes to SQL in ver 9, but I don't know if this is the case, since I currently can't test on UNIX. If you get no replies, I would double check the code across the different versions and platforms, and then check with SAS. On 12/5/06, Guido T <cymraegerict@gmail.com> wrote: > > Hi SAS-L, > > I had some PROC SQL code that I used to count the number of elements > in a group to be later used to create a format. Here's a simplified > version of my code :- > > proc sql; > create table testout as > select > count(*) as l > , s as x > , s as y > from test > group by s > ; > quit; > > The idea was to get the count of number of elements in the group S > into L and populated X and Y with the group S. The way I thought PROC > SQL would work was to group the data by S and then populate the output > dataset. This worked for a couple of years in a macro that wasn't > changed. > > When I recently had to re-run the code on some old data I got a lot of > errors from PROC FORMAT about overlapping ranges etc. That data > hadn't changed, my code hadn't changed, the macro hadn't changed, so > what had happened? > > When I ran the code on my PC (using an "old" version of SAS 8.2) > everything was OK, but when I ra...

Re: A SAS patch changed the way PROC SQL worked and changed the #2
Guido: I don't have a sensible explanation of how SAS SQL decides to collapse rows in a GROUP BY query, and why it does some times and not others. Calculating or renaming of columns in a GROUP BY clause tends to inhibit collapsing of rows in summaries. In the case you present, the alias for s in the select statement would be difficult for the SQL compiler to relate back to the s in the GROUP BY clause. Make your intent more obvious to the SQL compiler with the DISTINCT keyword following SELECT. In a query language that conforms to the relational model, the duplicated rows should not appear at all in a relation. Perhaps SAS is trying to prevent misleading results of summary queries that involve the sometimes useful but peculiar REMERGE's. Most other flavours of SQL avoid these problems by refusing to process a query that has a different SELECT list (except for summary functions) than GROUP BY list. Though certainly legal in a SQL query, copying of column values and renaming would be more appropriate in a data display query than in a query that creates a relational table. The copying and renaming confuse the SQL compiler and add no information to the database. Sig -----Original Message----- From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of Guido T Sent: Tuesday, December 05, 2006 3:49 AM To: sas-l@listserv.uga.edu Subject: A SAS patch changed the way PROC SQL worked and changed the way I thought PROC SQL worked. Hi SAS-L, I had ...

Re: A SAS patch changed the way PROC SQL worked and changed the #3
You're being pretty charitable here, I think. This looks like a straight-up bug to me. DISTINCT might have the desired effect, but I'd call it a workaround rather than a matter of making intent clear. I've said it before & I'll say it again: I wish proc sql had a 'noremerge' option or some such that I could use to turn off the remerge behavior. I *never* do it on purpose, b/c it's not sql that would run anyplace but sas, and having it as a possibility does occasionally confuse sas... -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Sigurd Hermansen Sent: Tuesday, December 05, 2006 10:46 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: A SAS patch changed the way PROC SQL worked and changed the way I thought PROC SQL worked. Guido: I don't have a sensible explanation of how SAS SQL decides to collapse rows in a GROUP BY query, and why it does some times and not others. Calculating or renaming of columns in a GROUP BY clause tends to inhibit collapsing of rows in summaries. In the case you present, the alias for s in the select statement would be difficult for the SQL compiler to relate back to the s in the GROUP BY clause. Make your intent more obvious to the SQL compiler with the DISTINCT keyword following SELECT. In a query language that conforms to the relational model, the duplicated rows should not appear at all in a relation. Perhaps SAS is trying to prevent misleading results of summary ...

Re: Program objects
Scott, Yes, you need *USE, *OBJMGT & *OBJEXIST authority to the pgm. The UPDPGM helptext has the details. So that would rule out anyone with only *USE authority. --Dave Scott Ashby wrote: >Dave, > >I appreciate your prompt response. I would assume that an individual >doing such a change would require either a) ownership of the program >object, or b) *ALL authority to the object, correct? The development >staff (who would be the folks most likely to do this) have *USE access >to the object only. > >Based on this, could I rule this possiblity out? > >T...

how to change the change defaults
hi friends, it might be a stupid question to state. but i really need to know while programming, to change the defaults like changing the engineering notation of a real quantity i.e. fraction values or change the fix parameters to denote real value if our calculations involve the values as low as 0.000000001 and as high as 10000000. thanks hemu bisht ...

DST to change or not to change?
Should the clocks be changed twice a year or not? (not that we have much say in the matter) Some think it saves lives by avoiding traffic accidents and note the advantages of a coordinated timekeeping system for trade. http://www.theglobeandmail.com/servlet/story/RTGAM.20050811.wdaylight0810/BNStory/National Since most of Canada is between north latitude 49 deg to 90 deg, and the days and nights are longer the further north you go, the arguments for saving daylight seem to be overwhelmed by the larger natural changes. OTOH DST is not needed at smaller latitudes in the tropics. ...

Re: problem changing frequency
In comp.soft-sys.ptolemy, Wit Dybowski <ronix1@wp.pl> writes: -------- > I'm a new user of PtolemyII and recently, I've encountered some > problems with changing frequency in ContinuousSinewave actor > dinamically. I've built a CompositeActor which counts periods of > sinusoid and after fully finished period tells to ContinuousSinewave > actor to change frequency. I've made this by sending number of periods > to ContinuousSinewave actor using SetVarable actor, where the > parameter name is "freq" which sets frequency in ContinuousSin...

Re: How to change Folder location in SAS
-sasinitialfolder in config.sas or the startup line. It's been discussed recently in SAS-L. Paul Choate DDS Data Extraction (916) 654-2160 > -----Original Message----- > From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of > jingtailan@gmail.com > Sent: Friday, February 10, 2006 9:48 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: SAS: How to change Folder location in SAS > > does some one know how to change forlder location in SAS. I can do that > in WORD by /Tools/Options/Folder location/ > > thank you ...

Re: Change number of digits in SAS
Christine: What do you mean by "Number of digits"? The format of the number as displayed? A rounded version of the value itself? And what's being estimated? Could you give us an example--a little data, a little SAS code--to show us what you're aiming for? mfG, Roger -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Christine Wieck Sent: Wednesday, July 14, 2004 7:40 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Change number of digits in SAS Hello Experts, probably an easy thing, but I can't figure out how to do. I want to...

Re: pc sas directory change
x 'cd C:\YOUR_NEW_PATH' ; or if you are running V9, you can use %sysexec to change the directory. HTH, Ken In a message dated 10/12/2006 2:09:25 AM Eastern Standard Time, hba2pd@GMAIL.COM writes: Hello, I would like to change the default directory to desktop or my document so that files in the work directory will be saved there. How can I do this? Best regards, ...

Re: changing autoexec.sas #3
> From: William Kossack > one user wants to be able to click on a perminent sas dataset and have > the formats and labels be automatically available you don't need an autoexec for that you need to have written the attrib statement into the data step that created the data set. data x; attrib VarA length = \$ 4 format = \$VarA. label = 'VarA label goes here' ; ....; > the only way I can figure to do this is in the autoexec.sas file My directory naming conventions don't have *.sas and *.sas7bdat in the same directory. so while I have no experience doing the fo...

Re: changing autoexec.sas #4
This isn't exactly the same thing, but here's a windows script that will allow a user to right-click on a sas7bdat & immediately see html PROC CONTENTS output. Save the below to a file w/a .wsf extension (e.g., QuickContents.wsf). Double-click it once to have it put an icon in your SendTo folder. Then navigate to a sas file in explorer, right-click on a sas7bdat file & choose 'QuickContents' off the Send To menu. It's hard-coded to use sas v8, tho that could be changed pretty easily... Cheers, -Roy ' ---------------------------------------- <package>...

Re: changing autoexec.sas #2
Hi William, Typically if an autoexec.sas goes in the same directory where the sas.exe is located. One way to find out where it is, is to rightclick on your sas icon or the START/PROGRAMS/SAS.../sas.exe icon and select Properties to see what the drive and path is. For example, on my machine, the beginning of the command line in the Properties is: "C:\Program Files\SAS\SAS 9.1\sas.exe" If an AUTOEXEC.SAS does not exist, you can create a text file with your favorite editor, in the same directory as the sas.exe file. In my case I would create autoexec.sas in the path C:\Program F...

Re: Re: Changing CellMargins?
I followed your steps in editing the Default.nb style file and see no problem. You can replace any "Inherited" value by a value of your formatting needs. You do not have to "inherit" any value. You can change the CellMargin values of the working environment or at lower levels if you need. I would like to recommend to you to import a local copy of the style file, and practice on it before changing (permanently, if you are not careful enough). Good luck, yehuda -----Original Message----- From: AES/newspost [mailto:siegman@stanford.edu] Subject: Re: Changing Cel...

Re: Change MAC Address Can Change IP Address of a Machine? #5
In article <telecom24.444.6@telecom-digest.org>, <jrefactors@hotmail.com> wrote: > Is there any way to change the MAC address of a machine? Yes. > IP address is assigned by ISP. My understanding is that IP address > is based on the MAC address of a machine, is that correct concept? Maybe. depends on the ISP. > Please advise. Don't mess with what you don't understand. :) ...

Re: Change MAC Address Can Change IP Address of a Machine? #7
It was a dark and stormy night when jrefactors@hotmail.com wrote: > Is there any way to change the MAC address of a machine? What they said. There are also Windows programs, both shareware and freeware, that will change a computer's MAC address (check repositories such as http://www.tucows.com). ...

Re: pc sas directory change #2
.... u see what you get, if you ask as unclear as you do! Everybody understands completely different things what you might mean! On Thu, 12 Oct 2006 06:33:56 EDT, Ken Borowiak <EvilPettingZoo97@AOL.COM> wrote: >x 'cd C:\YOUR_NEW_PATH' ; > >or if you are running V9, you can use %sysexec to change the directory. > >HTH, >Ken > >In a message dated 10/12/2006 2:09:25 AM Eastern Standard Time, >hba2pd@GMAIL.COM writes: >Hello, > >I would like to change the default directory to desktop or my document >so that files in the work directory will be saved there. How can I do >this? > >Best regards, ...

Re: change to SAS date format #2
What is date? Is it data you are inputting from an external file? Is it a character variable that already exists in a SAS data set? If so, is it a character or numeric variable? -----Original Message----- From: Stanley Luo Sent: Tuesday, May 05, 2009 10:14 AM To: SAS-L@LISTSERV.UGA.EDU Subject: change to SAS date format Dear SAS-L users: How do I change the column 'date' below to SAS date format? e.g. yymmddw.10 Thanks in advance! date 20020102 20020103 20020104 20020107 20020108 20020109 20020110 20020111 20020114 20020115 20020116 20020117 ...

Re: Changing ORACLE date to SAS date
NEW_OPEN_DT = datepart(OPEN_DT); By the way, this actually changes 1430870400 to 16561. To demonstrate, run: data _null_; OPEN_DT = '5may2005 00:00:00'dt; NEW_OPEN_DT = datepart(OPEN_DT); format open_dt datetime. new_open_dt date9.; put _all_; put (open_dt new_open_dt)(=best12.); run; You should see: OPEN_DT=05MAY05:00:00:00 NEW_OPEN_DT=05MAY2005 _ERROR_=0 _N_=1 OPEN_DT=1430870400 NEW_OPEN_DT=16561 On Tue, 17 May 2005 17:17:08 -0400, Abul Azad <abul.azad@COMMERCEBANK.COM> wrote: >I wrote the following code to change "5/5/2000" to &qu...

Re: How to change Folder location in SAS #2
Right click your SAS Icon used for invocating SAS and select properties. There's the target box - it says something like: "C:\Program Files\SAS\SAS 9.1\sas.exe" change this to: "C:\Program Files\SAS\SAS 9.1\sas.exe" -sasinitialfolder "C:\Documents and Settings\userid\Desktop\" or wherever you want. Alternately, the config file is named SASV9.CFG. Search your hardrive to find it. If you want to put the instruction there add/modify a line to it that says: -sasinitialfolder "C:\Documents and Settings\userid\Desktop\" Of course "userid&...

Re: changing the position of the pointlabels in sas graph and
Hi sassql, Frustration with pointlabel caused me to learn how to use the Annotate facility. If you really want to control where you place items on the graph this is your best bet. As to your vertical centering of the pointlabel (if this is what you meant), try POSITION=TOP | MIDDLE | BOTTOM For formatting the axis, do you want to skip the space on the axis for these dates? If so, maybe try coding the date as a string, so that the x axis is a character axis. I think you should be careful with this since it will appear to be a continuous series on the graph, when it is not. data a; informat x date9. y 2.; infile datalines missover; input x y p ps \$; length newx \$10; newx=putn(upcase(x),'date9.'); datalines; '01jan2005'd 10 .1 '02jan2005'd 11 .05 * '03jan2005'd 12 .9 '06jan2005'd 10 .45 '08jan2005'd 14 .75 '09jan2005'd 11 .01 * '10jan2005'd 8 .11 '18jan2005'd 11 .33 ; run; goptions reset=all ; symbol1 i=none v=dot c=blue pointlabel=(h=1 '#ps' position=bottom); proc gplot data=a; plot y*newx ; run;quit; Let me know if I missunderstood what you are trying for. Sam On 9/12/07, sassql@gmail.com <sassql@gmail.com> wrote: > Dear all, > > I have a graph where i am using the point label option to display the > time points where the pvalue is significant. However does anyone know > if i can change the position of those point labels. For example at > week2 for mean va...

Re: pc sas directory change #4
On Wed, 11 Oct 2006 23:08:41 -0700, hba2pd <hba2pd@GMAIL.COM> wrote: >Hello, > >I would like to change the default directory to desktop or my document >so that files in the work directory will be saved there. How can I do >this? > >Best regards, have a look at system option USER= Pointing that at a library allocated to (whereever you want) libname mydoc '{some path, like wherever, even my documents}' ; option user= MYDOC ; will send one-level sas datasets (and views) into the MYDOC library. Good Luck Peter ...

Re: Change in posting privs on SAS-L
I hope it will help, but at least some of the recent email trojans appeared to come from a legitimate email address (Tracy Cermack's). That doesn't mean it came from her machine, only that someone forged mail from her (a frequent virus/trojan tactic), so sending a rejection to her would only add to the total junk mail being send around. It might be necessary to silently delete anything with an attachment. -- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA >>> "Paul Thompson" <paul@...

Web resources about - Re: Changes and frequency of changes - comp.soft-sys.sas

Frequency - Wikipedia, the free encyclopedia
Three cyclically flashing lights, from lowest frequency (top) to highest frequency (bottom). For each light, "f" is the frequency in hertz (Hz) ...

Frequency - Wikipedia, the free encyclopedia
Three cyclically flashing lights, from lowest frequency (top) to highest frequency (bottom). For each light, "f" is the frequency in hertz (Hz) ...

Bloomberg Pursuits Increases Publishing Frequency
Bloomberg Pursuits, a magazine for extremely wealthy people, has increased its publishing frequency to six times per year. Each new issue of ...

What is CPU frequency scaling?
One of the most important (and obvious) characteristics of mobile computing is that mobile devices use batteries rather than being plugged into ...

Twitter Unveils New ‘Trust and Safety Council’ Featuring Feminist Frequency
Twitter has announced a new “Trust and Safety council” for the service, including controversial web series Feminist Frequency.

ZTE and China Mobile Jointly Announce Latest 5G High-Frequency Prototype
Business Wire (press release) ZTE and China Mobile Jointly Announce Latest 5G High-Frequency Prototype Business Wire (press release) SHENZHEN, ...

Experimental Study Shows Marijuana Slashes Frequency Of Migraines
Experimental Study Shows Marijuana Slashes Frequency Of Migraines

What goes up must come down. Except the frequency of New Year's celebratory gunfire: GunFAIL CLXXIV
Wow, what a week! By now you’ve noticed that the hunting accidents are on the decline, but longtime followers of GunFAIL know very well that ...

Riley Smith To Star In the CW’s ‘Frequency’ Reboot
Riley Smith ( Nashville, True Detective ) is set as the male lead in Frequency , the CW’s drama pilot based on Toby Emmerich's sci-fi thriller. ...

Feminist Frequency makes new Twitter Trust and Safety Council
I love Twitter . to celebrate.... bringing back a classic....been a while since one of these bad boys... pic.twitter.com/Zyn5y5lRhl — your welcome ...

Resources last updated: 3/18/2016 12:56:50 AM