<?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: Variable for baseline, follow up, 2nd follow up, etc. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-for-baseline-follow-up-2nd-follow-up-etc/m-p/785296#M250599</link>
    <description>Ahh, perfect! I was overcomplicating things, all I needed was a count variable. Thank you so much, Reeza!</description>
    <pubDate>Thu, 09 Dec 2021 23:35:32 GMT</pubDate>
    <dc:creator>keherder</dc:creator>
    <dc:date>2021-12-09T23:35:32Z</dc:date>
    <item>
      <title>Variable for baseline, follow up, 2nd follow up, etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-for-baseline-follow-up-2nd-follow-up-etc/m-p/785294#M250597</link>
      <description>&lt;P&gt;Hello everyone!&lt;/P&gt;&lt;P&gt;So, this is nothing I've tried to do before, so I'm not sure where to start.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am looking at simulated clinical trial data. Each participant was examined 3-5 times on different dates. The dates are different for each participant.&amp;nbsp; and I would like to create a numeric variable in a data step that corresponds to dates chronologically as baseline (1), 1st follow up (2), 2nd follow up (3), etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Data set. As you can see, all participants were examined multiple times on different dates" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66598i750700CFDE314F4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-12-09 at 4.18.16 PM.png" alt="Data set. As you can see, all participants were examined multiple times on different dates" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Data set. As you can see, all participants were examined multiple times on different dates&lt;/span&gt;&lt;/span&gt;&amp;nbsp;Above is a photo of the data. I would like to create this variable so that I can transpose the data so each participant has only one observation with a baseline BMI and all other values at baseline, 1st follow up, 2nd follow up, etc.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 23:22:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-for-baseline-follow-up-2nd-follow-up-etc/m-p/785294#M250597</guid>
      <dc:creator>keherder</dc:creator>
      <dc:date>2021-12-09T23:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: Variable for baseline, follow up, 2nd follow up, etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-for-baseline-follow-up-2nd-follow-up-etc/m-p/785295#M250598</link>
      <description>&lt;P&gt;Can you provide sample data as text please, not an image?&lt;/P&gt;
&lt;P&gt;Preferably as a data step following the guidelines here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How are missing visits identified? Are they missing as in row 6, or excluded as in Case 1488 that has only 5 records? If it's excluded how do you know which visit was excluded? Is it by the duration between visits, or last visit, or some other logic?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Given this as your input, please show what you would like as the output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, why do you think you need to do this overall. There's a reason data sets are stored this way &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And SAS can usually do the analysis with the data in this form.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are some references that may be useful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to create a counter variable&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.idre.ucla.edu/sas/faq/how-can-i-create-an-enumeration-variable-by-groups/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/faq/how-can-i-create-an-enumeration-variable-by-groups/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Transposing data tutorials:&lt;/STRONG&gt;&lt;BR /&gt;Long to Wide:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/reshaping-data-long-to-wide-using-the-data-step/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/394810"&gt;@keherder&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello everyone!&lt;/P&gt;
&lt;P&gt;So, this is nothing I've tried to do before, so I'm not sure where to start.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am looking at simulated clinical trial data. Each participant was examined 3-5 times on different dates. The dates are different for each participant.&amp;nbsp; and I would like to create a numeric variable in a data step that corresponds to dates chronologically as baseline (1), 1st follow up (2), 2nd follow up (3), etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Data set. As you can see, all participants were examined multiple times on different dates" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66598i750700CFDE314F4F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2021-12-09 at 4.18.16 PM.png" alt="Data set. As you can see, all participants were examined multiple times on different dates" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Data set. As you can see, all participants were examined multiple times on different dates&lt;/span&gt;&lt;/span&gt;&amp;nbsp;Above is a photo of the data. I would like to create this variable so that I can transpose the data so each participant has only one observation with a baseline BMI and all other values at baseline, 1st follow up, 2nd follow up, etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 23:29:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-for-baseline-follow-up-2nd-follow-up-etc/m-p/785295#M250598</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-12-09T23:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Variable for baseline, follow up, 2nd follow up, etc.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-for-baseline-follow-up-2nd-follow-up-etc/m-p/785296#M250599</link>
      <description>Ahh, perfect! I was overcomplicating things, all I needed was a count variable. Thank you so much, Reeza!</description>
      <pubDate>Thu, 09 Dec 2021 23:35:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-for-baseline-follow-up-2nd-follow-up-etc/m-p/785296#M250599</guid>
      <dc:creator>keherder</dc:creator>
      <dc:date>2021-12-09T23:35:32Z</dc:date>
    </item>
  </channel>
</rss>

