BookmarkSubscribeRSS Feed
vivianchu
Calcite | Level 5

I am trying to obtain the means and variances of grip-strength across time by group and Plot the group means across time.

The data order is ID, Group(0=placebo and 1= treatment), Time (0-3), Grip Strength, Status (0= no pain and 1 = pain)

The data I have is long data, and I plot the means across time by group before with following SAS code


PROC SUMMARY NWAY DATA=Final.exam;

CLASS GROUP;  VAR measu1 measu2 measu3 measu4;

OUTPUT OUT=heart.B MEAN = ameasu1 ameasu2 ameasu3 ameasu4;

DATA HEART.PLOT;

SET heart.B;

ARRAY ameasu(4)  ameasu1 ameasu2 ameasu3 ameasu4;

DO TIME = 1 TO 4;

MEANMEASU = ameasu(TIME);

OUTPUT;

END;

DROP  ameasu1 ameasu2 ameasu3 ameasu4;

end;

PROC gPLOT

PLOT MEANMEASU*TIME=Group;

FORMAT Group Group.;

RUN;

So should I change long data to wide data and run the above code?

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
  • 0 replies
  • 1293 views
  • 0 likes
  • 1 in conversation