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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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