Programming the statistical procedures from SAS

How can I create the statistics output for two different time period in one output

Reply
Occasional Contributor
Posts: 5

How can I create the statistics output for two different time period in one output

I have six month of data out of which first three months i need to label it as before and next three month as after. and I have variables such as

ID date year quarter month  result size location state and few others.

I have to compute the statistics (counts, percentage and statistics such as significance testing and model creating) using proc freq or proc glm for before and after time period.now my question is, is it possible to calculate the statistics for before and after time in same proc and produce the result in same output for easy comparison. ? if so what are the changes that should be done to the data (i tried splitting the variables in to 1 and 2 and used different tables statement, but i did not find it to be so fruitful ) or is it possible to do it in one procedure?

Respected Advisor
Posts: 4,606

Re: How can I create the statistics output for two different time period in one output

You can use a format to divide the dates in two periods. For example:

proc format;

value BA

low - '12JUN2013'd = "Before"

'13JUN2013'd - high = "After";

run;

proc glm data=myData;

format date BA.;

class date;

model y = date;

run;

proc freq data=myData;

format date BA.;

tables date*state / chisq;

run;

PG

PG
Ask a Question
Discussion stats
  • 1 reply
  • 167 views
  • 0 likes
  • 2 in conversation