<?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 How to calculate follow_up years in longitudinal dataset in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-follow-up-years-in-longitudinal-dataset/m-p/858423#M42421</link>
    <description>&lt;P&gt;I tried to get the follow_up year of my dataset. This survey was conducted every two years. Is there any code that works for this? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                                     Obs    ID    lle9    lle10   lle11   lle12   lle13   lle14      expect_results

                                     1      1      .       0       0       0       1       .                   6
                                     2      2      0       0       0       .       .       0                   10
                                     3      3      0       .       .       0       .       .                   6
                                     4      4      .       0       1       1       1       1                   8
                                     5      5      .       .       0       .       1       4                   6
                                     6      6      0       .       1       .       .       2                   10&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 12 Feb 2023 03:34:29 GMT</pubDate>
    <dc:creator>nwang5</dc:creator>
    <dc:date>2023-02-12T03:34:29Z</dc:date>
    <item>
      <title>How to calculate follow_up years in longitudinal dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-follow-up-years-in-longitudinal-dataset/m-p/858423#M42421</link>
      <description>&lt;P&gt;I tried to get the follow_up year of my dataset. This survey was conducted every two years. Is there any code that works for this? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;                                     Obs    ID    lle9    lle10   lle11   lle12   lle13   lle14      expect_results

                                     1      1      .       0       0       0       1       .                   6
                                     2      2      0       0       0       .       .       0                   10
                                     3      3      0       .       .       0       .       .                   6
                                     4      4      .       0       1       1       1       1                   8
                                     5      5      .       .       0       .       1       4                   6
                                     6      6      0       .       1       .       .       2                   10&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2023 03:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-follow-up-years-in-longitudinal-dataset/m-p/858423#M42421</guid>
      <dc:creator>nwang5</dc:creator>
      <dc:date>2023-02-12T03:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate follow_up years in longitudinal dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-follow-up-years-in-longitudinal-dataset/m-p/858427#M42422</link>
      <description>&lt;P&gt;You have to walk us through the logic of how you get 6 or 10 or 8 or whatever. Probably in lots of details.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Especially since I see nothing there that is obviously a "year" to calculate what a "follow_up" year may be.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2023 07:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-follow-up-years-in-longitudinal-dataset/m-p/858427#M42422</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-02-12T07:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate follow_up years in longitudinal dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-follow-up-years-in-longitudinal-dataset/m-p/858435#M42423</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/439162"&gt;@nwang5&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set have;
if n(of lle:) then
   n_FU_years=2*(7-whichn(coalesce(of lle14-lle9), of lle14-lle9)
                  -whichn(coalesce(of lle9-lle14), of lle9-lle14));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it doesn't work for your real data, then I agree with &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884" target="_blank" rel="noopener"&gt;ballardw&lt;/A&gt; that we might need to go through lots of details.&lt;/P&gt;</description>
      <pubDate>Sun, 12 Feb 2023 09:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-follow-up-years-in-longitudinal-dataset/m-p/858435#M42423</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-02-12T09:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate follow_up years in longitudinal dataset</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-follow-up-years-in-longitudinal-dataset/m-p/858448#M42424</link>
      <description>It works! Thank you so much!</description>
      <pubDate>Sun, 12 Feb 2023 17:21:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-calculate-follow-up-years-in-longitudinal-dataset/m-p/858448#M42424</guid>
      <dc:creator>nwang5</dc:creator>
      <dc:date>2023-02-12T17:21:10Z</dc:date>
    </item>
  </channel>
</rss>

