Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 08-05-2015 05:55 AM
(665 views)

Hello all,

Some time ago, I wrote a code for power analysis for t-test, based on Rick's book on Simulations with SAS, and following a bug Rick published this code instead (here in the forum - the code is incomplete, I didn't want to publish it all although Rick already did):

/********************************************************************

Effect of Sample Size on the Power of the t Test

*******************************************************************/

%let NumSamples = 1000; /* number of samples */

data PowerSizeSim(drop=i Delta);

call streaminit(321);

Delta = 3; /* true difference between means */

do N = 5, 7, 8, 10, 12, 15, 20;/* sample size */

do SampleID = 1 to &NumSamples;

do i = 1 to N;

c = 1; x1 = rand("Normal", 0, 2); output;

c = 2; x1 = rand("Normal", Delta, 2); output;

end;

end;

end;

run;

/* 2. Compute statistics */

%ODSOff

proc ttest data=PowerSizeSim;

by N SampleID;

class c;

var x1;

ods output ttests=TTests(where=(method="Pooled"));

run;

%ODSOn

/* 3. Construct indicator var for obs that reject H0 */

data ResultsSize;

set TTests;

RejectH0 = (Probt <= 0.05);

run;

proc freq data=ResultsSize noprint;

by N;

tables RejectH0 / out=SimPower(where=(RejectH0=1));

run;

Now I want to make a change, and I am not sure how to.

Instead of t-test, I want multiple tests. For example, the classic case: Clinical trial with 2 doses and a placebo, i.e., 2 comparisons (T1 vs. P and T2 vs. P). I want to use PROC MULTTEST with the Hochberg adjustment for the p values, and I define success to be when at least one dose is significantly different than the placebo (more precisely the outcome variable X is different) . For simplicity we can assume equal variances. How would you change the syntax to to that ?

I think (not sure) that the inner procedure I need is:

ods output pValues = PV;

proc MULTTEST data = testdata hochberg pvals;

class Group;

test mean(X);

contrast 'T1 vs. P' -1 1 0;

contrast 'T2 vs. P' -1 0 1;

run;

It already creates a dataset with p values. So I need an assistant just in integrating it all.

Thank you in advance !

1 REPLY 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Well, you should include the BY statement:

BY N SampleID;

From your post, it sounds like you know how to simulate the data and your question is just "How do I use PROC MULTTEST?"

If that assumption is correct, I'll let others who are more familiar with PROC MULTTEST answer your question. It doesn't sound like this question is connected to SAS/IML, so if you don't get a quick response, you might want to post this question to the SAS Statistcs Support Community: https://communities.sas.com/community/support-communities/sas_statistical_procedures

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.