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

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Bray Curtis Dissimilarity

- 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 02-27-2019 02:21 PM
(1387 views)

Hi!

I am trying to calculate Bray Curtis Dissimilarity in SAS by proc distance.

I found an example on the next page:https://www.statisticshowto.datasciencecentral.com/bray-curtis-dissimilarity/

According to the Formula, the result must be 0.39

The same numbers I am getting in the R vegan.

Proc distance producing different results.

data c; infile datalines; input id $ A1 A2 A3 ; datalines; Fish_1 6 7 4 Fish_2 10 0 6 ; run; proc distance data=c method=blwnm; var ANOMINAL( A: ) ; id id; run;

Results:

id | Fish_1 | Fish_2 |

Fish_1 | 0 | |

Fish_2 | 0,6 | 0 |

What am I doing wrong here?

Thanks,

Andrii

1 ACCEPTED SOLUTION

Accepted Solutions

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

Hi @andrii and welcome to the SAS Support Communities!

Thanks for this interesting question. I didn't know this specific dissimilarity measure.

In the PROC DISTANCE documentation (close to the bottom of that page) I found that the formula SAS uses with method=blwnm is not equivalent to your linked formula. However, SAS provides an equivalent formula with method=**nonmetric**. Actually, the formula looks different, but it's an easy exercise to show that it's equivalent (hint: abs(x-y)=x+y-2*min(x,y)).

So, in order to replicate your result, use this code:

```
proc distance data=c out=want method=nonmetric;
var ratio(a:);
id id;
run;
```

(Note that level "ratio" is required for method=nonmetric.)

2 REPLIES 2

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

Hi @andrii and welcome to the SAS Support Communities!

Thanks for this interesting question. I didn't know this specific dissimilarity measure.

In the PROC DISTANCE documentation (close to the bottom of that page) I found that the formula SAS uses with method=blwnm is not equivalent to your linked formula. However, SAS provides an equivalent formula with method=**nonmetric**. Actually, the formula looks different, but it's an easy exercise to show that it's equivalent (hint: abs(x-y)=x+y-2*min(x,y)).

So, in order to replicate your result, use this code:

```
proc distance data=c out=want method=nonmetric;
var ratio(a:);
id id;
run;
```

(Note that level "ratio" is required for method=nonmetric.)

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

Hi @FreelanceReinh

Yes, it exactly what I have been looking for!

Thanks a lot!

**SAS Innovate 2025** is scheduled for May 6-9 in Orlando, FL. Sign up to be **first to learn** about the agenda and registration!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Ready to level-up your skills? Choose your own adventure.