<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Cliff,<div><br></div><div> Thanks for the update! You can simulate a dataset of ages at death from a Gompertz mortality (mu(x) = a * exp(b * x)) with the following code:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Monaco; color: rgb(21, 33, 155); "><span style="color: rgb(0, 0, 0); ">rgomp</span> = <span style="color: rgb(178, 137, 30); ">function</span>(<span style="color: rgb(0, 0, 0); ">n</span>, <span style="color: rgb(0, 0, 0); ">theta</span>) {</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Monaco; color: rgb(21, 33, 155); "> <span style="color: rgb(0, 0, 0); ">u</span> = <span style="color: rgb(0, 0, 0); ">runif</span>(<span style="color: rgb(0, 0, 0); ">n</span>)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Monaco; color: rgb(21, 33, 155); "> <span style="color: rgb(0, 0, 0); ">rx</span> = <span style="color: rgb(0, 0, 0); ">log</span>(<span style="color: rgb(50, 82, 24); ">1</span> - <span style="color: rgb(0, 0, 0); ">log</span>(<span style="color: rgb(50, 82, 24); ">1</span> - <span style="color: rgb(0, 0, 0); ">u</span>) * <span style="color: rgb(0, 0, 0); ">theta</span>[<span style="color: rgb(50, 82, 24); ">2</span>] / <span style="color: rgb(0, 0, 0); ">exp</span>(<span style="color: rgb(0, 0, 0); ">theta</span>[<span style="color: rgb(50, 82, 24); ">1</span>])) / <span style="color: rgb(0, 0, 0); ">theta</span>[<span style="color: rgb(50, 82, 24); ">2</span>]</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Monaco; "><span style="color: rgb(21, 33, 155); "> </span>return<span style="color: rgb(21, 33, 155); ">(</span>rx<span style="color: rgb(21, 33, 155); ">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 15px/normal Monaco; color: rgb(21, 33, 155); ">}</div><div><br></div><div>Where n is the number of individuals you want to simulate, and theta are: theta[1] = log(a) and theta[2] = b. You can fix theta[2] at some negative value.</div><div><br></div><div> Best,</div><div><br class="webkit-block-placeholder"></div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div> Fernando<br class="Apple-interchange-newline">______________________________________________</div><div><div> </div><div>Fernando Colchero</div><div><br></div><div>Max Planck Institute for Demographic Research</div><div>Konrad Zuse Str. 1, 18057, Rostock, Germany</div><div>Tel: +49 (0) 381 2081 113</div><div>Fax: +49 (0) 381 2081 529</div><div><div>E-mail: <a href="mailto:Colchero@demogr.mpg.de">Colchero@demogr.mpg.de</a></div></div><div>______________________________________________</div></div><div><br></div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline"></span>
</div>
<br><div><div>On Nov 10, 2011, at 6:33 PM, Cliff Cunningham wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Dear Basta,<div><br><div><span class="Apple-tab-span" style="white-space:pre">        </span>I'm pleased to report that I have -- with an artificial dataset -- been able to recover patterns of declining mortality. Thanks very much for fixing this!</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>Is it possible to enforce declining mortality on a simulation (enforcing negative b1)? I'd like to see how this affects the pattern of deaths in the life tables, as there are entire years with no deaths.</div><div><div>
<span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="font-size: 12px; "><span class="Apple-tab-span" style="white-space: pre; ">        </span></div><div style="font-size: 12px; "><span class="Apple-tab-span" style="white-space: pre; ">        </span>Thanks very much!</div><div style="font-size: 12px; "><br></div><div style="font-size: 12px; "> <span class="Apple-converted-space"> </span><span class="Apple-tab-span" style="white-space: pre; ">        </span>Cliff Cunningham</div><div style="font-size: 12px; "><br></div><div style="font-size: 12px; "><br class="Apple-interchange-newline"> Professor</div><div style="font-size: 12px; "><span class="Apple-tab-span" style="white-space: pre; ">        </span>Biology Department</div><div style="font-size: 12px; "> <span class="Apple-tab-span" style="white-space: pre; ">        </span>Duke University</div><div style="font-size: 12px; "> 130 Science Drive</div><div style="font-size: 12px; "><span class="Apple-tab-span" style="white-space: pre; ">        </span>Durham NC 27708<br class="webkit-block-placeholder"></div><div style="font-size: 12px; "><span class="Apple-tab-span" style="white-space: pre; ">        </span>Phone 919-660-7356<br></div><div style="font-size: 12px; "><br></div><div style="font-size: 12px; "><a href="http://www.biology.duke.edu/cunningham">http://www.biology.duke.edu/cunningham</a></div><div style="font-size: 12px; "><br class="khtml-block-placeholder"></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></div></div></div>_______________________________________________<br>Basta-users mailing list<br><a href="mailto:Basta-users@lists.r-forge.r-project.org">Basta-users@lists.r-forge.r-project.org</a><br>https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/basta-users<br></blockquote></div><br></div>
<p><span style="font-family:'Arial';font-size:8pt;">----------</span></p>
<p><span style="font-family:'Arial';font-size:8pt;">This mail has been sent through the MPI for Demographic Research. Should you receive a mail that is apparently from a MPI user without this text displayed, then the address has most likely been faked. If you are uncertain about the validity of this message, please check the mail header or ask your system administrator for assistance.</span></p>
<p><span style="font-family:'Arial';font-size:8pt;"> </span></p></body></html>