<?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 Examining a variable across multiple visits in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Examining-a-variable-across-multiple-visits/m-p/349248#M80983</link>
    <description>&lt;P&gt;Hi SAS community,&lt;/P&gt;&lt;P&gt;I am trying to write a SAS program based off of the original code from this article&amp;nbsp;&lt;A title="Data Cleaning: Longitudinal Study Cross-visit Checks" href="http://www.sascommunity.org/wiki/Data_Cleaning:_Longitudinal_Study_Cross-Visit_Checks" target="_self"&gt;http://www.sascommunity.org/wiki/Data_Cleaning:_Longitudinal_Study_Cross-Visit_Checks&lt;/A&gt; for patients taking a treatment regimen that may change from visit to visit. The database I'm working on is for an ongoing study, so there is a wide amount of variation in the amount of visits that patients may have completed. The variable for treatment regimen assigns a number to each different type of regimen. Because these numbers are representative of a category designation rather than a value, the code also needs modification in that respect. I tried to alter the code to accommodate these features, but haven't been achieve a good result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the orignal array code from the article:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA vision_onevar (DROP = n k ncomb i);
SET vision_trans;
ARRAY visit {*} v:;
n = dim(visit);
k = 2;
ncomb = comb(n,k);
DO i=1 TO ncomb;
CALL allcomb(i, k, of visit[*]);
IF visit{1} &amp;lt; visit{2} AND visit[1]^=. THEN flag=1;
4
END;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Here is snapshot of some of what the data looks like transposed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8285i2E5031C0369BCEA3/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="PROC PRINT.PNG" title="PROC PRINT.PNG" /&gt;&lt;/P&gt;&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;This is my attempted code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA regimens_check (DROP = n k ncomb i);
SET regimens_trans;
ARRAY visit {*} v:;
n = dim(visit);
k = 2;
ncomb = comb(n,k);
DO i=1 TO ncomb;
CALL allcomb(i, k, of visit[*]);
IF visit{1} ne visit{2} AND visit[2] ne . THEN flag=1;
ELSE flag=0;
END;
IF flag=1 THEN OUTPUT;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I'm not sure what is the best way to evaluate this variable since the number of visits per patient is not standard and the variable is not a value-based number, but rather a categorical number. Any suggestions welcome!&lt;/P&gt;</description>
    <pubDate>Tue, 11 Apr 2017 20:03:30 GMT</pubDate>
    <dc:creator>cbt2119</dc:creator>
    <dc:date>2017-04-11T20:03:30Z</dc:date>
    <item>
      <title>Examining a variable across multiple visits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Examining-a-variable-across-multiple-visits/m-p/349248#M80983</link>
      <description>&lt;P&gt;Hi SAS community,&lt;/P&gt;&lt;P&gt;I am trying to write a SAS program based off of the original code from this article&amp;nbsp;&lt;A title="Data Cleaning: Longitudinal Study Cross-visit Checks" href="http://www.sascommunity.org/wiki/Data_Cleaning:_Longitudinal_Study_Cross-Visit_Checks" target="_self"&gt;http://www.sascommunity.org/wiki/Data_Cleaning:_Longitudinal_Study_Cross-Visit_Checks&lt;/A&gt; for patients taking a treatment regimen that may change from visit to visit. The database I'm working on is for an ongoing study, so there is a wide amount of variation in the amount of visits that patients may have completed. The variable for treatment regimen assigns a number to each different type of regimen. Because these numbers are representative of a category designation rather than a value, the code also needs modification in that respect. I tried to alter the code to accommodate these features, but haven't been achieve a good result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the orignal array code from the article:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA vision_onevar (DROP = n k ncomb i);
SET vision_trans;
ARRAY visit {*} v:;
n = dim(visit);
k = 2;
ncomb = comb(n,k);
DO i=1 TO ncomb;
CALL allcomb(i, k, of visit[*]);
IF visit{1} &amp;lt; visit{2} AND visit[1]^=. THEN flag=1;
4
END;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Here is snapshot of some of what the data looks like transposed:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8285i2E5031C0369BCEA3/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="PROC PRINT.PNG" title="PROC PRINT.PNG" /&gt;&lt;/P&gt;&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;This is my attempted code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA regimens_check (DROP = n k ncomb i);
SET regimens_trans;
ARRAY visit {*} v:;
n = dim(visit);
k = 2;
ncomb = comb(n,k);
DO i=1 TO ncomb;
CALL allcomb(i, k, of visit[*]);
IF visit{1} ne visit{2} AND visit[2] ne . THEN flag=1;
ELSE flag=0;
END;
IF flag=1 THEN OUTPUT;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I'm not sure what is the best way to evaluate this variable since the number of visits per patient is not standard and the variable is not a value-based number, but rather a categorical number. Any suggestions welcome!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 20:03:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Examining-a-variable-across-multiple-visits/m-p/349248#M80983</guid>
      <dc:creator>cbt2119</dc:creator>
      <dc:date>2017-04-11T20:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Examining a variable across multiple visits</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Examining-a-variable-across-multiple-visits/m-p/349251#M80985</link>
      <description>&lt;P&gt;I think it may help to describe the questions to be answered by any examination.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And some of them may be more amenable using non-transposed data.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 20:09:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Examining-a-variable-across-multiple-visits/m-p/349251#M80985</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-04-11T20:09:49Z</dc:date>
    </item>
  </channel>
</rss>

