Turn on suggestions

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

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Proc Power Paired Frequency: How to correctly populate the "discpropor...

Options

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

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

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

Posted 10-12-2018 04:54 PM
(2748 views)

I'm trying to figure out how to correctly populate the "discproportions=" option in PROC POWER for McNemar's test. I've looked in the documentation (https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_power_sect0...) but am still struggling to understand.

For context, I'm on version 9.4, my data is below, along with with 2x2 table and McNemar's test being requested from PROC FREQ, and IML syntax to make sure I'm clear on what's happening behind the scenes:

```
data study;
input Subject Before After;
datalines;
1 1 1
2 0 1
3 0 0
4 0 1
5 1 1
6 0 0
7 0 1
8 1 1
9 0 1
10 1 1
11 0 0
12 1 0
13 0 1
14 1 0
15 0 0
16 1 1
17 0 1
18 1 1
19 0 0
20 0 1
21 1 1
22 0 1
23 0 0
24 1 1
25 0 1
;
run;
proc freq data=work.study;
tables Before*After / agree nocol norow nopercent;
run;
```

proc iml;

dis1=9;

dis2=2;

chisq=((dis1-dis2)**2)/(dis1+dis2);

pvalue=1-probchi(chisq,1);

print chisq, pvalue;

quit;

The p-value is <0.05, but I suspect power is less than ideal with a sample size of 25. Here's where my code in PROC POWER:

```
proc power;
pairedfreq dist=normal method=connor
test=mcnemar
discproportions = <??> | <??>
npairs = 25
power = .;
run;
```

I'm unclear how to calculate the discordant proportions from the 2x2 table, and how they are arranged in the discproportions= statement. Figuring that power will be pretty low with 25 subjects, ultimately I want to rearrange the npairs= and power= statements to determine how many subjects are needed to attain a power of 0.90.

Thanks in advance for any guidance on this (especially at 5:00 pm on a Friday!)

1 ACCEPTED SOLUTION

Accepted Solutions

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

My guess would be

```
proc freq data=work.study;
tables Before*After / nocol norow chisq;
run;
```

Table of Before by After Before After Frequency| Percent | 0| 1| Total ---------+--------+--------+ 0 | 6 | 9 | 15 | 24.00 | 36.00 | 60.00 ---------+--------+--------+ 1 | 2 | 8 | 10 | 8.00 | 32.00 | 40.00 ---------+--------+--------+ Total 8 17 25 32.00 68.00 100.00

to get the discordant (off-diagonal) proportions, and

```
proc power;
pairedfreq dist=normal method=connor
test=mcnemar
discproportions = (.36 .08)
npairs = 25
power = .;
run;
```

McNemar Normal Approximation Test Fixed Scenario Elements Distribution Asymptotic normal Method Connor normal approximation Success-Failure Proportion 0.36 Failure-Success Proportion 0.08 Number of Pairs 25 Number of Sides 2 Alpha 0.05 Computed Power Power 0.566

to get the power.

PG

2 REPLIES 2

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

My guess would be

```
proc freq data=work.study;
tables Before*After / nocol norow chisq;
run;
```

Table of Before by After Before After Frequency| Percent | 0| 1| Total ---------+--------+--------+ 0 | 6 | 9 | 15 | 24.00 | 36.00 | 60.00 ---------+--------+--------+ 1 | 2 | 8 | 10 | 8.00 | 32.00 | 40.00 ---------+--------+--------+ Total 8 17 25 32.00 68.00 100.00

to get the discordant (off-diagonal) proportions, and

```
proc power;
pairedfreq dist=normal method=connor
test=mcnemar
discproportions = (.36 .08)
npairs = 25
power = .;
run;
```

McNemar Normal Approximation Test Fixed Scenario Elements Distribution Asymptotic normal Method Connor normal approximation Success-Failure Proportion 0.36 Failure-Success Proportion 0.08 Number of Pairs 25 Number of Sides 2 Alpha 0.05 Computed Power Power 0.566

to get the power.

PG

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

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. **Registration is now open through August 30th**. Visit the SAS Hackathon homepage.

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.