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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1320 views
  • 0 likes
  • 2 in conversation