<?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: Turning one-line-per-event into one-line-per-patient, but keeping dates of EACH time different t in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Turning-one-line-per-event-into-one-line-per-patient-but-keeping/m-p/861265#M340214</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thanks so much for your reply! Regarding providing sample data in a working data step, I will keep that mind in the future, and may try to update here later (I'm on my phone now). Thanks for letting me know that's best practice.&lt;/P&gt;
&lt;P&gt;The reason I want a data structure with one line per person (vs. per claim) is that this data will then be linked to birth records and social services data using the patient's ID. After linking, the patient's pregnancy dates will be determined from the birth record, and each patient will be flagged for whether they experienced any of several types of mental illness diagnosis during their pregnancy. From there, I will be doing linear regression and descriptive analyses on the data with outcomes originating from the social services data. Please let me know if you have additional questions regarding the intended use of the data!&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2023 02:34:05 GMT</pubDate>
    <dc:creator>dustychair</dc:creator>
    <dc:date>2023-02-28T02:34:05Z</dc:date>
    <item>
      <title>Turning one-line-per-event into one-line-per-patient, but keeping dates of EACH time different types</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Turning-one-line-per-event-into-one-line-per-patient-but-keeping/m-p/860997#M340108</link>
      <description>&lt;P&gt;Hi all;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I have a dataset consisting of individual Medicaid claims with patients’ ID numbers, where each claim is flagged for whether or not it contains certain mental illness diagnoses. I’m trying to turn that into a dataset with one line per patient showing the date(s) of each diagnosis of interest. I’m going to use a toy model because this is a pretty conceptual question, and I am actually using protected health information on a secure server. The real data is similar to this, but there are 25 flagged mental illness diagnoses and 96 million claims for 250,000 people. Here’s what I have to start with (one line per claim):&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ID  diagnosis   claim_date  mood_disorder anxiety_disorder 
1   F60.72      23JAN2019   1           0 
1   F60.3       16DEC2018   1           0 
1   F65.51      04MAY2019   0           1 
1   B20.2       28FEB2008   0           0 
2   F65.3       05JUL2018   0           1 
2   B20.5       28OCT2017   0           0 
3   B20.6       20OCT2016   0           0 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Here’s what I want (one line per person):&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ID  mood_1          mood_2          anxiety_1 
1   23JAN2019       16DEC2018       0 
2   0               0               05JUL2018 
3   0               0               0 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I really appreciate for any help!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 05:39:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Turning-one-line-per-event-into-one-line-per-patient-but-keeping/m-p/860997#M340108</guid>
      <dc:creator>dustychair</dc:creator>
      <dc:date>2023-02-27T05:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: Turning one-line-per-event into one-line-per-patient, but keeping dates of EACH time different t</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Turning-one-line-per-event-into-one-line-per-patient-but-keeping/m-p/861011#M340117</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22174"&gt;@dustychair&lt;/a&gt;&amp;nbsp;Representative sample data is all we need. It's also great that you provided the information of the real data volume and number of variables you're dealing with.&lt;/P&gt;
&lt;P&gt;Ideally provide sample data via a working SAS data step. This not only saves the one helping you some time, it also allows you to provide sample data with data types and formats that match your real data which in turn then leads to proposed code that likely will be suitable for your real data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your "Have" data structure is leaner than your "Want" data structure. Given the data volume transposing the data to your "Want" data structure will blow-up the volume significantly. Do you really need it? Are you sure you can't work with the current data structure?&lt;/P&gt;
&lt;P&gt;Most SAS procedures will work nicely with your "Have" structure. May-be you explain to us why you believe the "Want" structure is required so we can assess and eventually propose another way that allows you to use the "Have" structure.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 07:17:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Turning-one-line-per-event-into-one-line-per-patient-but-keeping/m-p/861011#M340117</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-02-27T07:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: Turning one-line-per-event into one-line-per-patient, but keeping dates of EACH time different t</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Turning-one-line-per-event-into-one-line-per-patient-but-keeping/m-p/861265#M340214</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thanks so much for your reply! Regarding providing sample data in a working data step, I will keep that mind in the future, and may try to update here later (I'm on my phone now). Thanks for letting me know that's best practice.&lt;/P&gt;
&lt;P&gt;The reason I want a data structure with one line per person (vs. per claim) is that this data will then be linked to birth records and social services data using the patient's ID. After linking, the patient's pregnancy dates will be determined from the birth record, and each patient will be flagged for whether they experienced any of several types of mental illness diagnosis during their pregnancy. From there, I will be doing linear regression and descriptive analyses on the data with outcomes originating from the social services data. Please let me know if you have additional questions regarding the intended use of the data!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 02:34:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Turning-one-line-per-event-into-one-line-per-patient-but-keeping/m-p/861265#M340214</guid>
      <dc:creator>dustychair</dc:creator>
      <dc:date>2023-02-28T02:34:05Z</dc:date>
    </item>
  </channel>
</rss>

