<?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: How to randomly generate year based decimal date based on the year known? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453336#M114545</link>
    <description>&lt;P&gt;If the decimal portion is the random part.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set today;
by id ;
retain rand;
if first.id then do;
rand =round( ceil( rand('uniform')*100)/100, 0.01);
end;

dob_rand = dob+rand;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 11 Apr 2018 18:49:42 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-04-11T18:49:42Z</dc:date>
    <item>
      <title>How to randomly generate year based decimal date based on the year known?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453329#M114543</link>
      <description>&lt;P&gt;I'd like to randomly&amp;nbsp;generate random "year based decimal date" based on the year of birth&amp;nbsp;known?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data: unique personal identifier(id), age in months at the time of measurement, year of birth (dob) and BMI (kg/m2) in my data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data today;
input id age_at_msmt_month dob bmi;
cards;
55 12.0 2002 17.1
55 19.4 2002 15.6
55 31.7 2002 17.1
55 45.5 2002 16.8
55 52.3 2002 17.1
21 10.9 2005 16.5
21 19.2 2005 16.6
21 24.5 2005 15.4
11 8.28 2010 16.3
;

data want;
input id age_at_msmt_month dob bmi dob_decimal;
cards;
55 12.0 2002 17.1 2002.36
55 19.4 2002 15.6 2002.36
55 31.7 2002 17.1 2002.36
55 45.5 2002 16.8 2002.36
55 52.3 2002 17.1 2002.36
21 10.9 2005 16.5 2005.89
21 19.2 2005 16.6 2005.89
21 24.5 2005 15.4 2005.89
11 8.28 2010 16.3 2010.12
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Apr 2018 18:25:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453329#M114543</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-04-11T18:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly generate year based decimal date based on the year known?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453336#M114545</link>
      <description>&lt;P&gt;If the decimal portion is the random part.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set today;
by id ;
retain rand;
if first.id then do;
rand =round( ceil( rand('uniform')*100)/100, 0.01);
end;

dob_rand = dob+rand;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Apr 2018 18:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453336#M114545</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-11T18:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly generate year based decimal date based on the year known?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453339#M114546</link>
      <description>&lt;P&gt;If you have age in months at measurement and have the time of measurement you can get closer with the birth date.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're working with other things, there are standards on how to age a population - you typically age half as of July 1st and half after it's a common concept in demography.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 19:00:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453339#M114546</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-11T19:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly generate year based decimal date based on the year known?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453341#M114548</link>
      <description>&lt;P&gt;Reeza, can you help translate the code to R?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 19:19:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453341#M114548</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-04-11T19:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to randomly generate year based decimal date based on the year known?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453344#M114549</link>
      <description>I thought about this. However, date of measurement is not given &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;</description>
      <pubDate>Wed, 11 Apr 2018 19:21:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-randomly-generate-year-based-decimal-date-based-on-the/m-p/453344#M114549</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-04-11T19:21:08Z</dc:date>
    </item>
  </channel>
</rss>

