<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Concordance Correlation Coefficient in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/953261#M42829</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/471624"&gt;@vedatoguz&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, I think I can help you with the macro code, but only in the next few days -- sorry for the delay -- and only for the CCC itself (not: confidence interval), i.e., based on the code I proposed to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301821"&gt;@Luke01&lt;/a&gt;&amp;nbsp;five years ago.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hint for your future questions: In this forum (unlike some others) it is always better to start your own thread than to add a new request to someone else's old thread.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2024 17:12:14 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2024-12-11T17:12:14Z</dc:date>
    <item>
      <title>Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610174#M18042</link>
      <description>&lt;P&gt;Hi community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im having trouble trying to calculate&amp;nbsp;Concordance Correlation Coefficient. How can i do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am aware of:&amp;nbsp;&lt;A href="https://newonlinecourses.science.psu.edu/stat509/node/161/" target="_blank"&gt;https://newonlinecourses.science.psu.edu/stat509/node/161/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it seems to have old procedures that are not relevent for more recent SAS versions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 05:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610174#M18042</guid>
      <dc:creator>Luke01</dc:creator>
      <dc:date>2019-12-07T05:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610185#M18043</link>
      <description>&lt;P&gt;Did you try the FOUR kind of correlation coefficient in PROC CORR.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc corr data=sashelp.class kendall;
var weight height;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Dec 2019 10:44:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610185#M18043</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-12-07T10:44:24Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610192#M18046</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301821"&gt;@Luke01&lt;/a&gt; look at the link I gave you in your &lt;A href="https://communities.sas.com/t5/SAS-Procedures/Reduced-major-axis-regression/m-p/610176#M76740" target="_self"&gt;other thread&lt;/A&gt; ... it was meant as a reference for you to refer back to as needed, not as a one time thing.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 11:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610192#M18046</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-07T11:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610196#M18047</link>
      <description>&lt;P&gt;yes it refers to kendels, i am after Lins.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 12:22:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610196#M18047</guid>
      <dc:creator>Luke01</dc:creator>
      <dc:date>2019-12-07T12:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610197#M18048</link>
      <description>&lt;P&gt;I am after lin's concordance correlation coefficient, not the same as correlation in terms of pearson's etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ie y=x.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 12:27:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610197#M18048</guid>
      <dc:creator>Luke01</dc:creator>
      <dc:date>2019-12-07T12:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610199#M18049</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301821"&gt;@Luke01&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can get the all the terms used in the formula from PROC CORR: Just use the &lt;A href="https://documentation.sas.com/?docsetId=procstat&amp;amp;docsetTarget=procstat_corr_syntax01.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#procstat.corr.covopt" target="_blank" rel="noopener"&gt;COV&lt;/A&gt; and &lt;A href="https://documentation.sas.com/?docsetId=procstat&amp;amp;docsetTarget=procstat_corr_syntax01.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#procstat.corr.outpopt" target="_blank" rel="noopener"&gt;OUTP=&lt;/A&gt; options. The rest is a simple calculation, e.g., in a DATA step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example (assuming a dataset HAVE with numeric variables X and Y with only non-missing values):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc corr data=have cov outp=stats noprint;
var x y;
run;

data want(keep=rc);
do until(last);
  set stats end=last;
  sxx+(_type_='COV')*(upcase(_name_)='X')*x;
  syy+(_type_='COV')*(upcase(_name_)='Y')*y;
  sxy+(_type_='COV')*(upcase(_name_)='X')*y;
  mx +(_type_='MEAN')*x;
  my +(_type_='MEAN')*y;
  n  +(_type_='N')*x;
