SAS procedures those I have used
Proc Print Data=Example_Data;Run;
This procedure is very
helpful for me when I want to glance the data to get a sense how do it look and
to validate output of any code. This can be used with options like obs=N to
print only top N observations. When firstobs=M option is used with obs=N
(where N>M) along with the print procedure it prints observations from
M to N. So you can view observations irrespective of its order in the
dataset.
Proc expand:
A year back I had
used a procedure called Proc Expand to impute missing values in time series
data and also to convert data from high level to lower level such as from week
level to day level or low level to high level such as week to month. This
procedure is very handy when we want to impute missing values in time series
data of thousand of the line item. In other words if we have panel data
then we can use it. Its syntax is very simple. It uses extrapolation and
interpolation techniques to convert the data from
high to low level. But it when using this procedure you should be careful as it
also results in negative values. The syntax is written below
PROC EXPAND DATA=
options ;
BY variables
;
CONVERT variables
/ options ;
ID variable
;
Run;
By variables : It list the variables which indicates levels
of a cross-sectional variable;
ID variables : indicates SAS time variable;
Convert Variable indicates the variable which has to be aggregated
or interpolated. Using the option we can define the method to
aggregate/interpolate
In the data option we can define the output data set name and
frequency of aggregation/interpolation in the time dimension. Such year to
quarter etc;
Comments
Post a Comment