BookmarkSubscribeRSS Feed
karthigao
Fluorite | Level 6

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?

1 REPLY 1
PGStats
Opal | Level 21

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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 1266 views
  • 0 likes
  • 2 in conversation