<?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: Calculate error with variable known and unknown scenarios using repeated measurement data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513982#M138561</link>
    <description>SQL produced multiples when I add SER_DATE_DX for select variables. The same thing happened when I wanted to keep CODE in the data which created duplicates</description>
    <pubDate>Fri, 16 Nov 2018 16:56:18 GMT</pubDate>
    <dc:creator>Cruise</dc:creator>
    <dc:date>2018-11-16T16:56:18Z</dc:date>
    <item>
      <title>Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513384#M138325</link>
      <description>&lt;P&gt;I'd like to calculate the error produced due to known and unknown status of a variable called DOD_DIFF when certain conditions looked after. Please see the image and the text underneath for better understanding.&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="SCENARIO NOV12.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/24942i70A2DCA89F18F95D/image-size/large?v=v2&amp;amp;px=999" role="button" title="SCENARIO NOV12.png" alt="SCENARIO NOV12.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What I wanted to achieve SAS code wise is following:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A. In the absence of DOD_DIFF:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Choose the earliest date of visit&lt;/LI&gt;
&lt;LI&gt;If there are multiple records for that data, choose the&amp;nbsp;lowest WGT_DX, call is WGT_DX_PARTIAL&lt;/LI&gt;
&lt;LI&gt;Pick one row per patient when these conditions meet&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;B. In&amp;nbsp;the presence of DOD_DIFF:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Choose the minimum DOD_DIFF&lt;/LI&gt;
&lt;LI&gt;If there are multiple records for that value of DOD_DIFF, choose the&amp;nbsp;lowestWGT_DX, call it WGT_DX_FULL&lt;/LI&gt;
&lt;LI&gt;Pick one row per patient when these conditions meet&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;C. Calculate measurement error&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;DIFF_WGT_DX=&amp;nbsp;WGT_DX_FULL - WGT_DX_PARTIAL&lt;/LI&gt;
&lt;LI&gt;DIFF_DATE=ABS(DIF('date of visit' selected in the absence of DOD_DIFF, 'date of visit' selected in the presence of DOD_DIFF)&lt;/LI&gt;
&lt;LI&gt;ERROR= DIFF_WGT_DX* DOD_DIFF&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;At the end, each patient has one ERROR value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for your help in advance. The demo data is attached to this post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This problem was previously discussed and conceptually solved in the post below thanks to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31461"&gt;@mkeintz&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;. And I hops this post will lead to a solution for a SAS programming.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Calculate-weighted-average-across-rows-with-conditions/m-p/513072#M138213" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Calculate-weighted-average-across-rows-with-conditions/m-p/513072#M138213&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 15:59:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513384#M138325</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-15T15:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513420#M138336</link>
      <description>&lt;P&gt;Since your data picture shows values for DOD_DIF I think it might help to describe what constitutes "DOD_DIF is unknown" or "absence of DOD_DIF"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It may also help to apply an actual SAS date format to the SER_DATE_DX value&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 16:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513420#M138336</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-15T16:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513428#M138338</link>
      <description>&lt;P&gt;&lt;SPAN&gt;DOD_DIFF is the number of days between date of diagnosis and the date of visit for all visits of each patients. However, date of diagnosis is not always known. The data I'm using in this exercise has no missing in date of diagnosis and date of visit.&amp;nbsp;Because the observations with missing in date of diagnosis was deleted to create this dataset with complete&amp;nbsp;DOD_DIFF. Currently, in practice, when DOD_DIFF is not known, aka, absent, we go for the row associated with the earliest date of visit (min(SER_DATE_DX)) and the lowest error diagnosis code (min(WGT_DX)). However, I'd like to estimate how much error are we inducing by using this logic. The idea here is to estimate the error due to two different scenarios where&amp;nbsp;DOD_DIFF known/present and DOD_DIFF not known/absent. In other words,&amp;nbsp;DOD_DIFF not known/absent is a hypothetical scenario in this exercise since we have true&amp;nbsp;DOD_DIFF&amp;nbsp;in the data attached to this post.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOD_DIFF=SER_DATE_DX-DATE_OF_DIAGNOSIS&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 16:47:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513428#M138338</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-15T16:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513477#M138353</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;DOD_DIFF is the number of days between date of diagnosis and the date of visit for all visits of each patients. However, date of diagnosis is not always known. The data I'm using in this exercise has no missing in date of diagnosis and date of visit.&amp;nbsp;Because the observations with missing in date of diagnosis was deleted to create this dataset with complete&amp;nbsp;DOD_DIFF. Currently, in practice, when DOD_DIFF is not known, aka, absent, we go for the row associated with the earliest date of visit (min(SER_DATE_DX)) and the lowest error diagnosis code (min(WGT_DX)). However, I'd like to estimate how much error are we inducing by using this logic. The idea here is to estimate the error due to two different scenarios where&amp;nbsp;DOD_DIFF known/present and DOD_DIFF not known/absent. In other words,&amp;nbsp;DOD_DIFF not known/absent is a hypothetical scenario in this exercise since we have true&amp;nbsp;DOD_DIFF&amp;nbsp;in the data attached to this post.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOD_DIFF=SER_DATE_DX-DATE_OF_DIAGNOSIS&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;So "not known" = the variable has a missing value???&lt;/P&gt;
&lt;P&gt;Your picture and comment seemed to indicate that the top circled row was on of the records that had "absent" data but showed an actual value for DOD_DIFF. So I asked for clarification as to what would indicate "absent".&lt;/P&gt;
&lt;P&gt;"Absent" is not a SAS concept in general, that is a user concept. I have data that has specific codes that indicate specific forms of "not recorded" "out of range" "biologically implausible values" and other indications that the value should not be used depending on the specific data source. I create SAS variables with missing values when appropriate to avoid calculations with the coded values. So you still have not quite defined "absent" in terms of what appears in the data. The SAS term might be "missing value" as SAS has missing as a value. It does not have "not known". When I talk to an SQL programmer I do not use "missing" because generally that is not the correct terminology; NULL however would be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One reason to be specific is that SAS has functions to test for missing values such a MISSING. So the code might include&lt;/P&gt;
&lt;PRE&gt;if missing (DOD_DIFF) then do ...&lt;/PRE&gt;
&lt;P&gt;which would be different from&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if DOD_DIFF = &amp;lt;somecode&amp;gt; then do ..&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is also extremely hard to code with pictures of data.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 17:36:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513477#M138353</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-11-15T17:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513485#M138355</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;I understand. Sorry for a confusion. Thanks for explaining how missing/unknown/null can be deferentially understood in different programming settings.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this exercise, we are using data with complete&amp;nbsp;&lt;SPAN&gt;DOD_DIFF. However, for the purpose to estimate the measurement error in a hypothetical situation when DOD_DIFF is not available (A), we assume that we don't have any information for DOD_DIFF. Therefore, 'date of visit' (ser_date_dx) will be used instead&amp;nbsp;DOD_DIFF. The rows will be picked in Scenario A and B (DOD_DIFF is available&amp;nbsp;) as following:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;What I wanted to achieve is following:&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A. Without using DOD_DIFF:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Choose the earliest date of visit&lt;/LI&gt;
&lt;LI&gt;If there are multiple records for that data, choose the&amp;nbsp;lowest WGT_DX, call is WGT_DX_PARTIAL&lt;/LI&gt;
&lt;LI&gt;Pick one row per patient when these conditions meet&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;B. Using DOD_DIFF:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Choose the minimum DOD_DIFF&lt;/LI&gt;
&lt;LI&gt;If there are multiple records for that value of DOD_DIFF, choose the&amp;nbsp;lowestWGT_DX, call it WGT_DX_FULL&lt;/LI&gt;
&lt;LI&gt;Pick one row per patient when these conditions meet&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;C. Calculate measurement error&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;DIFF_WGT_DX=&amp;nbsp;WGT_DX_FULL - WGT_DX_PARTIAL&lt;/LI&gt;
&lt;LI&gt;DIFF_DATE=ABS(DIF('date of visit' selected in the absence of DOD_DIFF, 'date of visit' selected in the presence of DOD_DIFF)&lt;/LI&gt;
&lt;LI&gt;ERROR= DIFF_WGT_DX* DOD_DIFF&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;At the end, each patient has one ERROR value.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Does it make clearer? Would you suggest me to delete the image attached if that will cause a lot of confusion in this forum.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks for asking!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 17:49:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513485#M138355</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-15T17:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513539#M138370</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt;&amp;nbsp;Ok I have just begin on piecemeal approach starting with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;B. Using DOD_DIFF:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Choose the minimum DOD_DIFF&lt;BR /&gt;If there are multiple records for that value of DOD_DIFF, choose the lowestWGT_DX, call it WGT_DX_FULL&lt;BR /&gt;Pick one row per patient when these conditions meet&lt;/P&gt;
Test with&amp;nbsp; ID=1 --Initial data examination&lt;/LI&gt;
&lt;LI&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sql;
create table want as
select  *, min(DOD_DIFF) as min_DOD_DIFF
from have1(where=(id=1))
group by id
having DOD_DIFF=min_DOD_DIFF
order by id ,DOD_DIFF, wgt_dx;
quit;
proc print noobs;run;&lt;/CODE&gt;&lt;/PRE&gt;
SAS Output--&amp;gt; Can you explain what if the WGT_DX=3 was the min here. Is it just select distinct as they are identical?
&lt;DIV class="branch"&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.WANT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;&lt;COLGROUP&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt; &lt;COL /&gt;&lt;/COLGROUP&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;SER_DATE_DX&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;DOD_DIFF&lt;/TH&gt;
&lt;TH class="l header" scope="col"&gt;CODE&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;ID&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;WGT_DX&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;min_DOD_DIFF&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;24JUL2006&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="l data"&gt;153&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;24JUL2006&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="l data"&gt;&lt;FONT color="#FF0000"&gt;197&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;3&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;24JUL2006&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="l data"&gt;&lt;FONT color="#FF0000"&gt;197&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;3&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD class="r data"&gt;&lt;FONT color="#FF0000"&gt;1&lt;/FONT&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;There apparently is a tie in&amp;nbsp;&lt;SPAN&gt;WGT_DX within the group of&amp;nbsp;min_DOD_DIFF. In this case we are anyway gonna pick WGT_DX of 1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 15 Nov 2018 19:38:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513539#M138370</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-15T19:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513550#M138371</link>
      <description>&lt;P&gt;1.&amp;nbsp;&lt;SPAN&gt;Can you explain what if the WGT_DX=3 was the min here. Is it just select distinct as they are identical?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; Yes,&lt;SPAN&gt;&amp;nbsp;select distinct as they are identical. Because this is an insurance claim data these static information such as CODE/WGT_DX is&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;repeated every time they enter in other health care related information.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IF CODE IN ('153') THEN WGT_DX=1; ELSE    
IF CODE IN ('154') THEN WGT_DX=1; ELSE   
IF CODE IN ('159') THEN WGT_DX=2; ELSE  
IF CODE IN ('197') THEN WGT_DX=3; ELSE  
IF CODE IN ('199') THEN WGT_DX=3; ELSE  
IF CODE IN ('209') THEN WGT_DX=5; ELSE  
IF CODE IN ('211') THEN WGT_DX=6; ELSE  
IF CODE IN ('230') THEN WGT_DX=2; ELSE  
IF CODE IN ('235') THEN WGT_DX=3; ELSE  
IF CODE IN ('239') THEN WGT_DX=3; ELSE  
IF CODE IN ('V10') THEN WGT_DX=4; ELSE  
IF CODE IN ('V76') THEN WGT_DX=4;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2.&amp;nbsp;&lt;SPAN&gt;There apparently is a tie in&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;WGT_DX within the group of&amp;nbsp;min_DOD_DIFF. In this case we are anyway gonna pick WGT_DX of 1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;WGT_DX is a monotonic variable based on the CODE. DOD_DIFF=date of visit-date of diagnosis. Therefore, the diagnosis can be&amp;nbsp; tied to the&amp;nbsp;date of diagnosis which is reflected in the&amp;nbsp;DOD_DIFF. However, should not be one-to-one tie.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 19:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513550#M138371</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-15T19:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513551#M138372</link>
      <description>Thank you so much for getting back to this forum.</description>
      <pubDate>Thu, 15 Nov 2018 19:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513551#M138372</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-15T19:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513609#M138393</link>
      <description>&lt;P&gt;B. Using DOD_DIFF is pretty straight forward&lt;/P&gt;
&lt;P&gt;Testing&amp;nbsp;(where=(id=1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table B as
select distinct *,min(WGT_DX) as WGT_DX_FULL
from
(select  *, min(DOD_DIFF) as min_DOD_DIFF
from have1(where=(id=1))
group by id
having DOD_DIFF=min_DOD_DIFF)
group by id, min_DOD_DIFF
having min(wgt_dx)=wgt_dx;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For A&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"In this exercise, we are using data with complete&amp;nbsp;DOD_DIFF. However, for the purpose to estimate the measurement error in a hypothetical situation when DOD_DIFF is not available (A), we assume that we don't have any information for DOD_DIFF."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DOD_DIFF would be .&amp;nbsp; (missing) for all records for a patient ID?&lt;/P&gt;
&lt;P&gt;Which means min(&lt;SPAN&gt;DOD_DIFF&amp;nbsp;)=.&amp;nbsp; and so&amp;nbsp;&amp;nbsp;WGT_DX_FULL should be assinged 0 or . (missing) ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So with N function(to check for number of non missing values,i.e if all missing returns 0, If I infuse a logic check like&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;select distinct *,&lt;STRONG&gt;min(WGT_DX)*n(DOD_DIFF)&amp;gt;0&lt;/STRONG&gt; as WGT_DX_FULL&amp;nbsp; /*notice the &lt;STRONG&gt;highlighted&amp;nbsp;n(DOD_DIFF)&amp;gt;0 results in 1 when there is atleast 1 non missing value and 0 if all are missings&lt;/STRONG&gt;*/&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So when 0,&amp;nbsp;&lt;STRONG&gt;min(WGT_DX) *0&amp;nbsp; as&amp;nbsp;&lt;/STRONG&gt;WGT_DX_FULL&amp;nbsp; would result in zero&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And when 1,&lt;STRONG&gt;min(WGT_DX)&amp;nbsp;*1 =min(WGT_DX)&amp;nbsp; &amp;nbsp;as&amp;nbsp;WGT_DX_FULL&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;And then to get to this&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;DIFF_WGT_DX=&amp;nbsp;WGT_DX_FULL - WGT_DX_PARTIAL&lt;/STRONG&gt;&amp;nbsp; When&amp;nbsp;&lt;SPAN&gt;WGT_DX_FULL&amp;nbsp; has a non zero value,&amp;nbsp;WGT_DX_PARTIAL&amp;nbsp; will have to be missing or zero and vice versa&lt;/SPAN&gt;&lt;SPAN&gt;This is where it stands as of now&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 21:02:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513609#M138393</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-15T21:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513614#M138395</link>
      <description>&lt;P&gt;Hi, in a hypothetical situation assuming DOD_DIFF is not available, we don't use DOD_DIFF at all. Because we're assuming DOD_DIFF doesn't exist. Instead DOD_DIFF, for scenario B, we use date of visit (ser_date-dx).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A. Without using DOD_DIFF (where we assume DOD_DIFF is not available. But we have 'date of visit' (ser_date_dx) instead.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Choose the earliest date of visit (ser_date_dx)&lt;/LI&gt;
&lt;LI&gt;If there are multiple records for that data, choose the&amp;nbsp;lowest WGT_DX, call is WGT_DX_PARTIAL&lt;/LI&gt;
&lt;LI&gt;Pick one row per patient when these conditions meet&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 15 Nov 2018 21:09:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513614#M138395</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-15T21:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513617#M138397</link>
      <description>&lt;P&gt;Ah,&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;DOD_DIFF doesn't exist makes it holy lot easier.&amp;nbsp; I was assuming absence is missing. See over analyzing&amp;nbsp;it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ok at dunkin for a quick coffee, I have my code ready in my mind though. brb at the soonest convenience&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 21:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513617#M138397</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-15T21:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513619#M138399</link>
      <description>&lt;P&gt;Oh so sorry that I wasn't consistent in wordings. Ballardw warned me on that. Enjoy your coffee. I wish I&amp;nbsp;bought you one &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 21:11:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513619#M138399</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-15T21:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513633#M138404</link>
      <description>&lt;P&gt;Hmm sorry again, there is still some ambiguity imo,&lt;/P&gt;
&lt;P&gt;Assuming DOD_DIFF is not available ,&lt;SPAN&gt;WGT_DX_FULL will not be applicable in the subtraction&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;C. Calculate measurement error&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;DIFF_WGT_DX=&amp;nbsp;WGT_DX_FULL(&lt;STRONG&gt;is true when&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;DOD_DIFF exist,else missing&lt;/STRONG&gt;)&amp;nbsp;&lt;/SPAN&gt; &amp;nbsp;- WGT_DX_PARTIAL(&lt;STRONG&gt;is true always because of&amp;nbsp;&lt;SPAN&gt;SER_DATE_DX always available&lt;/SPAN&gt;&lt;/STRONG&gt;)&amp;nbsp; &amp;nbsp;/*&lt;STRONG&gt;&lt;EM&gt;To arrive at this equation is not clear*/&lt;/EM&gt;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;DIFF_DATE=ABS(DIF('date of visit' selected in the absence of DOD_DIFF, 'date of visit' selected in the presence of DOD_DIFF)&lt;/LI&gt;
&lt;LI&gt;ERROR= DIFF_WGT_DX* DOD_DIFF&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Thu, 15 Nov 2018 21:35:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513633#M138404</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-15T21:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513658#M138417</link>
      <description>&lt;P&gt;&amp;nbsp;C. Calculate measurement error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. DIFF_WGT_DX=&amp;nbsp;WGT_DX_FULL&amp;nbsp;- WGT_DX_PARTIAL&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, you have a column for WGT_DX_FULL which was calculated using DOD_DIFF, and you also have a column WGT_DX_PARTIAL calculated using SER_DATE_DX. At this point, every patients is associated with&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;WGT_DX_FULL&amp;nbsp; and&amp;nbsp;WGT_DX_PARTIAL where we will calculate the difference between: ABS(DIFF(WGT_DX_FULL-WGT_DX_PARTIAL)).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. DIFF_DATE=ABS(DIF('date of visit' selected in the absence of DOD_DIFF, 'date of visit' selected in the presence of DOD_DIFF)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You selected 'SER_DATE_DX' using&amp;nbsp;&lt;SPAN&gt;DOD_DIFF. You also selected SER_DATE_DX under assumption of&amp;nbsp;DOD_DIFF not available. These two selected&amp;nbsp;SER_DATE_DX may or may not overlap. We're interested in the difference in days between these two dates.&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. ERROR= DIFF_WGT_DX* DIFF_DATE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm curious what you would say regarding zero values generated for&amp;nbsp;&lt;SPAN&gt;DIFF_WGT_DX and&amp;nbsp;DIFF_DATE. The goal here is to quantify the error. However, zero values of both&amp;nbsp;DIFF_WGT_DX and&amp;nbsp;DIFF_DATE or one of these two might cancel to get quantity from&amp;nbsp;ERROR= DIFF_WGT_DX* DIFF_DATE equation.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Therefore, shall we shift the calculated difference to the right by one unit so we don't deal with zero?&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 21:53:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513658#M138417</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-15T21:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513689#M138429</link>
      <description>&lt;P&gt;&amp;nbsp;C. Calculate measurement error&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. DIFF_WGT_DX=&amp;nbsp;WGT_DX_FULL&amp;nbsp;- WGT_DX_PARTIAL&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Yes, you have a column for WGT_DX_FULL which was calculated using DOD_DIFF&lt;/FONT&gt;, and you also have a column WGT_DX_PARTIAL calculated using SER_DATE_DX. At this point, every patients is associated with&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;WGT_DX_FULL&amp;nbsp; and&amp;nbsp;WGT_DX_PARTIAL where we will calculate the difference between: ABS(DIFF(WGT_DX_FULL-WGT_DX_PARTIAL)).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;Yes, you have a column for WGT_DX_FULL which was calculated using DOD_DIFF&lt;/FONT&gt;,&amp;nbsp; How is this possible if&amp;nbsp;DOD_DIFF does not exist (A situation)&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So if&amp;nbsp;DOD_DIFF&amp;nbsp; does not exist , the potential to calculate&amp;nbsp;WGT_DX_FULL doesn;t exist either , isn't that right? so what would you fill in for&amp;nbsp;&lt;STRONG&gt;WGT_DX_FULL&amp;nbsp; in the equation&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;DIFF_WGT_DX=&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;WGT_DX_FULL&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;- WGT_DX_PARTIAL ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;A. Without using DOD_DIFF:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Choose the earliest date of visit&lt;/LI&gt;
&lt;LI&gt;If there are multiple records for that data, choose the&amp;nbsp;lowest WGT_DX, call is WGT_DX_PARTIAL&lt;/LI&gt;
&lt;LI&gt;Pick one row per patient when these conditions meet&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;STRONG&gt;B. Using DOD_DIFF:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Choose the minimum DOD_DIFF&lt;/LI&gt;
&lt;LI&gt;If there are multiple records for that value of DOD_DIFF, choose the&amp;nbsp;lowestWGT_DX, call it WGT_DX_FULL&lt;/LI&gt;
&lt;LI&gt;Pick one row per patient when these conditions meet&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 22:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513689#M138429</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-15T22:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513692#M138430</link>
      <description>&lt;P&gt;There seems to be a slight confusion.&amp;nbsp;&lt;SPAN&gt;WGT_DX_PARTIAL is calculated when DOD_DIFF does not exist.&amp;nbsp;WGT_DX_FULL is calculated using DOD_DIFF.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Under assumption of DOD_DIFF does not exist, we will use SER_DATE_DX instead DOD_DIFF and do following:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;-&amp;nbsp;Choose the earliest 'SER_DATE_DX' (min(&lt;SPAN&gt;'SER_DATE_DX'&lt;/SPAN&gt;)) instead min (DOD_DIFF)&lt;/P&gt;
&lt;P&gt;- if&amp;nbsp;there are multiple records for that data, choose the lowest WGT_DX, call is WGT_DX_PARTIAL&lt;BR /&gt;- Pick one row per patient when these conditions meet&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this clarify?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 22:26:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513692#M138430</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-15T22:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513694#M138432</link>
      <description>the scenario without DOD_DIFF, I can imagine the exact same approach used with DOD_DIFF but only difference would be to use SER_DATE_DX instead DOD_DIFF because of our assumption of its non-existence.</description>
      <pubDate>Thu, 15 Nov 2018 22:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513694#M138432</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-15T22:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513695#M138433</link>
      <description>&lt;P&gt;Take a look at these and test it on the sample you posted for just one id, i did for ID=1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*WGT_DX_FULL*/

proc sql;
create table WGT_DX_FULL as
select distinct *,min(WGT_DX) as WGT_DX_FULL
from
(select  *, min(DOD_DIFF) as min_DOD_DIFF
from have1(where=(id=1))
group by id
having DOD_DIFF=min_DOD_DIFF)
group by id, min_DOD_DIFF
having min(wgt_dx)=wgt_dx;
quit;

&lt;BR /&gt;/*WGT_DX_PARTIAL*/

proc sql;
create table WGT_DX_PARTIAL as
select distinct *,min(WGT_DX) as WGT_DX_PARTIAL
from
(select  *, min(SER_DATE_DX) as min_SER_DATE_DX
from have1(where=(id=1))
group by id
having SER_DATE_DX=min_SER_DATE_DX)
group by id, min_SER_DATE_DX
having min(wgt_dx)=wgt_dx;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, this should help you get the hang of&amp;nbsp; where I am at.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WGT_DX_FULL uses DOD_DIFF&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WGT_DX_PARTIAL uses SER_DATE_DX&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and we take it from here&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 22:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513695#M138433</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-15T22:38:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513698#M138434</link>
      <description>&lt;P&gt;I'm running downstairs to test the codes. Will take me 2 min. However, the codes make sense and you're correct on WGT_DX_FULL uses DOD_DIFF and WGT_DX_PARTIAL uses SER_DATE_DX. And I assume, that we will have to merge the resulting datasets from these proc sqls. I will get back to you asap. 2min.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 12:51:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513698#M138434</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-11-16T12:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate error with variable known and unknown scenarios using repeated measurement data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513699#M138435</link>
      <description>&lt;P&gt;Take your time, I am here till 6pm and right now it is 4:45. Central time&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2018 22:44:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-error-with-variable-known-and-unknown-scenarios-using/m-p/513699#M138435</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-15T22:44:05Z</dc:date>
    </item>
  </channel>
</rss>

