BookmarkSubscribeRSS Feed
haoduonge
Quartz | Level 8

Hi all,

I calculate sample size for a stepped wedge design, follow instruction in this paper [swdpwr: A SAS macro and an R package for power calculations in stepped wedge cluster randomized tria...]

Below is code in part 5.1 page 17, but get the error – please see output right after.

Can you tell how to fix it?

Thank you!

Hao

 

 

*The EPT Trial;

data ept;

input numofclusters time1 time2 time3 time4 time5;

cards;

6 0 1 1 1 1

6 0 0 1 1 1

6 0 0 0 1 1

6 0 0 0 0 1

;

run;

 

%swdpwr(K = 162, design = ept, family = "binomial", model = "marginal",link = "log", type = "cross-sectional", meanresponse_start = 0.05,

meanresponse_end0 = 0.049, meanresponse_end1 = 0.035, typeIerror = 0.05,alpha0 = 0.0047, alpha1 = 0.0047)

 

--OUTPUT

1 The SAS System                                                                                                                                                       11:01 Saturday, February 25, 2023

 

1          %_eg_hidenotesandsource;

5          %_eg_hidenotesandsource;

WARNING: Unsupported device 'ACTIVEX' for EXCEL(EGXLSSX) destination. Using device 'ACTXIMG'.

WARNING: Apparent invocation of macro SWDPWR not resolved.

36        

37         %swdpwr(K = 162, design = ept, family = "binomial", model = "marginal",link = "log", type = "cross-sectional", meanresponse_start = 0.05,

           _

           180

ERROR 180-322: Statement is not valid or it is used out of proper order.

38         meanresponse_end0 = 0.049, meanresponse_end1 = 0.035, typeIerror = 0.05,alpha0 = 0.0047, alpha1 = 0.0047)

39        

40        

41         %_eg_hidenotesandsource;

 

NOTE: Writing EXCEL(EGXLSSX) file: /saswork/SAS_work9FC300000DDB_vhacdwdwhsas12.vha.med.va.gov/#LN00108

56         

57        

58         %_eg_hidenotesandsource;

61        

 

2 REPLIES 2
ballardw
Super User

This error:

37 %swdpwr(K = 162, design = ept, family = "binomial", model = "marginal",link = "log", type = "cross-sectional", meanresponse_start = 0.05,

_

180

ERROR 180-322: Statement is not valid or it is used out of proper order.

38 meanresponse_end0 = 0.049, meanresponse_end1 = 0.035, typeIerror = 0.05,alpha0 = 0.0047, alpha1 = 0.0047)

39

 

Means that the macro named SWDPWR has not been compiled in the current session. That means before you can use the macro call you have to have the code and submit the statements that start:

%macro swdpwr ( <parameters>);

and ends with

%mend;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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