BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
pkfamily
Obsidian | Level 7

Is there a way to do multiple pairwise T-test comparisons against a reference group? For example, let's say our group is race with white, black, and hispanic. We then choose our reference group to be white. And our continuous variable to be blood pressure. What is the best way to get the "Diff (1-2) Pooled" output from proc ttest for white vs black and white vs hispanic? 

 

In the end, I want to get the difference means, CL, and P-value for multiple variables (race, education, income, etc..) and ouput into a table. (But I can figure this part out myself)

1 ACCEPTED SOLUTION

Accepted Solutions
pkfamily
Obsidian | Level 7

Looks like the answer is Proc GLM with the lsmeans statement and options cl, pdiff=Control, and adjust=t.

 

Proc GLM data=mydata;

class race;

model bp=race;

lsmeans race/cl pdiff=control adjust=t;

run;

View solution in original post

1 REPLY 1
pkfamily
Obsidian | Level 7

Looks like the answer is Proc GLM with the lsmeans statement and options cl, pdiff=Control, and adjust=t.

 

Proc GLM data=mydata;

class race;

model bp=race;

lsmeans race/cl pdiff=control adjust=t;

run;

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
  • 1981 views
  • 1 like
  • 1 in conversation