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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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