Programming the statistical procedures from SAS

Multiple Pairwise T-test Comparisons against a reference group

Accepted Solution Solved
Reply
Contributor
Posts: 24
Accepted Solution

Multiple Pairwise T-test Comparisons against a reference group

[ Edited ]

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)


Accepted Solutions
Solution
‎04-14-2017 05:10 PM
Contributor
Posts: 24

Re: Multiple Pairwise T-test Comparisons against a reference group

[ Edited ]

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


All Replies
Solution
‎04-14-2017 05:10 PM
Contributor
Posts: 24

Re: Multiple Pairwise T-test Comparisons against a reference group

[ Edited ]

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;

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 69 views
  • 1 like
  • 1 in conversation