<?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 Missing data on repeat measurements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/433913#M107644</link>
    <description>&lt;P&gt;I want to follow-up: missing data on repeat measurement.&lt;/P&gt;
&lt;P&gt;Anyone helps much appreciated and thanks in advanced.&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;Assuming I measured blood pressure for 6 subjects at 3 times, week 1, week 2 week3.
How can I deal with the missing value?

data bp;
input id age bp1 bp2 bp3;
datalines;
1 45 110 165 90
2 56 124 . .
3 60 142 . 137
4 61 . 94 120
5 39 130 130 .
6 55 157 130 124
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Phan S.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 04 Feb 2018 00:01:35 GMT</pubDate>
    <dc:creator>PhanS</dc:creator>
    <dc:date>2018-02-04T00:01:35Z</dc:date>
    <item>
      <title>Missing data on repeat measurements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/433913#M107644</link>
      <description>&lt;P&gt;I want to follow-up: missing data on repeat measurement.&lt;/P&gt;
&lt;P&gt;Anyone helps much appreciated and thanks in advanced.&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;Assuming I measured blood pressure for 6 subjects at 3 times, week 1, week 2 week3.
How can I deal with the missing value?

data bp;
input id age bp1 bp2 bp3;
datalines;
1 45 110 165 90
2 56 124 . .
3 60 142 . 137
4 61 . 94 120
5 39 130 130 .
6 55 157 130 124
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Phan S.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 00:01:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/433913#M107644</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-04T00:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Missing data on repeat measurements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/433925#M107645</link>
      <description>&lt;P&gt;Note that I've moved your post to the Base Programming forum, you've been posting them in Community Matters.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To answer your question:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;How can I deal with the missing value?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There's two components to this, one is how to program it and the second is methodological. The methods to fill in data depend on the subject matter a lot of times. Sometimes its very inappropriate to impute missing data because it leads to misleading and sometimes it makes perfect sense such as continuing stock data over the weekend.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have the answer for the methodological component the technical aspects can be easier to answer. Typing code is easy, figuring out what to type is hard :).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some methods that come to mind are:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Nothing - leave missing as missing and use all available data&lt;/LI&gt;
&lt;LI&gt;LOCF - last observation carried forward&lt;/LI&gt;
&lt;LI&gt;MEAN/MEDIAN - replace with the&amp;nbsp;a statistical summary of the non-missing values&lt;/LI&gt;
&lt;LI&gt;Regression - if you have enough data you can run a single regression model and calculate predicted values&lt;/LI&gt;
&lt;LI&gt;Modelling - build model with just available data. Use model to predict for missing data and then re-validate the model.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Random - randomly assign values based on some general rules and then run a bunch of simulations to see the effect on your analysis.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Which approach are you looking to implement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. BP has two components, systolic and diastolic and BP as a single value isn't meaningful as far as I understand it, but thats not particularly relevant here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31493"&gt;@PhanS&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I want to follow-up: missing data on repeat measurement.&lt;/P&gt;
&lt;P&gt;Anyone helps much appreciated and thanks in advanced.&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;Assuming I measured blood pressure for 6 subjects at 3 times, week 1, week 2 week3.
How can I deal with the missing value?

data bp;
input id age bp1 bp2 bp3;
datalines;
1 45 110 165 90
2 56 124 . .
3 60 142 . 137
4 61 . 94 120
5 39 130 130 .
6 55 157 130 124
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Phan S.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 01:20:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/433925#M107645</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-02-04T01:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Missing data on repeat measurements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/433965#M107668</link>
      <description>&lt;P&gt;I have created an sample macro I hope it servers the purpose.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had assumed that the bp1 column can never be blank. Please let know if it is not correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data bp;
input id age bp1 bp2 bp3;
datalines;
1 45 110 165 90
2 56 124 . .
3 60 142 . 137
4 61 . 94 120
5 39 130 130 .
6 55 157 130 124
;
run;

%macro bp_fix(number_of_bp=);
data final_bp;
set bp;
%do i=1 %to &amp;amp;number_of_bp.;
    %if &amp;amp;i gt 1 %then %do;
        if bp&amp;amp;i =. then %EVAL(bp&amp;amp;i.-1);
    %end;  
%end;
run;
%mend bp_fix;

/*In this case number_of_bp=3 so*/
%bp_fix(number_of_bp=3);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This Can be used for more than 3 columns.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Feb 2018 15:12:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/433965#M107668</guid>
      <dc:creator>Satish_Parida</dc:creator>
      <dc:date>2018-02-04T15:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: Missing data on repeat measurements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/434608#M107863</link>
      <description>&lt;P&gt;Hello Reeza,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your suggestions.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For methodologies, I will&amp;nbsp;choose either use only available data, replacing mean/median or imputation (I know a bit).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The LOCF, Random, and calculate predict value -- I do not know.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding&amp;nbsp;programming, I would like to ask your&amp;nbsp;help, assuming I have a data set that collected&amp;nbsp;data for 3 cycles same subjects.&lt;/P&gt;
&lt;P&gt;I would like to know each cycle how many subjects participated in the study. In the other word, I would like to know many subjects were not returned in cycle 2 and cycle 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thank you very much in advanced, Reeza.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS: BP -- you are absolutely correct, systolic and diastolic BP. It was a fake number.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Phan S.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 17:21:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/434608#M107863</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-06T17:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: Missing data on repeat measurements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/434609#M107864</link>
      <description>&lt;P&gt;Hello Satish,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code appears not work - I am not sure why. May you retest&amp;nbsp;with a mock dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Phan S.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2018 17:23:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-data-on-repeat-measurements/m-p/434609#M107864</guid>
      <dc:creator>PhanS</dc:creator>
      <dc:date>2018-02-06T17:23:39Z</dc:date>
    </item>
  </channel>
</rss>

