<?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: Set value at one time point to all time points for each participant in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785310#M250608</link>
    <description>&lt;P&gt;You can use retain statements to achieve this, but if you need specific code, please provide the data in a usable form, not as an image.&lt;/P&gt;
&lt;P&gt;Maybe the code is something like this. (I haven't tested it because I don't have the data)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set biosd.lab_wide;
  by caseid;
  retain height;
  if first.caseid then height=height_cm_;
  else height_cm_=height;
  drop height;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 10 Dec 2021 05:54:16 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2021-12-10T05:54:16Z</dc:date>
    <item>
      <title>Set value at one time point to all time points for each participant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785307#M250605</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wondering if anyone could help me with this. Here is a photo of my data set:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2021-12-09 at 10.36.46 PM.png" style="width: 492px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66600i4FEC3AE1348BB004/image-dimensions/492x322?v=v2" width="492" height="322" role="button" title="Screen Shot 2021-12-09 at 10.36.46 PM.png" alt="Screen Shot 2021-12-09 at 10.36.46 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;We are assuming that the heights stay the same for each visit. What I would like to do is fill in the missing height values with the value for visit 1 for the rest of the visits for each participant. For example, the height of participant 1484 was 196 at visit 1. I would like to replace the missing values for visits 2-6 with 196 for this participant and do the same for all participants. Does anyone know how I can code this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 05:40:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785307#M250605</guid>
      <dc:creator>keherder</dc:creator>
      <dc:date>2021-12-10T05:40:48Z</dc:date>
    </item>
    <item>
      <title>Re: Set value at one time point to all time points for each participant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785310#M250608</link>
      <description>&lt;P&gt;You can use retain statements to achieve this, but if you need specific code, please provide the data in a usable form, not as an image.&lt;/P&gt;
&lt;P&gt;Maybe the code is something like this. (I haven't tested it because I don't have the data)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set biosd.lab_wide;
  by caseid;
  retain height;
  if first.caseid then height=height_cm_;
  else height_cm_=height;
  drop height;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Dec 2021 05:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785310#M250608</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-12-10T05:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set value at one time point to all time points for each participant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785311#M250609</link>
      <description>&lt;P&gt;Imho the else-part needs an update:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;else do;
  if missing(height_cm_) then do;
    height_cm_ = height;
  end;
end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or shorter&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;else do;
  height_cm_ = coalesce(height_cm_, height);
end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Dec 2021 06:22:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785311#M250609</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-12-10T06:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set value at one time point to all time points for each participant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785322#M250617</link>
      <description>&lt;P&gt;What if the first visit does not have a measurement?&lt;/P&gt;
&lt;P&gt;Have you verified that none of your Caseids have more than one measurement that is not unique? Children over a period of 5 or 6 months may&amp;nbsp; well show a change in height.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Dec 2021 08:04:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785322#M250617</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-12-10T08:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Set value at one time point to all time points for each participant</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785426#M250657</link>
      <description>Good point! This is just a simulated data set, however, for a classroom project and we were told to assume heights stayed constant.</description>
      <pubDate>Fri, 10 Dec 2021 16:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Set-value-at-one-time-point-to-all-time-points-for-each/m-p/785426#M250657</guid>
      <dc:creator>keherder</dc:creator>
      <dc:date>2021-12-10T16:32:13Z</dc:date>
    </item>
  </channel>
</rss>

