Turn on suggestions

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

Showing results for

- Home
- /
- Programming
- /
- Programming
- /
- Stratified Newcombe method when zero responder in control arm

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**.
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 2 weeks ago
(631 views)

Dear,

I am calculating CI using stratified Newcombe method in Proc Freq, however i have control arm with zero responder and this study have two stratification factor, while running to code i m getting message that

"NOTE: Newcombe confidence limits for the common risk difference cannot be computed for this table (Treatment by Responder

controlling for startum) due to zero-frequency rows, columns, or cells."

I checked paper and it is possible that we can calculate CIs even L2 and U2 are zero. could you please help why SAS is not showing results in this particular case.

1 ACCEPTED SOLUTION

Accepted Solutions

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

The macro is giving you the wrong answer. This is technical, but the macro doesn't properly handle missing values in the section that uses proc IML. In proc IML, as stated in the warning, division by zero produces a matrix of missing values. However, if you take the sum of a matrix of missing values, you will get zero, which is probably not what you expect. For example, try running the following code:

```
proc iml;
x = {. . , . . };
print x;
y = x[+, ];
print y;
run;
```

The code stores the column sums of the matrix x in the matrix y. You'll note, however, that y is a matrix of zeros, even though the intuitive result would be a matrix of missing values. (The reasons for this behavior are beyond the scope of this post).

This comes into play in the following lines of the macro:

```
newcombe_L2 =wilson_L2[+,];
newcombe_U2 =wilson_U2[+,];
```

The wilson_L2 and wilson_U2 matrices contain only missing values, but newcombe_L2 and newcombe_U2 will contain zeros because of the behavior I described above.

Those zeros are not the correct values for the computation, and you get the wrong values for the confidence interval. Proc FREQ handles this situation correctly and gives you a note that the Newcombe confidence interval cannot be computed in this situation.

9 REPLIES 9

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

You should as a minimum include the code you are currently running, better would be to include a data step to create data or use the code on a SAS supplied data set that has the same behavior.

Better would be to include a link to a paper that references how to calculate the CI when L2 and U2 are 0.

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

The formulas for the stratified Newcombe confidence limits are given here: https://go.documentation.sas.com/doc/en/statcdc/14.3/statug/statug_freq_details62.htm

You will see that zero frequency rows/columns/cells will lead to division by zero in the formula, which is why you get that note.

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

I wanted to understand from below formula where cause issue, if L2 and U2 are zero due to zero responder in strata 2, but we have values for L1 and U1 so if we include in Below L and U still you can Lower and Upper, but I am not sure whether it reliable or not.

You could refer below paper (SAS macro) where it provides the Stratified Newcombe confidence limit with zero responder in one of strata. But I am not sure how reliable it is, that could reason SAS is not showing results in such cases (where zero responder in one of strata)

https://www.pharmasug.org/proceedings/2013/SP/PharmaSUG-2013-SP04.pdf

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

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

Pls see attachment of SAS code, suppose I have zero responder in strata 2 then "proc freq" unable to provide Newcombe confidence limit with note that,

" NOTE: Newcombe confidence limits for the common risk difference cannot be computed for this table (Treatment by Responder

controlling for startum) due to zero-frequency rows, columns, or cells."

However if I use that macro then I gets values for CI for Newcombe .

Please help why it is happening from SAS, why SAS is giving results, it is due to CI is not reliable even it is calculable ?

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

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

I apologies, i made some change in macro so it was giving error. I attached now corrected one.

I agree it gives warning "WARNING: Division by zero, result set to missing value.",

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

Sorry see attached Marco with stimulation data , please ignore previous one

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

The macro is giving you the wrong answer. This is technical, but the macro doesn't properly handle missing values in the section that uses proc IML. In proc IML, as stated in the warning, division by zero produces a matrix of missing values. However, if you take the sum of a matrix of missing values, you will get zero, which is probably not what you expect. For example, try running the following code:

```
proc iml;
x = {. . , . . };
print x;
y = x[+, ];
print y;
run;
```

The code stores the column sums of the matrix x in the matrix y. You'll note, however, that y is a matrix of zeros, even though the intuitive result would be a matrix of missing values. (The reasons for this behavior are beyond the scope of this post).

This comes into play in the following lines of the macro:

```
newcombe_L2 =wilson_L2[+,];
newcombe_U2 =wilson_U2[+,];
```

The wilson_L2 and wilson_U2 matrices contain only missing values, but newcombe_L2 and newcombe_U2 will contain zeros because of the behavior I described above.

Those zeros are not the correct values for the computation, and you get the wrong values for the confidence interval. Proc FREQ handles this situation correctly and gives you a note that the Newcombe confidence interval cannot be computed in this situation.

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.