Statistician

SAS lag problems

I just found an interesting (that’s interesting in the ‘I just spent an hour debugging that?’ sense) characteristic in SAS. If you have a variable, x, and are using the lag of x, do NOT put the lag(x) inside a conditional statement. This can apparently cause some pretty strange results. It is probably easier to see through code than to explain:

Continue Reading »

Programmer
SAS
Statistician

Comments (23)

Permalink

SAS Macro Variables: How to Take a Mean in SAS

I just thought I’d do a quick post about SAS macro variables. They’re a pretty important part of SAS but when I had just started people told me not to worry about them and to just enter values by hand. After I finally got tired of constantly looking up results and entering them into programs over and over again, I decided I had better figure out how real programmers did it. As a side note, I’ve had a couple people tell me SAS was dying out but I see it appears to be in the top 20 of programming languages so I guess it’s going strong.

Continue Reading »

Programmer
SAS
Statistician

Comments (5)

Permalink