end;
rc=2*sxy/(sxx+syy+(mx-my)**2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;RC is the concordance correlation coefficient as per the link you provided.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 13:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610199#M18049</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-12-07T13:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610234#M18060</link>
      <description>&lt;P&gt;Sorry for my ignorance im new to SAS and coding etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But what does sxx, my etc refer to?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do i need to sub my x and y variables in?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Same for _name_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just as I am getting 0 for rc which isnt right. Below is an example of what I did.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc corr data=HAVE cov outp=stats noprint;
var x_variable y_variable;
run;

data want(keep=rc);
do until(last);
  set stats end=last;
  sxx+(_type_='COV')*(upcase(_name_)='X')*x_variable;
  syy+(_type_='COV')*(upcase(_name_)='Y')*y_variable;
  sxy+(_type_='COV')*(upcase(_name_)='X')*y_variable;
  mx +(_type_='MEAN')*x_variable;
  my +(_type_='MEAN')*y_variable;
  n  +(_type_='N')*x_variable;
end;
rc=2*sxy/(sxx+syy+(mx-my)*2);
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&lt;/P&gt;</description>
      <pubDate>Sat, 07 Dec 2019 22:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610234#M18060</guid>
      <dc:creator>Luke01</dc:creator>
      <dc:date>2019-12-07T22:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610237#M18061</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301821"&gt;@Luke01&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;But what does sxx, my etc refer to?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;These are just arbitrary variable names. I used names reflecting the terms in the formula (e.g. sxx for &lt;FONT size="4"&gt;&lt;EM&gt;&lt;FONT face="times new roman,times"&gt;S&lt;SUB&gt;XX&lt;/SUB&gt;&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&amp;nbsp;). These variables are not kept in the output dataset (see the KEEP= option in the DATA statement -- but you may change that if you like), so their names don't really matter.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;So i need to sub my x and y variables in?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You need to replace the dataset name &lt;FONT face="courier new,courier"&gt;have&lt;/FONT&gt; in the PROC CORR step with the name of your dataset. If the variables in your dataset for which you want to compute the concordance correlation coefficient are not named &lt;FONT face="courier new,courier"&gt;x&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;y&lt;/FONT&gt;, you would ideally use a RENAME= dataset option in the PROC CORR step. So, using the example program (see the link on the web page you linked to in your initial post) the PROC CORR step would read:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc corr data=dice_baseline(rename=(cort_auc1=x cort_auc2=y)) cov outp=stats noprint;
var x y;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(where &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; is an arbitrary dataset name -- in case of a name conflict just use a different name).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, let PROC CORR work with the original names and then replace "x" and "y" by these names in the DATA step in &lt;EM&gt;nine&lt;/EM&gt; places, not only six as you did in your code: The character constants 'X' and 'Y' must also be replaced by 'X_VARIABLE' and 'Y_VARIABLE' (upper case is mandatory), respectively.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DATA step reads the output dataset &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; produced by PROC CORR, computes the&amp;nbsp;concordance correlation coefficient and stores it in a numeric variable named &lt;FONT face="courier new,courier"&gt;rc&lt;/FONT&gt; in a dataset&amp;nbsp;&lt;FONT face="courier new,courier"&gt;want&lt;/FONT&gt;&amp;nbsp;containing only one record. (Both &lt;FONT face="courier new,courier"&gt;rc&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;want&lt;/FONT&gt; are arbitrary names.)&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;BR /&gt;
&lt;P&gt;Same for _name_&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The output dataset from PROC CORR contains character variables&amp;nbsp;&lt;FONT face="courier new,courier"&gt;_type_&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;_name_&lt;/FONT&gt;&amp;nbsp;(these are default names) which contain names of statistics and variables, respectively, and are used in the DATA step. I wrote the DATA step looking at PROC PRINT output of dataset &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=stats;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Dec 2019 00:06:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/610237#M18061</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-12-08T00:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/618119#M19171</link>
      <description>&lt;P&gt;This worked perfectly for me, thank you!! Can the confidence interval for the CCC be obtained from this output as well?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 16:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/618119#M19171</guid>
      <dc:creator>tka726</dc:creator>
      <dc:date>2020-01-17T16:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/618216#M19181</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/203948"&gt;@tka726&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, in principle this is possible (e.g., the Pearson correlation coefficient from the PROC CORR output dataset &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; would be involved in the calculation; also the &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n0b3u4fao493mqn0z6t95qyq5kiw.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;TANH&lt;/A&gt; and &lt;A href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=p12zka3fbjyihln1gvybaxc8tr3e.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank" rel="noopener"&gt;ARTANH&lt;/A&gt; functions could be applied to simplify some terms). However, I found a couple of discrepancies between the formula used in the IML code from the psu.edu website linked by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301821"&gt;@Luke01&lt;/a&gt;&amp;nbsp;and a formula I saw elsewhere -- whereas the formulas for the point estimate were equivalent. Therefore, I'm hesitant to publish SAS code for the confidence interval, unless you provide a (link to a) reliable formula for it in mathematical notation like the formula for the point estimate on the psu.edu website.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jan 2020 22:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/618216#M19181</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-01-17T22:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/953235#M42827</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have about 40 variables to calculate the CCC and I am having hard time to create a macro. Especially for the portion of upcase(_name_=)&lt;/P&gt;&lt;P&gt;Would you be able to provide me a macro code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 14:31:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/953235#M42827</guid>
      <dc:creator>vedatoguz</dc:creator>
      <dc:date>2024-12-11T14:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/953261#M42829</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/471624"&gt;@vedatoguz&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, I think I can help you with the macro code, but only in the next few days -- sorry for the delay -- and only for the CCC itself (not: confidence interval), i.e., based on the code I proposed to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/301821"&gt;@Luke01&lt;/a&gt;&amp;nbsp;five years ago.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hint for your future questions: In this forum (unlike some others) it is always better to start your own thread than to add a new request to someone else's old thread.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 17:12:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/953261#M42829</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-12-11T17:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/953402#M42833</link>
      <description>&lt;P&gt;Thinking more about your request, I realized that a &lt;EM&gt;non-macro&lt;/EM&gt; solution is likely more efficient than a macro. Note that all the statistics needed for the calculation of the concordance correlation coefficients (CCCs) are contained in the output of PROC CORR, applied to the list of your about 40 variables. So, the CCCs can be computed in a DATA step going through the list of all ordered pairs of variables. This list, in turn, can be created from the PROC CORR output dataset&amp;nbsp;by PROC TRANSPOSE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example using the SAS-supplied dataset SASHELP.JUNKMAIL, from which I took an arbitrary list of 40 numeric variables just to demonstrate that the code works. The final dataset WANT contains &lt;FONT face="courier new,courier"&gt;comb(40,2)=780&lt;/FONT&gt; observations, one for each ordered pair of variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Compute mean values and empirical (co)variances */

proc corr data=sashelp.junkmail cov outp=stats noprint /* vardef=n */;
var make--direct; /* This variable list contains 40 (numeric) variables. */
run;

/* Create a "long" dataset from the empirical covariance matrix, avoiding redundant values of the statistic (_s) */

proc transpose data=stats(rename=(_name_=_var1)) name=_var2 out=covlist(where=(_var1&amp;lt;=_var2) rename=(col1=_s));
where _type_='COV';
by _var1 notsorted;
run;

/* Create a "long" dataset containing the mean values from the PROC CORR output dataset */

proc transpose data=stats(drop=_name_) name=_var1 out=means(rename=(col1=_s));
where _type_='MEAN';
run;

/* Compute the concordance correlation coefficients (_rc) as in the code posted on Dec 7, 2019 */

data want(keep=_var1 _var2 _rc);
set covlist(where=(_var1&amp;lt;_var2));
if _n_=1 then do;
  dcl hash _m(dataset:'means');
  _m.definekey('_var1');
  _m.definedata('_s');
  _m.definedone();
  dcl hash _v(dataset:'covlist(where=(_var1=_var2))');
  _v.definekey('_var1');
  _v.definedata('_s');
  _v.definedone();
end;
_sxy=_s;
_sxx=ifn(_v.find(),.,_s);
_syy=ifn(_v.find(key:_var2),.,_s);
_mx =ifn(_m.find(),.,_s);
_my =ifn(_m.find(key:_var2),.,_s);
_rc=2*_sxy/(_sxx+_syy+(_mx-_my)**2);
run;

/* Optional: Sort the resulting dataset alphabetically */

proc sort data=want;
by _var1 _var2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;By using the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_corr_syntax01.htm#procstat.corr.vardefopt" target="_blank" rel="noopener"&gt;VARDEF option&lt;/A&gt; of the PROC CORR statement (commented out in the code above) you can easily switch between the slightly different implementations of the CCC obtained with VARDEF=DF (the default) and VARDEF=N, which are mentioned in the Wikipedia article&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Concordance_correlation_coefficient" target="_blank" rel="noopener"&gt;Concordance correlation coefficient&lt;/A&gt; (at the end of the section headed "Definition").&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 15:46:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/953402#M42833</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-12-12T15:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Concordance Correlation Coefficient</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/953508#M42860</link>
      <description>&lt;P&gt;Thank you very much. It is very helpful.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Dec 2024 14:22:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Concordance-Correlation-Coefficient/m-p/953508#M42860</guid>
      <dc:creator>vedatoguz</dc:creator>
      <dc:date>2024-12-13T14:22:47Z</dc:date>
    </item>
  </channel>
</rss>

