<?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: RANUNI function+DO loop+Macro variables + kappa coeficient in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760710#M240565</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392851"&gt;@mpc5&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;DATA agree;&lt;BR /&gt;DO units = 1 to 100;&lt;BR /&gt;Random = RANUNI (456);&lt;BR /&gt;OUTPUT;&lt;BR /&gt;END;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Reasonable start.&lt;/P&gt;
&lt;P&gt;So now I expect the teacher wants some If/then/else statements to assign the values for the Rater variables. They would come before the Output statement.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Aug 2021 17:38:14 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-08-10T17:38:14Z</dc:date>
    <item>
      <title>RANUNI function+DO loop+Macro variables + kappa coeficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760696#M240553</link>
      <description>&lt;P&gt;This assignment is overwhelming, any assistance will help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Use the &lt;STRONG&gt;RANUNI function&lt;/STRONG&gt; in conjunction with a &lt;STRONG&gt;DO loop&lt;/STRONG&gt; and an &lt;STRONG&gt;OUTPUT&lt;/STRONG&gt; statement to create a temporary SAS data set called&amp;nbsp;&lt;EM&gt;agree&lt;/EM&gt;&amp;nbsp;containing 100 observations and two character variables called&amp;nbsp;&lt;EM&gt;rater1&lt;/EM&gt;&amp;nbsp;and&amp;nbsp;&lt;EM&gt;rater2&lt;/EM&gt;. (We'll use the data set to calculate the Kappa coefficient between the two raters.) Now, here are the specific requirements for the problem:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use a &lt;STRONG&gt;seed&lt;/STRONG&gt; of 456 in your &lt;STRONG&gt;RANUNI function&lt;/STRONG&gt; so that we all create the same data set.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;For each iteration of the &lt;STRONG&gt;DO loop&lt;/STRONG&gt;:&lt;/LI&gt;&lt;/UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI&gt;(1) if the value returned by the RANUNI function is &lt;U&gt;less than&lt;/U&gt; 0.4, set&amp;nbsp;&lt;EM&gt;rater1&lt;/EM&gt;&amp;nbsp;to equal Yes and&amp;nbsp;&lt;EM&gt;rater2&lt;/EM&gt;&amp;nbsp;to equal Yes&lt;/LI&gt;&lt;LI&gt;(2) if the value returned by the RANUNI function is &lt;U&gt;at least &lt;/U&gt;0.4, but &lt;U&gt;less than&lt;/U&gt; 0.5, set&amp;nbsp;&lt;EM&gt;rater1&lt;/EM&gt;&amp;nbsp;to equal Yes and&amp;nbsp;&lt;EM&gt;rater2&lt;/EM&gt;&amp;nbsp;to equal No&lt;/LI&gt;&lt;LI&gt;(3) if the value returned by the RANUNI function is &lt;U&gt;at least&lt;/U&gt; 0.5, but &lt;U&gt;less than&lt;/U&gt; 0.6, set&amp;nbsp;&lt;EM&gt;rater1&lt;/EM&gt;&amp;nbsp;to equal No and&amp;nbsp;&lt;EM&gt;rater2&lt;/EM&gt;&amp;nbsp;to equal Yes&lt;/LI&gt;&lt;LI&gt;(4) if the value returned by the RANUNI function is &lt;U&gt;at least&lt;/U&gt; 0.6, set&amp;nbsp;&lt;EM&gt;rater1&lt;/EM&gt;&amp;nbsp;to equal No and&amp;nbsp;&lt;EM&gt;rater2&lt;/EM&gt;&amp;nbsp;to equal No.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;UL&gt;&lt;LI&gt;Write the code using &lt;STRONG&gt;three macro variables&lt;/STRONG&gt; called&amp;nbsp;&lt;EM&gt;cutoff1&lt;/EM&gt;,&amp;nbsp;&lt;EM&gt;cutoff2&lt;/EM&gt;, and&amp;nbsp;&lt;EM&gt;cutoff3&lt;/EM&gt;&amp;nbsp;so that the cutoff values of 0.4, 0.5, and 0.6 could be changed easily.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;LI&gt;Compute the &lt;STRONG&gt;Kappa coefficient&lt;/STRONG&gt; between the two raters.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;What is the Kappa coefficient when the cutoff values are set at 0.4, 0.5, and 0.6?&lt;BR /&gt;What level of agreement does it suggest exists between the two raters?&lt;BR /&gt;What is the Kappa coefficient when the cutoff values are set at 0.2, 0.5, and 0.8?&lt;BR /&gt;What level of agreement does it suggest exists between the two raters then? (Hint: I recommend first getting the code to work using the values 0.4, 0.5, and 0.6. Then replace those values with the&amp;nbsp;&lt;EM&gt;cutoff1&lt;/EM&gt;,&amp;nbsp;&lt;EM&gt;cutoff2&lt;/EM&gt;, and&amp;nbsp;&lt;EM&gt;cutoff3&lt;/EM&gt;&amp;nbsp;macro variables.)&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 16:00:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760696#M240553</guid>
      <dc:creator>mpc5</dc:creator>
      <dc:date>2021-08-10T16:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: RANUNI function+DO loop+Macro variables + kappa coeficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760701#M240556</link>
      <description>&lt;P&gt;And the question is?&lt;/P&gt;
&lt;P&gt;What have you tried so far?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know your instructor but using values of "Yes" and "No" is sub-optimal coding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 16:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760701#M240556</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-10T16:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: RANUNI function+DO loop+Macro variables + kappa coeficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760704#M240559</link>
      <description>This should get you started.&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2011/08/24/how-to-generate-random-numbers-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2011/08/24/how-to-generate-random-numbers-in-sas.html&lt;/A&gt;</description>
      <pubDate>Tue, 10 Aug 2021 16:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760704#M240559</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-10T16:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: RANUNI function+DO loop+Macro variables + kappa coeficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760708#M240563</link>
      <description>&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;DATA agree;&lt;BR /&gt;DO units = 1 to 100;&lt;BR /&gt;Random = RANUNI (456);&lt;BR /&gt;OUTPUT;&lt;BR /&gt;END;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 17:31:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760708#M240563</guid>
      <dc:creator>mpc5</dc:creator>
      <dc:date>2021-08-10T17:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: RANUNI function+DO loop+Macro variables + kappa coeficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760710#M240565</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392851"&gt;@mpc5&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;DATA agree;&lt;BR /&gt;DO units = 1 to 100;&lt;BR /&gt;Random = RANUNI (456);&lt;BR /&gt;OUTPUT;&lt;BR /&gt;END;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Reasonable start.&lt;/P&gt;
&lt;P&gt;So now I expect the teacher wants some If/then/else statements to assign the values for the Rater variables. They would come before the Output statement.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 17:38:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760710#M240565</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-10T17:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: RANUNI function+DO loop+Macro variables + kappa coeficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760753#M240591</link>
      <description>&lt;P&gt;can a "THEN" statement equal more than one response?&lt;/P&gt;&lt;P&gt;example this is what i have for the first if then statement;&lt;/P&gt;&lt;P&gt;IF _N_ lt 0.4 then rater1= 'Yes' and rater2= 'Yes';&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 20:49:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760753#M240591</guid>
      <dc:creator>mpc5</dc:creator>
      <dc:date>2021-08-10T20:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: RANUNI function+DO loop+Macro variables + kappa coeficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760754#M240592</link>
      <description>&lt;P&gt;Use a DO/END block to execute multiple statements.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if (condition) then do;
  statement1;
  statement2;
end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Aug 2021 20:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760754#M240592</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-08-10T20:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: RANUNI function+DO loop+Macro variables + kappa coeficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760785#M240609</link>
      <description>&lt;P&gt;This is what I have so far, NEED HELP:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA agree;&lt;BR /&gt;DO units = 1 to 100;&lt;BR /&gt;Random = RANUNI (456);&lt;/P&gt;&lt;P&gt;IF _N_ lt 0.4 then rater1= 'Yes' and rater2= 'Yes';&lt;BR /&gt;ELSE IF _N_ ge 0.4 and lt 0.5 then rater1= 'Yes' and rater2= 'No';&lt;BR /&gt;ELSE IF _N_ ge 0.5 and lt 0.6 then rater1= 'No' and rater2= 'Yes';&lt;BR /&gt;ELSE IF _N_ ge 0.6 then rater1= 'No' and rater2= 'No';&lt;BR /&gt;OUTPUT;&lt;BR /&gt;END;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;%MACRO agreecuts (cutoff=);&lt;BR /&gt;DATA agree;&lt;BR /&gt;set agree;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;%MEND;&lt;/P&gt;&lt;P&gt;%AGREECUTS(cutoff= 0.4)&lt;BR /&gt;%AGREECUTS(cutoff= 0.5)&lt;BR /&gt;%AGREECUTS(cutoff= 0.6)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;HERE IS MY LOG:&lt;/P&gt;&lt;P&gt;75&lt;BR /&gt;76 DATA agree;&lt;BR /&gt;77 DO units = 1 to 100;&lt;BR /&gt;78 Random = RANUNI (456);&lt;BR /&gt;79&lt;BR /&gt;80 IF _N_ lt 0.4 then rater1= 'Yes' and rater2= 'Yes';&lt;BR /&gt;81 ELSE IF _N_ ge 0.4 and lt 0.5 then rater1= 'Yes' and rater2= 'No';&lt;BR /&gt;---&lt;BR /&gt;388&lt;BR /&gt;200&lt;BR /&gt;82 ELSE IF _N_ ge 0.5 and lt 0.6 then rater1= 'No' and rater2= 'Yes';&lt;BR /&gt;---- ---&lt;BR /&gt;160 388&lt;BR /&gt;200&lt;BR /&gt;83 ELSE IF _N_ ge 0.6 then rater1= 'No' and rater2= 'No';&lt;BR /&gt;----&lt;BR /&gt;160&lt;BR /&gt;ERROR 388-185: Expecting an arithmetic operator.&lt;/P&gt;&lt;P&gt;ERROR 200-322: The symbol is not recognized and will be ignored.&lt;/P&gt;&lt;P&gt;ERROR 160-185: No matching IF-THEN clause.&lt;/P&gt;&lt;P&gt;84 OUTPUT;&lt;BR /&gt;85 END;&lt;BR /&gt;86 RUN;&lt;/P&gt;&lt;P&gt;NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).&lt;BR /&gt;80:48 81:48 82:48 83:48&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;WARNING: The data set WORK.AGREE may be incomplete. When this step was stopped there were 0&lt;BR /&gt;observations and 5 variables.&lt;BR /&gt;WARNING: Data set WORK.AGREE was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.04 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;87&lt;BR /&gt;88 %MACRO agreecuts (cutoff=);&lt;BR /&gt;89 DATA agree;&lt;BR /&gt;90 set agree;&lt;BR /&gt;91 RUN;&lt;BR /&gt;92&lt;BR /&gt;93 %MEND;&lt;BR /&gt;94&lt;BR /&gt;95 %AGREECUTS(cutoff= 0.4)&lt;/P&gt;&lt;P&gt;NOTE: There were 0 observations read from the data set WORK.AGREE.&lt;BR /&gt;NOTE: The data set WORK.AGREE has 0 observations and 5 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;96 %AGREECUTS(cutoff= 0.5)&lt;/P&gt;&lt;P&gt;NOTE: There were 0 observations read from the data set WORK.AGREE.&lt;BR /&gt;NOTE: The data set WORK.AGREE has 0 observations and 5 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;97 %AGREECUTS(cutoff= 0.6)&lt;/P&gt;&lt;P&gt;NOTE: There were 0 observations read from the data set WORK.AGREE.&lt;BR /&gt;NOTE: The data set WORK.AGREE has 0 observations and 5 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 23:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760785#M240609</guid>
      <dc:creator>mpc5</dc:creator>
      <dc:date>2021-08-10T23:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: RANUNI function+DO loop+Macro variables + kappa coeficient</title>
      <link>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760786#M240610</link>
      <description>&lt;P&gt;If you add a comment to your code for every line I'll help you with the answer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Put a comment with what you think each line is doing.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Aug 2021 23:43:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/RANUNI-function-DO-loop-Macro-variables-kappa-coeficient/m-p/760786#M240610</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-10T23:43:29Z</dc:date>
    </item>
  </channel>
</rss>

