<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Statistics Blogs</title>
	
	<link>http://www.statsblogs.com</link>
	<description />
	<lastBuildDate>Sat, 25 May 2013 01:39:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/statsblogs" /><feedburner:info uri="statsblogs" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>statsblogs</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Gelman sides w/ Neyman over Fisher in relation to a famous blow-up</title>
		<link>http://feedproxy.google.com/~r/statsblogs/~3/_r4k1ISx-hE/</link>
		<comments>http://www.statsblogs.com/2013/05/25/gelman-sides-w-neyman-over-fisher-in-relation-to-a-famous-blow-up/#comments</comments>
		<pubDate>Sat, 25 May 2013 01:39:31 +0000</pubDate>
		<dc:creator>Mayo</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[blogolog]]></category>
		<category><![CDATA[Fisher]]></category>
		<category><![CDATA[statistics]]></category>
		<category><![CDATA[Stephen Senn]]></category>

		<guid isPermaLink="false">http://errorstatistics.com/?p=10573</guid>
		<description><![CDATA[<p>Andrew Gelman had said he would go back to explain why he sided with Neyman over Fisher in relation to a big, famous argument discussed on my Feb. 16, 2013 post: “Fisher and Neyman after anger management?”, and I just received an e-mail from Andrew saying that he has done so: &#8220;In which I side with Neyman [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=errorstatistics.com&#38;blog=30994953&#38;post=10573&#38;subd=errorstatistics&#38;ref=&#38;feed=1" width="1" height="1" /></p><p>The post <a href="http://www.statsblogs.com/2013/05/25/gelman-sides-w-neyman-over-fisher-in-relation-to-a-famous-blow-up/">Gelman sides w/ Neyman over Fisher in relation to a famous blow-up</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution">(This article was originally published at <a href="http://errorstatistics.com">Error Statistics Philosophy » Statistics</a>, and syndicated at <a href="http://www.statsblogs.com">StatsBlogs</a>.)
<br /></p>
<div id="attachment_5025" class="wp-caption alignleft" style="width: 75px"><a href="http://errorstatistics.files.wordpress.com/2012/07/img_0143.jpg"><img class=" wp-image-5025" alt="3-d red yellow puzzle people (E&amp;I)" src="http://errorstatistics.files.wordpress.com/2012/07/img_0143.jpg?w=65&#038;h=108" width="65" height="108" /></a><p class="wp-caption-text">blog-o-log</p></div>
<p>Andrew Gelman had said he would go back to explain why he sided with Neyman over Fisher in relation to a big, famous argument discussed on my <a href="http://errorstatistics.com/2013/02/16/fisher-and-neyman-after-anger-management/">Feb. 16, 2013 post: “Fisher and Neyman after anger management?”</a>, and I just received an e-mail from Andrew saying that he has done so: &#8220;<a href="http://andrewgelman.com/2013/05/24/in-which-i-side-with-neyman-over-fisher/">In which I side with Neyman over Fisher&#8221;.</a> (I&#8217;m not sure what Senn&#8217;s reply might be.) Here it is:</p>
<blockquote><p><span style="color:#0000ff;">&#8220;In which I side with Neyman over Fisher&#8221; </span><span style="color:#0000ff;">Posted by <a title="Posts by Andrew" href="http://andrewgelman.com/author/andrew/" rel="author"><span style="color:#0000ff;">Andrew</span></a> on 24 May 2013, 9:28 am</span></p></blockquote>
<div>
<blockquote><p><span style="color:#0000ff;">As a data analyst and a scientist, Fisher &gt; Neyman, no question. But as a theorist, Fisher came up with ideas that worked just fine in his applications but can fall apart when people try to apply them too generally.<a href="http://errorstatistics.files.wordpress.com/2012/08/gelman5.gif"><img class=" wp-image-6018 alignright" alt="gelman5" src="http://errorstatistics.files.wordpress.com/2012/08/gelman5.gif?w=70&#038;h=101" width="70" height="101" /></a></span></p>
<p><span style="color:#0000ff;">Here’s an example that recently came up.</span></p>
<p><span style="color:#0000ff;">Deborah Mayo pointed me to a <a href="http://errorstatistics.com/2013/02/16/fisher-and-neyman-after-anger-management/#comment-10612"><span style="color:#0000ff;">comment</span></a> by Stephen Senn on the so-called Fisher and Neyman null hypotheses. In an experiment with n participants (or, as we used to say, subjects or experimental units), the Fisher null hypothesis is that the treatment effect is exactly 0 for every one of the n units, while the Neyman null hypothesis is that the individual treatment effects can be negative or positive but have an average of zero.</span></p>
<p><span style="color:#0000ff;">Senn explains why Neyman’s hypothesis in general makes no sense—the short story is that Fisher’s hypothesis seems relevant in some problems (sometimes we really are studying effects that are zero or close enough for all practical purposes), whereas Neyman’s hypothesis just seems weird (it’s implausible that a bunch of nonzero effects would exactly cancel). And I remember a similar discussion as a student, many years ago, when Rubin talked about that silly Neyman null hypothesis.</span></p>
<p><span style="color:#0000ff;">Thinking about it more, though, I side with Neyman over Fisher, because the interesting problem for me is not testing the null hypothesis, which in nontrivial problems can never be true anyway, but in estimation. And in estimation I am intersted in an average effect, not an effect that is identical across all people. I could imagine a model in which the variance of the treatment effect is proportional to its mean—this would bridge between the Neyman and Fisher ideas—but this is not a model that anyone ever fits.</span></p>
<p><span style="color:#0000ff;">So, just to say it again: if it’s a pure null hypothesis, sure, go with Fisher. But if you’re inverting a family of hypothesis tests to get a confidence interval (something which I’d almost never want to do, but let’s go with this, since that’s the common application of these ideas), I’d go with Neyman, as it omits the implausible requirement that the treatment effect be exactly identical on all items.</span></p>
<p><a href="http://errorstatistics.com/2013/02/16/fisher-and-neyman-after-anger-management/">“Fisher and Neyman after anger management?”</a></p></blockquote>
<p>If you look at the original <a href="http://errorstatistics.com/2013/02/16/fisher-and-neyman-after-anger-management/">post</a>, you can read the comments, and even see what some people said about the  anger management example.</p>
</div>
<br />Filed under: <a href='http://errorstatistics.com/category/fisher/'>Fisher</a>, <a href='http://errorstatistics.com/category/statistics/'>Statistics</a>, <a href='http://errorstatistics.com/category/stephen-senn/'>Stephen Senn</a> Tagged: <a href='http://errorstatistics.com/tag/blogolog/'>blogolog</a>, <a href='http://errorstatistics.com/tag/fisher/'>Fisher</a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=errorstatistics.com&#038;blog=30994953&%23038;post=10573&%23038;subd=errorstatistics&%23038;ref=&%23038;feed=1" width="1" height="1" />
<p class="syndicated-attribution"><br />
<br />
<font color=#8c1717><b>Please comment on the article here:</b></font> <a href="http://errorstatistics.com/2013/05/24/gelman-sides-w-neyman-over-fisher-in-relation-to-a-famous-blow-up/"><b>Error Statistics Philosophy » Statistics</b></a>
<br />
<br /></p><p>The post <a href="http://www.statsblogs.com/2013/05/25/gelman-sides-w-neyman-over-fisher-in-relation-to-a-famous-blow-up/">Gelman sides w/ Neyman over Fisher in relation to a famous blow-up</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p><img src="http://feeds.feedburner.com/~r/statsblogs/~4/_r4k1ISx-hE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.statsblogs.com/2013/05/25/gelman-sides-w-neyman-over-fisher-in-relation-to-a-famous-blow-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://0.gravatar.com/avatar/00528d540b993fde500821ec3a02441f?s=96&amp;amp;d=http://0.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96&amp;amp;r=PG" length="" type="" />
<enclosure url="http://errorstatistics.files.wordpress.com/2012/07/img_0143.jpg?w=90" length="" type="" />
<enclosure url="http://errorstatistics.files.wordpress.com/2012/08/gelman5.gif?w=104" length="" type="" />
		<feedburner:origLink>http://www.statsblogs.com/2013/05/25/gelman-sides-w-neyman-over-fisher-in-relation-to-a-famous-blow-up/</feedburner:origLink></item>
		<item>
		<title>What is probabilistic truth? Part 2 – Everything is conditional</title>
		<link>http://feedproxy.google.com/~r/statsblogs/~3/jpqO6QToDv4/</link>
		<comments>http://www.statsblogs.com/2013/05/24/what-is-probabilistic-truth-part-2-everything-is-conditional/#comments</comments>
		<pubDate>Fri, 24 May 2013 14:21:16 +0000</pubDate>
		<dc:creator>Corey Chivers</dc:creator>
				<category><![CDATA[Bayesian]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[conditional probability]]></category>
		<category><![CDATA[decision-making]]></category>
		<category><![CDATA[Machine learning]]></category>
		<category><![CDATA[probability]]></category>
		<category><![CDATA[Rstats]]></category>
		<category><![CDATA[teaching]]></category>

		<guid isPermaLink="false">http://bayesianbiologist.com/?p=926</guid>
		<description><![CDATA[<p>Read Part 1 When making a statement of the form &#8220;1/2 is the correct probability that this coin will land tails&#8221;, there are a few things which are left unsaid, but which are typically implied. The statement is one about the probability of an unknown event occurring, and it would seem reasonable to write this [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bayesianbiologist.com&#38;blog=23855543&#38;post=926&#38;subd=bayesianbiologist&#38;ref=&#38;feed=1" width="1" height="1" /></p><p>The post <a href="http://www.statsblogs.com/2013/05/24/what-is-probabilistic-truth-part-2-everything-is-conditional/">What is probabilistic truth? Part 2 – Everything is conditional</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution">(This article was originally published at <a href="http://bayesianbiologist.com">bayesianbiologist » Rstats</a>, and syndicated at <a href="http://www.statsblogs.com">StatsBlogs</a>.)
<br /></p>
<p><a title="What is probabilistic truth?" href="http://bayesianbiologist.com/2013/05/18/what-is-probabilistic-truth/">Read Part 1</a></p>
<p>When making a statement of the form &#8220;1/2 is the <em>correct</em> probability that this coin will land tails&#8221;, there are a few things which are left unsaid, but which are typically implied.</p>
<p>The statement is one about the probability of an unknown event occurring, and it would seem reasonable to write this statement using probability notation as P(toss=tails) = 0.5. And indeed many people would express it this way. However, what is missing is the state of knowledge under which this statement has been made. For instance, is the coin yet to be flipped, or is it currently rolling in a circle on the table, leaning in toward its final resting position? Perhaps the flipping device can consistently throw a coin such that it rotates exactly 5 times in the air before landing flat on the table. In these latter two cases, the statement of probability would be made under considerably more knowledge than the first, and would not tend to be 0.5 in these cases. An observer placing a probability of P(toss=tails) = 0.99 at the moment when the coin is circling in on its resting position, leaning heavily toward a tails up configuration, could be said to have the correct probability also. For fairness, lets say that the first observer also makes her probability statement at the same moment, but from another room where she cannot see what has happened.</p>
<p><strong>How can P(toss=tails) = 0.5, and P(toss=tails) = 0.99 be simultaneously correct?</strong></p>
<p>The answer is <em>conditioning</em>. Each of the statements were made conditional on the observer&#8217;s state of knowledge. More completely, the two statements can be rewritten as:</p>
<p style="text-align:center;">P(toss=tails | knowledge of observer 1) = 0.5 , and</p>
<p style="text-align:center;">P(toss=tails | knowledge of observer 2) = 0.99</p>
<p>In practice, however, we often leave out the conditional part of the notation unless it is germane to the problem at hand. However, <em>there is no such thing as unconditional probability</em>. In fact, Harvard professor Joe Blitzstein calls conditioning the <a href="http://www.youtube.com/watch?v=dzFf3r1yph8">Soul of Statistics</a>.</p>
<p>In the next post in this series, we&#8217;ll start looking at how to asses the correctness of a (conditional) probability statement after having observed an outcome.</p>
<div id="attachment_927" class="wp-caption aligncenter" style="width: 490px"><a href="http://bayesianbiologist.files.wordpress.com/2013/05/firefox_wallpaper.png"><img class="size-full wp-image-927" alt="Here's a bunch of random walks -- just 'cause its neat." src="http://bayesianbiologist.files.wordpress.com/2013/05/firefox_wallpaper.png?w=640"   /></a><p class="wp-caption-text">Here&#8217;s a bunch of random walks &#8212; just &#8217;cause its neat.</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/bayesianbiologist.wordpress.com/926/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/bayesianbiologist.wordpress.com/926/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=bayesianbiologist.com&#038;blog=23855543&%23038;post=926&%23038;subd=bayesianbiologist&%23038;ref=&%23038;feed=1" width="1" height="1" />
<p class="syndicated-attribution"><br />
<br />
<font color=#8c1717><b>Please comment on the article here:</b></font> <a href="http://bayesianbiologist.com/2013/05/24/what-is-probabilistic-truth-part-2-everything-is-conditional/"><b>bayesianbiologist » Rstats</b></a>
<br />
<br /></p><p>The post <a href="http://www.statsblogs.com/2013/05/24/what-is-probabilistic-truth-part-2-everything-is-conditional/">What is probabilistic truth? Part 2 – Everything is conditional</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p><img src="http://feeds.feedburner.com/~r/statsblogs/~4/jpqO6QToDv4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.statsblogs.com/2013/05/24/what-is-probabilistic-truth-part-2-everything-is-conditional/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://1.gravatar.com/avatar/4e3c284399ac0ca4375ef4bea2ba4d03?s=96&amp;amp;d=identicon&amp;amp;r=G" length="" type="" />
<enclosure url="http://bayesianbiologist.files.wordpress.com/2013/05/firefox_wallpaper.png" length="" type="" />
		<feedburner:origLink>http://www.statsblogs.com/2013/05/24/what-is-probabilistic-truth-part-2-everything-is-conditional/</feedburner:origLink></item>
		<item>
		<title>In which I side with Neyman over Fisher</title>
		<link>http://feedproxy.google.com/~r/statsblogs/~3/9dc5PJkLqA8/</link>
		<comments>http://www.statsblogs.com/2013/05/24/in-which-i-side-with-neyman-over-fisher/#comments</comments>
		<pubDate>Fri, 24 May 2013 13:28:00 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Causal Inference]]></category>
		<category><![CDATA[Miscellaneous Statistics]]></category>

		<guid isPermaLink="false">http://andrewgelman.com/?p=18570</guid>
		<description><![CDATA[<p><p>As a data analyst and a scientist, Fisher &#62; Neyman, no question. But as a theorist, Fisher came up with ideas that worked just fine in his applications but can fall apart when people try to apply them too generally. Here&#8217;s an example that recently came up. Deborah Mayo pointed me to a comment by [...]</p><p>The post <a href="http://andrewgelman.com/2013/05/24/in-which-i-side-with-neyman-over-fisher/">In which I side with Neyman over Fisher</a> appeared first on <a href="http://andrewgelman.com">Statistical Modeling, Causal Inference, and Social Science</a>.</p></p><p>The post <a href="http://www.statsblogs.com/2013/05/24/in-which-i-side-with-neyman-over-fisher/">In which I side with Neyman over Fisher</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution">(This article was originally published at <a href="http://andrewgelman.com">Statistical Modeling, Causal Inference, and Social Science</a>, and syndicated at <a href="http://www.statsblogs.com">StatsBlogs</a>.)
<br /></p>
<p>As a data analyst and a scientist, Fisher > Neyman, no question.  But as a theorist, Fisher came up with ideas that worked just fine in his applications but can fall apart when people try to apply them too generally.</p>
<p>Here&#8217;s an example that recently came up.</p>
<p>Deborah Mayo pointed me to a <a href="http://errorstatistics.com/2013/02/16/fisher-and-neyman-after-anger-management/#comment-10612">comment</a> by Stephen Senn on the so-called Fisher and Neyman null hypotheses.  In an experiment with n participants (or, as we used to say, subjects or experimental units), the Fisher null hypothesis is that the treatment effect is exactly 0 for every one of the n units, while the Neyman null hypothesis is that the individual treatment effects can be negative or positive but have an average of zero.</p>
<p>Senn explains why Neyman&#8217;s hypothesis in general makes no sense&#8212;the short story is that Fisher&#8217;s hypothesis seems relevant in some problems (sometimes we really are studying effects that are zero or close enough for all practical purposes), whereas Neyman&#8217;s hypothesis just seems weird (it&#8217;s implausible that a bunch of nonzero effects would exactly cancel).  And I remember a similar discussion as a student, many years ago, when Rubin talked about that silly Neyman null hypothesis.</p>
<p>Thinking about it more, though, I side with Neyman over Fisher, because the interesting problem for me is not testing the null hypothesis, which in nontrivial problems can never be true anyway, but in estimation. And in estimation I am intersted in an average effect, not an effect that is identical across all people.  I could imagine a model in which the variance of the treatment effect is proportional to its mean&#8212;this would bridge between the Neyman and Fisher ideas&#8212;but this is not a model that anyone ever fits.</p>
<p>So, just to say it again:  if it&#8217;s a pure null hypothesis, sure, go with Fisher.  But if you&#8217;re inverting a family of hypothesis tests to get a confidence interval (something which I&#8217;d almost never want to do, but let&#8217;s go with this, since that&#8217;s the common application of these ideas), I&#8217;d go with Neyman, as it omits the implausible requirement that the treatment effect be exactly identical on all items.</p>
<p>The post <a href="http://andrewgelman.com/2013/05/24/in-which-i-side-with-neyman-over-fisher/">In which I side with Neyman over Fisher</a> appeared first on <a href="http://andrewgelman.com">Statistical Modeling, Causal Inference, and Social Science</a>.</p>
<p class="syndicated-attribution"><br />
<br />
<font color=#8c1717><b>Please comment on the article here:</b></font> <a href="http://andrewgelman.com/2013/05/24/in-which-i-side-with-neyman-over-fisher/"><b>Statistical Modeling, Causal Inference, and Social Science</b></a>
<br />
<br /></p><p>The post <a href="http://www.statsblogs.com/2013/05/24/in-which-i-side-with-neyman-over-fisher/">In which I side with Neyman over Fisher</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p><img src="http://feeds.feedburner.com/~r/statsblogs/~4/9dc5PJkLqA8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.statsblogs.com/2013/05/24/in-which-i-side-with-neyman-over-fisher/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.statsblogs.com/2013/05/24/in-which-i-side-with-neyman-over-fisher/</feedburner:origLink></item>
		<item>
		<title>Turn off ODS when running simulations in SAS</title>
		<link>http://feedproxy.google.com/~r/statsblogs/~3/rR5Oe8jYCIk/</link>
		<comments>http://www.statsblogs.com/2013/05/24/turn-off-ods-when-running-simulations-in-sas/#comments</comments>
		<pubDate>Fri, 24 May 2013 09:24:34 +0000</pubDate>
		<dc:creator>Rick Wicklin</dc:creator>
				<category><![CDATA[SAS]]></category>
		<category><![CDATA[Sampling and Simulation]]></category>
		<category><![CDATA[Tips and Techniques]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.sas.com/content/iml/?p=8377</guid>
		<description><![CDATA[<p>In my article "Simulation in SAS: The slow way or the BY way," I showed how to use BY-group processing rather than a macro loop in order to efficiently analyze simulated data with SAS. In the example, I analyzed the simulated data by using PROC MEANS, and I use the [...]</p><p>The post <a href="http://www.statsblogs.com/2013/05/24/turn-off-ods-when-running-simulations-in-sas/">Turn off ODS when running simulations in SAS</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution">(This article was originally published at <a href="http://blogs.sas.com/content/iml">The DO Loop</a>, and syndicated at <a href="http://www.statsblogs.com">StatsBlogs</a>.)
<br /></p>
<p>
In my article <a href="http://blogs.sas.com/content/iml/2012/07/18/simulation-in-sas-the-slow-way-or-the-by-way/">"Simulation in SAS: The slow way or the BY way,"</a> I showed how to use BY-group processing rather than a macro loop in order to efficiently analyze simulated data with SAS. In the example, I analyzed the simulated data by using PROC MEANS, and I use the NOPRINT option to suppress the ODS output that the procedure would normally produce.
</p><p>
About 50 SAS/STAT procedures support the NOPRINT option in the PROC statement. When you specify the NOPRINT option, ODS is temporarily disabled while the procedure runs. This prevents SAS from displaying tables and graphs that would otherwise be produced for each BY group.  For a simulation that computes  statistics for thousands of BY groups, suppressing the display of tables results in a substantial savings of time.
</p><p>
Newer SAS procedures do not always support a NOPRINT statement. However, you can still suppress the ODS output. The following macros encapsulate statements that turn the ODS system off and on. I call the %ODSOff macro before I start the BY-group analysis; I call the %ODSOn macro after the analysis completes.
</p>


<div class="wp_syntax"><div class="code"><pre class="sas" style="font-family:monospace;"><span style="color: #0000ff;">%macro</span> ODSOff<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #006400; font-style: italic;">/* Call prior to BY-group processing */</span>
ods graphics off;
ods exclude all;
ods noresults;
<span style="color: #0000ff;">%mend</span>;
&nbsp;
<span style="color: #0000ff;">%macro</span> ODSOn<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #006400; font-style: italic;">/* Call after BY-group processing */</span>
ods graphics <span style="color: #0000ff;">on</span>;
ods exclude none;
ods results;
<span style="color: #0000ff;">%mend</span>;</pre></div></div>




<p>
For example, if I were using PROC ROBUSTREG  to analyze many samples of simulated data, I might use the following pseudo-code:
</p>


<div class="wp_syntax"><div class="code"><pre class="sas" style="font-family:monospace;">%ODSOff
<span style="color: #000080; font-weight: bold;">proc robustreg</span> <span style="color: #000080; font-weight: bold;">data</span>=MySimData;
   <span style="color: #0000ff;">BY</span> SampleID;
   model y = <span style="color: #0000ff;">x</span>;
   ods <span style="color: #0000ff;">output</span> ParameterEstimates = OutputStats;  <span style="color: #006400; font-style: italic;">/* &lt;== insert name of ODS table */</span>
<span style="color: #000080; font-weight: bold;">run</span>;
%ODSOn</pre></div></div>



<p>
Even though ODS is suppressed to the display destinations (such as LISTING and HTML), you can capture the statistics that result from each analysis by using an ODS OUTPUT statement, which saves an ODS table to a SAS data set. Other ways to save statistics include using an OUTPUT statement, an OUT= or OUTEST= data set, and so forth.
</p><p>

Be aware that some SAS procedures (such as PROC MIXED) write a NOTE to the SAS log as part of their normal operation.  The NOTE might say something like "NOTE: Convergence criteria met." For these procedures, you will also want to turn off notes, lest they fill the SAS log:


<div class="wp_syntax"><div class="code"><pre class="sas" style="font-family:monospace;">%ODSOff
<span style="color: #0000ff;">options</span> nonotes;  <span style="color: #006400; font-style: italic;">/* use NONOTES to suppress notes to the log */</span>
<span style="color: #000080; font-weight: bold;">proc mixed</span> ...;
model y = ...;
<span style="color: #000080; font-weight: bold;">run</span>;
<span style="color: #0000ff;">options</span> notes;   <span style="color: #006400; font-style: italic;">/* turn NOTES back on */</span>
%ODSOn</pre></div></div>



</p><p>
The material in this blog post is taken from my book <a href="http://support.sas.com/publishing/authors/wicklin.html"><em>Simulating Data with SAS</em></a>, which contains many more tips and techniques for the efficient simulation of data.</p><div class="entry-utility"><span class="tag-links">tags: <a href="http://blogs.sas.com/content/iml/tag/sampling-and-simulation/">Sampling and Simulation</a>, <a href="http://blogs.sas.com/content/iml/tag/tips-and-techniques/">Tips and Techniques</a></span></div><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/TheDoLoop?a=YKzBBaf1GlE:8dGRcSHDmoE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/TheDoLoop?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheDoLoop?a=YKzBBaf1GlE:8dGRcSHDmoE:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/TheDoLoop?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheDoLoop?a=YKzBBaf1GlE:8dGRcSHDmoE:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/TheDoLoop?i=YKzBBaf1GlE:8dGRcSHDmoE:gIN9vFwOqvQ" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheDoLoop?a=YKzBBaf1GlE:8dGRcSHDmoE:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/TheDoLoop?i=YKzBBaf1GlE:8dGRcSHDmoE:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheDoLoop?a=YKzBBaf1GlE:8dGRcSHDmoE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/TheDoLoop?i=YKzBBaf1GlE:8dGRcSHDmoE:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheDoLoop?a=YKzBBaf1GlE:8dGRcSHDmoE:l6gmwiTKsz0"><img src="http://feeds.feedburner.com/~ff/TheDoLoop?d=l6gmwiTKsz0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/TheDoLoop?a=YKzBBaf1GlE:8dGRcSHDmoE:TzevzKxY174"><img src="http://feeds.feedburner.com/~ff/TheDoLoop?d=TzevzKxY174" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/TheDoLoop/~4/YKzBBaf1GlE" height="1" width="1"/>
<p class="syndicated-attribution"><br />
<br />
<font color=#8c1717><b>Please comment on the article here:</b></font> <a href="http://feedproxy.google.com/~r/TheDoLoop/~3/YKzBBaf1GlE/"><b>The DO Loop</b></a>
<br />
<br /></p><p>The post <a href="http://www.statsblogs.com/2013/05/24/turn-off-ods-when-running-simulations-in-sas/">Turn off ODS when running simulations in SAS</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p><img src="http://feeds.feedburner.com/~r/statsblogs/~4/rR5Oe8jYCIk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.statsblogs.com/2013/05/24/turn-off-ods-when-running-simulations-in-sas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.statsblogs.com/2013/05/24/turn-off-ods-when-running-simulations-in-sas/</feedburner:origLink></item>
		<item>
		<title>Simpson gets married (and divorced?)</title>
		<link>http://feedproxy.google.com/~r/statsblogs/~3/FVf2g9Kp8vw/</link>
		<comments>http://www.statsblogs.com/2013/05/24/simpson-gets-married-and-divorced/#comments</comments>
		<pubDate>Fri, 24 May 2013 08:38:00 +0000</pubDate>
		<dc:creator>Gianluca Baio</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Causal Inference]]></category>

		<guid isPermaLink="false">http://www.statsblogs.com/?guid=3df28a6f647bf0971fb8636e4d96a87d</guid>
		<description><![CDATA[<p>While I was waiting for my coffee this morning, I flipped through the newspapers on one of the tables in my local coffee place when my eye got caught by this article in The Times&#160;(I think to see the full article you need a subscription $-$ which I...</p><p>The post <a href="http://www.statsblogs.com/2013/05/24/simpson-gets-married-and-divorced/">Simpson gets married (and divorced?)</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution">(This article was originally published at <a href="http://gianlubaio.blogspot.com/">Gianluca Baio's blog</a>, and syndicated at <a href="http://www.statsblogs.com">StatsBlogs</a>.)
<br /></p>
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-jRB-l4H4cJA/UZ8daKLP4KI/AAAAAAAAA0w/x5wFU91gwo4/s1600/images.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="236" src="http://3.bp.blogspot.com/-jRB-l4H4cJA/UZ8daKLP4KI/AAAAAAAAA0w/x5wFU91gwo4/s320/images.jpg" width="320" /></a></div><span style="font-family: 'Trebuchet MS', sans-serif;">While I was waiting for my coffee this morning, I flipped through the newspapers on one of the tables in my local coffee place when my eye got caught by this article in </span><a href="http://www.thetimes.co.uk/tto/life/relationships/article3773487.ece" style="font-family: 'Trebuchet MS', sans-serif;" >The Times</a><span style="font-family: 'Trebuchet MS', sans-serif;">&nbsp;(I think to see the full article you need a subscription $-$ which I don't have on principle grounds. But you can access the actual report even if you don't subscribe to Murdoch's flagship newspaper).</span><br /><span style="font-family: Trebuchet MS, sans-serif;"><br /></span><span style="font-family: Trebuchet MS, sans-serif;">The news is that "<i>Most children from broken homes had unwed parents</i>" and the evidence comes from a recent report published by <i>The Marriage Foundation</i>.&nbsp;</span><br /><span style="font-family: Trebuchet MS, sans-serif;"><br /></span><span style="font-family: Trebuchet MS, sans-serif;">The report,&nbsp;</span><span style="font-family: 'Trebuchet MS', sans-serif;">based on data from&nbsp;</span><a href="https://www.understandingsociety.ac.uk/" style="font-family: 'Trebuchet MS', sans-serif;" >Understanding Society</a><span style="font-family: Trebuchet MS, sans-serif;">&nbsp;(US)</span><span style="font-family: 'Trebuchet MS', sans-serif;">, the&nbsp;</span><a href="http://www.esrc.ac.uk/" style="font-family: 'Trebuchet MS', sans-serif;" >ESRC</a><span style="font-family: 'Trebuchet MS', sans-serif;">&nbsp;longitudinal survey of British households,</span><span style="font-family: 'Trebuchet MS', sans-serif;">&nbsp;says that:&nbsp;</span><br /><span style="font-family: Trebuchet MS, sans-serif;">&nbsp; 1)&nbsp;</span><span style="font-family: 'Trebuchet MS', sans-serif;">45% of young teenagers (13-15 years old) are not living with both parents;</span><br /><span style="font-family: 'Trebuchet MS', sans-serif;">&nbsp; 2) Half of all family breakdown takes place during the first two years;</span><br /><span style="font-family: 'Trebuchet MS', sans-serif;">&nbsp; 3) Amongst parents who remain intact, 93% are married.</span><br /><span style="font-family: 'Trebuchet MS', sans-serif;"><br /></span><span style="font-family: Trebuchet MS, sans-serif;">Now: I can see that there might be something going on and that it <b>may be</b> more likely that married couple remain intact longer (although I think one should bare in mind that, as reported <a href="http://www.ons.gov.uk/ons/rel/vsob1/divorces-in-england-and-wales/2011/stb-divorces-2011.html" >here</a>, "<i>Based on marriage, divorce and mortality statistics for 2010, it is estimated that the percentage of marriages ending in divorce </i>[in the UK]<i> is 42%</i>").</span><br /><span style="font-family: Trebuchet MS, sans-serif;"><br /></span><span style="font-family: Trebuchet MS, sans-serif;">But surely this average 93% figure will possibly suffer strongly from <a href="http://en.wikipedia.org/wiki/Simpson's_paradox‎" >Simpson's paradox</a>, <i>ie </i>it is highly sensitive to conditioning&nbsp;on some other covariates (which are not considered here $-$ <i><b>NB</b>: that's not to say that US doesn't account for them; just that the report didn't bother considering them</i>).</span><br /><span style="font-family: Trebuchet MS, sans-serif;"><br /></span><span style="font-family: Trebuchet MS, sans-serif;">For example, kids who happen to become pregnant when they are 16 and are not in a stable relationship may well be at a high risk of breaking up within two years of the child being born. And probably, if they do get married as a result of the unwanted pregnancy, they may contribute highly to the proportion of divorces.&nbsp;</span><span style="font-family: 'Trebuchet MS', sans-serif;">But this doesn't necessarily apply to thirty-something who have been in a stable relationship for a few years before deciding to have kids, while for some reason not getting married! Because these various categories are likely to not be uniformly distributed in the underlying population, one should weight for their relative frequency when giving a population summary.</span><br /><span style="font-family: 'Trebuchet MS', sans-serif;"><br /></span><span style="font-family: 'Trebuchet MS', sans-serif;">Another interesting passage from the report says: "</span><span style="font-family: 'Trebuchet MS', sans-serif;"><i>... provides further evidence that the trend away from marriage is the driving force behind family breakdown. Out of 47% of children born to unmarried parents today, the model predicts that just 11% will reach their 16th birthday with both parents intact and unmarried. <b>The rest will either marry</b> or split up</i>".</span><br /><span style="font-family: 'Trebuchet MS', sans-serif;"><br /></span><span style="font-family: 'Trebuchet MS', sans-serif;">So, it seems to me, the evidence provided is rather quite weak: what if all of the rest actually got married? Should we then blame marriage for breaking up those families? (<b>Of course</b>, that's just an extreme case, which is unlikely to happen. But the report conveniently fails to give the distribution of "the rest" and, it seems to me, makes some unwarranted inference from the data).</span>
<p class="syndicated-attribution"><br />
<br />
<font color=#8c1717><b>Please comment on the article here:</b></font> <a href="http://gianlubaio.blogspot.com/2013/05/simpson-gets-married-and-divorced.html"><b>Gianluca Baio's blog</b></a>
<br />
<br /></p><p>The post <a href="http://www.statsblogs.com/2013/05/24/simpson-gets-married-and-divorced/">Simpson gets married (and divorced?)</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p><img src="http://feeds.feedburner.com/~r/statsblogs/~4/FVf2g9Kp8vw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.statsblogs.com/2013/05/24/simpson-gets-married-and-divorced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="" type="" />
		<feedburner:origLink>http://www.statsblogs.com/2013/05/24/simpson-gets-married-and-divorced/</feedburner:origLink></item>
		<item>
		<title>Generating a Markov chain vs. computing the transition matrix</title>
		<link>http://feedproxy.google.com/~r/statsblogs/~3/BoN_An6cLAw/</link>
		<comments>http://www.statsblogs.com/2013/05/23/generating-a-markov-chain-vs-computing-the-transition-matrix/#comments</comments>
		<pubDate>Thu, 23 May 2013 14:27:53 +0000</pubDate>
		<dc:creator>Arthur Charpentier</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[algebra]]></category>
		<category><![CDATA[chain]]></category>
		<category><![CDATA[Markov]]></category>
		<category><![CDATA[mathematics]]></category>
		<category><![CDATA[matrix()]]></category>
		<category><![CDATA[Numeric]]></category>
		<category><![CDATA[probability]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[R-english]]></category>
		<category><![CDATA[randomness]]></category>
		<category><![CDATA[stepping stone]]></category>
		<category><![CDATA[time series]]></category>
		<category><![CDATA[transition]]></category>

		<guid isPermaLink="false">http://freakonometrics.hypotheses.org/?p=6803</guid>
		<description><![CDATA[<p>A couple of days ago, we had a quick chat on Karl Broman&#8216;s blog, about snakes and ladders (see http://kbroman.wordpress.com/&#8230;) with Karl and Corey (see http://bayesianbiologist.com/&#8230;.), and the use of Markov Chain. I do believe that this application is truly awesome: the example is understandable by anyone, and computations (almost any kind, from what we&#8217;ve tried) are easy to perform. At the same time, some French students asked me specific details regarding some old lectures notes on Markov chains, and on some introductory example I used as a [...]</p><p>The post <a href="http://www.statsblogs.com/2013/05/23/generating-a-markov-chain-vs-computing-the-transition-matrix/">Generating a Markov chain vs. computing the transition matrix</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution">(This article was originally published at <a href="http://freakonometrics.hypotheses.org">Freakonometrics » Statistics</a>, and syndicated at <a href="http://www.statsblogs.com">StatsBlogs</a>.)
<br /></p>
<p>A couple of days ago, we had a quick chat on <a href="http://kbroman.wordpress.com/">Karl Broman</a>&#8216;s blog, about snakes and ladders (see <a href="http://kbroman.wordpress.com/2013/05/17/chutes-ladders-how-long-is-this-going-to-take/">http://kbroman.wordpress.com/&#8230;</a>) with Karl and Corey (see <a href="http://bayesianbiologist.com/2011/12/31/uncertainty-in-markov-chains-fun-with-snakes-and-ladders/">http://bayesianbiologist.com/&#8230;.</a>), and the use of Markov Chain. I do believe that this application is truly awesome: the example is understandable by anyone, and computations (almost any kind, from what we&#8217;ve tried) are easy to perform. At the same time, some French students asked me specific details regarding some old <a href="http://perso.univ-rennes1.fr/arthur.charpentier/Markov.pdf">lectures notes</a> on Markov chains, and on some introductory example I used as a possible motivation: the <em>stepping stone</em> algorithm. In the notes, I just mentioned the idea of this popular generic algorithm (introduced in <a href="http://projecteuclid.org/DPubS?service=UI&amp;version=1.0&amp;verb=Display&amp;handle=euclid.aop/1176995980">Sawyer (1976)</a>) and I use simulations to show - visually - how it works. Again, it was just to motivate the course which actually did focus on the theory of Markov Chains. But those student wanted more, like how did I get the transition matrix, for instance. And that is actually not a simple question, from a computational perspective. I mean, I can easily <em>generate</em> this Markov Chain, but writing explicitly the transition, that was another story. Which took me a bit longer. In a very specific case&#8230;</p>
<p>But let us get back to the roots, and to the <em><strong>stepping stone</strong> </em>algorithm. At least, one of them (the one I used in my notes) because it looks like there are several algorithm. We do consider a grid, say <img alt="" src="http://latex.codecogs.com/gif.latex?h%5Ctimes%20h" />, with some colors inside, say <img alt="" src="http://latex.codecogs.com/gif.latex?k" /> possible colors. Each cell of the grid has a given color. Then, at some stage, we select randomly one cell in the grid, and it will take the color of one of its neighbor (some kind of absorption, or mutation). This is, more or less, what is also detailed in some lecture <a href="http://faculty.uml.edu/jpropp/584/Lec03.pdf">notes</a> by <a href="http://faculty.uml.edu/jpropp/">James Propp</a> (see also e <a href="http://www.jstor.org/discover/10.2307/3213884?uid=3739464&amp;uid=2129&amp;uid=2&amp;uid=70&amp;uid=3737720&amp;uid=4&amp;sid=21102033903473">Sato (1983)</a> or <a href="http://www.math.duke.edu/~rtd/SS/ZCD.pdf">Zähle <em>et al. </em>(2005)</a> for more theoretical details about that Markov chain). This is extremely simple to generate (that&#8217;s what I did in my notes, with very big grids, and a lot of colors). But what if we want to <em>write</em> the transition matrix ?</p>
<p>First of all, we need to define the state space. Basically, we do have <img alt="" src="http://latex.codecogs.com/gif.latex?h%5E2" /> cells, each of them has one color, chosen among <img alt="" src="http://latex.codecogs.com/gif.latex?k" />. Which gives us <img alt="" src="http://latex.codecogs.com/gif.latex?k%5E%7Bh%5E2%7D" /> possible states&#8230;. And that can be large. I mean, if we consider the smallest possible grid (that might be interesting), say <img alt="" src="http://latex.codecogs.com/gif.latex?h=3" />, and only <img alt="" src="http://latex.codecogs.com/gif.latex?2" /> colors, then we talk about <img alt="" src="http://latex.codecogs.com/gif.latex?2%5E9=512" />possible states. That is large, not huge. But we should keep in mind that we have to compute a transition matrix, that would be a matrix with <img alt="" src="http://latex.codecogs.com/gif.latex?512%5Ctimes%20512=262,144" /> elements. More generally, we talk about writing down matrices with <img alt="" src="http://latex.codecogs.com/gif.latex?k%5E%7B2%5Ccdot%20h%5E2%7D" /> elements. If we want black and white <img alt="" src="http://latex.codecogs.com/gif.latex?4%5Ctimes%204" /> grids, that would mean a matrix with <img alt="" src="http://latex.codecogs.com/gif.latex?2%5E%7B2%5Ccdot%204%5E2%7D=2%5E%7B32%7D=4,294,967,296" /> which mean 4 billion elements ! And if we consider an red-green-blue <img alt="" src="http://latex.codecogs.com/gif.latex?3%5Ctimes%203" /> grid, we have to explicit a matrix with <img alt="" src="http://latex.codecogs.com/gif.latex?387,420,489" /> i.e almost 400 million elements. So, let&#8217;s face it: we can only work with <img alt="" src="http://latex.codecogs.com/gif.latex?3%5Ctimes%203" /> bi-color grids.</p>
<p>So let&#8217;s try&#8230; The good thing is that it can be related to work I&#8217;ve been doing recently on <a href="http://freakonometrics.hypotheses.org/6026">binomial recombining trees </a>(binomial being related to bi-color). First of all, our grid will be describes as follows</p>
<pre>&gt; h=3
&gt; M=matrix(1:(h^2),h,h)
&gt; M
     [,1] [,2] [,3]
[1,]    1    4    7
[2,]    2    5    8
[3,]    3    6    9</pre>
<p>with two colors</p>
<pre>&gt; color=c("red","blue")</pre>
<p>Then, we should look for neighbors, or derive an neighborhood matrix,</p>
<pre>&gt; d=function(i,j) dist(rbind(c((i-1)%/%h,(i-1)%%h),
+                            c((j-1)%/%h,(j-1)%%h)))
&gt; Neighb=matrix(Vectorize(d)(rep(1:(h^2),each=h^2),
+                            rep(1:(h^2),h^2)),h^2,h^2)
&gt; trunc(Neighb*100)/100
      [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9]
 [1,] 0.00 1.00 2.00 1.00 1.41 2.23 2.00 2.23 2.82
 [2,] 1.00 0.00 1.00 1.41 1.00 1.41 2.23 2.00 2.23
 [3,] 2.00 1.00 0.00 2.23 1.41 1.00 2.82 2.23 2.00
 [4,] 1.00 1.41 2.23 0.00 1.00 2.00 1.00 1.41 2.23
 [5,] 1.41 1.00 1.41 1.00 0.00 1.00 1.41 1.00 1.41
 [6,] 2.23 1.41 1.00 2.00 1.00 0.00 2.23 1.41 1.00
 [7,] 2.00 2.23 2.82 1.00 1.41 2.23 0.00 1.00 2.00
 [8,] 2.23 2.00 2.23 1.41 1.00 1.41 1.00 0.00 1.00
 [9,] 2.82 2.23 2.00 2.23 1.41 1.00 2.00 1.00 0.00
&gt; Neighb=(Neighb&lt;2)&amp;(Neighb&gt;0)
&gt; Neighb
       [,1]  [,2]  [,3]  [,4]  [,5]  [,6]  [,7]  [,8]  [,9]
 [1,] FALSE  TRUE FALSE  TRUE  TRUE FALSE FALSE FALSE FALSE
 [2,]  TRUE FALSE  TRUE  TRUE  TRUE  TRUE FALSE FALSE FALSE
 [3,] FALSE  TRUE FALSE FALSE  TRUE  TRUE FALSE FALSE FALSE
 [4,]  TRUE  TRUE FALSE FALSE  TRUE FALSE  TRUE  TRUE FALSE
 [5,]  TRUE  TRUE  TRUE  TRUE FALSE  TRUE  TRUE  TRUE  TRUE
 [6,] FALSE  TRUE  TRUE FALSE  TRUE FALSE FALSE  TRUE  TRUE
 [7,] FALSE FALSE FALSE  TRUE  TRUE FALSE FALSE  TRUE FALSE
 [8,] FALSE FALSE FALSE  TRUE  TRUE  TRUE  TRUE FALSE  TRUE
 [9,] FALSE FALSE FALSE FALSE  TRUE  TRUE FALSE  TRUE FALSE</pre>
<p>Now, let us explicit our 512 possible states.</p>
<pre>&gt; n=h^2
&gt; states=function(x){
+   Base.b=rep(0,n)
+   ndigits=(floor(logb(x,base=length(color)))+1)
+   for(i in 1:ndigits){
+     Base.b[n-i+1]=(x%%length(color))
+     x=(x %/% length(color))}
+   return(Base.b)}
&gt; M=Vectorize(states)(1:(length(color)^n-1))
&gt; liststates=data.frame(rbind(rep(0,h^2),t(M)))
&gt; head(liststates)
  X1 X2 X3 X4 X5 X6 X7 X8 X9
1  0  0  0  0  0  0  0  0  0
2  0  0  0  0  0  0  0  0  1
3  0  0  0  0  0  0  0  1  0
4  0  0  0  0  0  0  0  1  1
5  0  0  0  0  0  0  1  0  0
6  0  0  0  0  0  0  1  0  1</pre>
<p>(for the first six, with 0/1 digits instead of colors). For instance, if we look at a specific one, it is possible to plot the grid, using</p>
<pre>&gt; plotsteps=function(u){
+   plot(0:h,0:h,col="white",xlab="",ylab="",axes=FALSE)
+   for(i in 0:(h^2-1)){
+   x=i%/%h
+   y=i%%h
+   polygon(x+c(1,.1,.1,1),y+c(1,1,.1,.1),
+   col=color[as.numeric(u)[i+1] + 1])
+   text(x+.45,y+.45,i)
+   }}</pre>
<p><img class="alignright" alt="" src="http://f.hypotheses.org/wp-content/blogs.dir/253/files/2013/05/step-stone-1.png" width="180" height="179" />Here,</p>
<pre>&gt; plotsteps(liststates[100,])</pre>
<p>Then, given one state, let us see what could happen next,</p>
<ul>
<li><span style="line-height: 13px">let us compute all connected states: all states where we can end up in if we change one cell</span></li>
<li>we have to check, for each connect state which cell did change</li>
<li>we should compute probabilities to reach those 9 states, based on the fact that each of the cell is chosen with the same probability, and the fact that probability to <em>change</em> the color is based on the colors around.</li>
<li>if some states cannot be reached (if a cell is surrounded by elements of the same color, so it cannot change its color), then, we should remove then from the list of reachable (possible) states.</li>
</ul>
<p>The code will be something like the following</p>
<pre>&gt; listneighbour=function(i){
+   start=liststates[i,]
+   difference2only=function(j) {
+     w=which(liststates[j,]!=liststates[i,])
+     return((length(w)==1))}
+   possible=which( Vectorize(difference2only)(1:nrow(liststates))==TRUE )
+   P=function(j){   
+     L=liststates[i,which(Neighb[which(liststates[j,]!=liststates[i,]),]==TRUE)]
+     T=table(as.numeric(L))
+     T=T[as.character(0:(length(color)-1))]
+     T[is.na(T)]=0
+     return(as.numeric(T)/sum(T))
+   }
+   probability=Vectorize(P)(possible)
+   W=NULL
+   for(j in possible) W=c(W,which(liststates[j,]!=liststates[i,]))
+   I=1-liststates[i,W]+1
+   vp=diag(probability[as.numeric(I),])
+   vproba=0*vp
+   if(sum(vp)!=0) vproba=vp/sum(vp)
+   return(list(
+     color=liststates[i,W],
+     absorb=W,
+     possible=possible,
+     probability=probability,
+     prob=vproba))
+ }</pre>
<p><img class="alignright" alt="" src="http://f.hypotheses.org/wp-content/blogs.dir/253/files/2013/05/step-stone-1.png" width="180" height="179" />For instance, if we start from state 100 (here, on the right)</p>
<pre>&gt; listneighbour(100)
$color
    X3 X4 X8 X9 X7 X6 X5 X2 X1
100  1  1  1  1  0  0  0  0  0

$absorb
[1] 3 4 8 9 7 6 5 2 1

$possible
[1]  36  68  98  99 104 108 116 228 356

$probability
     [,1] [,2] [,3]   [,4]   [,5] [,6] [,7] [,8]   [,9]
[1,]    1  0.8  0.6 0.6667 0.3333  0.4  0.5  0.6 0.6667
[2,]    0  0.2  0.4 0.3333 0.6667  0.6  0.5  0.4 0.3333

$prob
[1] 0.17964072 0.14371257 0.10778443 0.11976048 0.11976048
[6] 0.10778443 0.08982036 0.07185629 0.05988024</pre>
<p><img class="alignright" alt="" src="http://f.hypotheses.org/wp-content/blogs.dir/253/files/2013/05/step-stone-2.png" width="176" height="176" />Let us look more specificaly at the 99th state (which appears above as a state that could be reached from the 100th),</p>
<pre>&gt; liststates[99,]
   X1 X2 X3 X4 X5 X6 X7 X8 X9
99  0  0  1  1  0  0  0  1  0</pre>
<p>If we plot it (here on the right, again), we get</p>
<pre>&gt; plotsteps(liststates[99,])</pre>
<p>Clearly, here, the cell in the upper corner (number 9) changed from blue to red. Now, about the probability&#8230; The probability to select cell 9 is 1/9, and given that cell 9 is chosen, the probability to go from blue to red is 2/3 (the cell is surrounded by 2 red cells, and 1 blue cell). The probability to remain blue is then 1/3. Those are the probabilities computed by our function (the table with two rows, one per color). In order to get a better understanding on the meaning of the last line, with some sort of probabilities), let us look at the following (simpler) example.</p>
<pre>&gt; liststates[2,]
  X1 X2 X3 X4 X5 X6 X7 X8 X9
2  0  0  0  0  0  0  0  0  1</pre>
<p><img class="alignright" alt="" src="http://f.hypotheses.org/wp-content/blogs.dir/253/files/2013/05/stone3.png" width="185" height="175" />that can be visualized on the right (on the right). Here,</p>
<pre>&gt; listneighbour(2)
$color
  X9 X8 X7 X6 X5 X4 X3 X2 X1
2  1  0  0  0  0  0  0  0  0

$absorb
[1] 9 8 7 6 5 4 3 2 1

$possible
[1]   1   4   6  10  18  34  66 130 258

$probability
     [,1] [,2] [,3] [,4]  [,5] [,6] [,7] [,8] [,9]
[1,]    1  0.8    1  0.8 0.875    1    1    1    1
[2,]    0  0.2    0  0.2 0.125    0    0    0    0

$prob
[1] 0.65573770 0.13114754 0.00000000 0.13114754 0.08196721 
[6] 0.00000000 0.00000000 0.00000000 0.00000000</pre>
<p>Things are pretty simple here</p>
<ul>
<li>if we chose cells <img alt="http://latex.codecogs.com/gif.latex%20?\{1,2,3,4,7\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B1,2,3,4,7%5C%7D" />, then nothing change, since all the neighbors have the same color. So if we <em>want</em> to focus on changes (or say run the algorithm until the first color change, then choosing those cells is a waste of time)</li>
<li>if we chose cells <img alt="http://latex.codecogs.com/gif.latex%20?\{5,6,8\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B5,6,8%5C%7D" />, then it could be possible to change the color. And actually, <img alt="http://latex.codecogs.com/gif.latex%20?\{5\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B5%5C%7D" /> is different from <img alt="http://latex.codecogs.com/gif.latex%20?\{6,8\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B6,8%5C%7D" /> (since it does have much more neighbors)</li>
<li>if we chose cell <img alt="http://latex.codecogs.com/gif.latex%20?\{9\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B9%5C%7D" />, then definitively, the color will change, since all neighbors have the other color here,</li>
</ul>
<p>Now, the probability to select cell <img alt="" src="http://latex.codecogs.com/gif.latex?k" /> <em>given that there was a color change</em> would be, if <img alt="" src="http://latex.codecogs.com/gif.latex?k" /> is in <img alt="http://latex.codecogs.com/gif.latex%20?\{9\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B9%5C%7D" /></p>
<p><img class="aligncenter" alt="http://latex.codecogs.com/gif.latex%20?\mathbb{P}(k)\propto%20\frac{3}{3}=1" src="http://latex.codecogs.com/gif.latex%20?%5Cmathbb%7BP%7D%28k%29%5Cpropto%20%5Cfrac%7B3%7D%7B3%7D=1" /></p>
<p>while if <img alt="" src="http://latex.codecogs.com/gif.latex?k" /> is in <img alt="http://latex.codecogs.com/gif.latex%20?\{6,8\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B6,8%5C%7D" />, then there are 4 out 5 neighbors that are red, so</p>
<p><img class="aligncenter" alt="http://latex.codecogs.com/gif.latex%20?\mathbb{P}(k)\propto%20\frac{1}{5}" src="http://latex.codecogs.com/gif.latex%20?%5Cmathbb%7BP%7D%28k%29%5Cpropto%20%5Cfrac%7B1%7D%7B5%7D" />and if <img alt="" src="http://latex.codecogs.com/gif.latex?k" /> is <img alt="http://latex.codecogs.com/gif.latex%20?\{5\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B5%5C%7D" />, then, only one neighbor has a different color, out of 8, so</p>
<p><img class="aligncenter" alt="http://latex.codecogs.com/gif.latex%20?\mathbb{P}(k)\propto%20\frac{1}{8}" src="http://latex.codecogs.com/gif.latex%20?%5Cmathbb%7BP%7D%28k%29%5Cpropto%20%5Cfrac%7B1%7D%7B8%7D" /></p>
<p>And for the other, <img alt="http://latex.codecogs.com/gif.latex%20?\mathbb{P}(k)\propto%200" src="http://latex.codecogs.com/gif.latex%20?%5Cmathbb%7BP%7D%28k%29%5Cpropto%200" />. So, it comes &#8211; since we assume that cells are drawn independently, and <em>with the same probability</em>, if <img alt="" src="http://latex.codecogs.com/gif.latex?k" /> is in <img alt="http://latex.codecogs.com/gif.latex%20?\{9\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B9%5C%7D" /></p>
<p><img class="aligncenter" alt="http://latex.codecogs.com/gif.latex%20?\mathbb{P}(k)=%20\frac{1%20\cdot%20\frac{1}{9}}{\left(1+2\times%20\frac{1}{5}+%20\frac{1}{8}+5\times%200\right)\cdot%20\frac{1}{9}}=\frac{40}{61}" src="http://latex.codecogs.com/gif.latex%20?%5Cmathbb%7BP%7D%28k%29=%20%5Cfrac%7B1%20%5Ccdot%20%5Cfrac%7B1%7D%7B9%7D%7D%7B%5Cleft%281+2%5Ctimes%20%5Cfrac%7B1%7D%7B5%7D+%20%5Cfrac%7B1%7D%7B8%7D+5%5Ctimes%200%5Cright%29%5Ccdot%20%5Cfrac%7B1%7D%7B9%7D%7D=%5Cfrac%7B40%7D%7B61%7D" /></p>
<p>while if <img alt="" src="http://latex.codecogs.com/gif.latex?k" /> is in <img alt="http://latex.codecogs.com/gif.latex%20?\{6,8\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B6,8%5C%7D" />, then there are 4 out 5 neighbors that are red, so</p>
<p><img class="aligncenter" alt="http://latex.codecogs.com/gif.latex%20?\mathbb{P}(k)=%20\frac{\frac{1}{5}%20\cdot%20\frac{1}{9}}{\left(1+2\times%20\frac{1}{5}+%20\frac{1}{8}+5\times%200\right)\cdot%20\frac{1}{9}}=\frac{8}{61}" src="http://latex.codecogs.com/gif.latex%20?%5Cmathbb%7BP%7D%28k%29=%20%5Cfrac%7B%5Cfrac%7B1%7D%7B5%7D%20%5Ccdot%20%5Cfrac%7B1%7D%7B9%7D%7D%7B%5Cleft%281+2%5Ctimes%20%5Cfrac%7B1%7D%7B5%7D+%20%5Cfrac%7B1%7D%7B8%7D+5%5Ctimes%200%5Cright%29%5Ccdot%20%5Cfrac%7B1%7D%7B9%7D%7D=%5Cfrac%7B8%7D%7B61%7D" /></p>
<p>and if <img alt="" src="http://latex.codecogs.com/gif.latex?k" /> is <img alt="http://latex.codecogs.com/gif.latex%20?\{5\}" src="http://latex.codecogs.com/gif.latex%20?%5C%7B5%5C%7D" />, then, only one neighbor has a different color, out of 8, so</p>
<p><img class="aligncenter" alt="http://latex.codecogs.com/gif.latex%20?\mathbb{P}(k)=%20\frac{\frac{1}{8}%20\cdot%20\frac{1}{9}}{\left(1+2\times%20\frac{1}{5}+%20\frac{1}{8}+5\times%200\right)\cdot%20\frac{1}{9}}=\frac{5}{61}" src="http://latex.codecogs.com/gif.latex%20?%5Cmathbb%7BP%7D%28k%29=%20%5Cfrac%7B%5Cfrac%7B1%7D%7B8%7D%20%5Ccdot%20%5Cfrac%7B1%7D%7B9%7D%7D%7B%5Cleft%281+2%5Ctimes%20%5Cfrac%7B1%7D%7B5%7D+%20%5Cfrac%7B1%7D%7B8%7D+5%5Ctimes%200%5Cright%29%5Ccdot%20%5Cfrac%7B1%7D%7B9%7D%7D=%5Cfrac%7B5%7D%7B61%7D" /></p>
<p>Which are exactly the probability computed above. The point is that we compute probabilities <em>given that a color change will actually occur</em>. The good point is that it should faster convergence to some limiting distribution. If any.</p>
<p>What about our transition matrix ? Well, using a simply loop, we should get it easily</p>
<pre>&gt; M=matrix(0,nrow(liststates),nrow(liststates))
+ for(i in 1:nrow(liststates)){
+ L=listneighbour(i)
+ if(sum(L$prob)!=0){
+ j=L$possible
+ M[i,j]=L$prob
+ }
+ if(sum(L$prob)==0){
+ j=i
+ M[i,j]=1
+ }
+ }</pre>
<p>One can check that this matrix satisfies some properties of transition matrices. For instance, the sum per row is one,</p>
<pre>&gt; sum(apply(M,1,sum)!=1)
[1]  0</pre>
<p>Remember that this matrix is big, so I will not print if here. But trust me, it works (it might take a while on an old laptop, but anyone can do it). Now, if we want to visualize some paths of that chain, we can use the following algorithm. First, we need a starting point, that can be chosen randomly,</p>
<pre>&gt; j=sample(1:nrow(liststates),size=1)</pre>
<p>or using a given colored grid, say</p>
<pre>&gt; j=100</pre>
<p>Then we plot it,</p>
<pre>&gt; plotsteps(liststates[j,])</pre>
<p>Now, the code within the loop is here</p>
<pre>&gt; d=rep(0,nrow(liststates))
&gt; d[j]=1
&gt; d=d%*%M
&gt; j=sample(1:nrow(M),size=1,prob=d)
&gt; plotsteps(liststates[j,])</pre>
<p>Here are some examples. And indeed, we end up either with all cells in blue, or all cells in red.</p>
<table width="458" border="0" cellspacing="3" cellpadding="3">
<tbody>
<tr>
<td>
<p id="thumbnail-head-6856"><img alt="" src="http://f.hypotheses.org/wp-content/blogs.dir/253/files/2013/05/gif-step2.gif" width="281" height="281" /></p>
</td>
<td>
<p id="thumbnail-head-6857"><img alt="" src="http://f.hypotheses.org/wp-content/blogs.dir/253/files/2013/05/gif-step1.gif" width="281" height="281" /></p>
</td>
</tr>
</tbody>
</table>
<table width="458" border="0" cellspacing="3" cellpadding="3">
<tbody>
<tr>
<td>
<div>
<div id="media-head-6855">
<p id="thumbnail-head-6855"><img alt="" src="http://f.hypotheses.org/wp-content/blogs.dir/253/files/2013/05/gif-step3.gif" width="281" height="281" /></p>
</div>
</div>
</td>
<td>
<div>
<div id="media-head-6854">
<div>
<div id="media-head-6859">
<p id="thumbnail-head-6859"><img alt="" src="http://f.hypotheses.org/wp-content/blogs.dir/253/files/2013/05/gif-step5.gif" width="281" height="281" /></p>
</div>
</div>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<p>Now, do we <em>have</em> <em>to</em> compute that transition matrix to produce those graph (and to generate that Markov chain) ? No. Of course not&#8230; At each step, I use a Dirac measure, and use the transition matrix just to get the probability to generate then the next state. Actually, one can write a faster and more intuitive code to generate the same chain&#8230; But I should probably keep that for another post&#8230;</p>
<div class="wp-about-author-containter-top" style="background-color:#FFEAA8;"><div class="wp-about-author-pic"><img alt='' src='http://0.gravatar.com/avatar/e7fe817c8d1762377389370c48be8024?s=100&amp;d=&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-about-author-text"><h3><a href='http://freakonometrics.hypotheses.org/author/freakonometrics' title='Arthur Charpentier'>Arthur Charpentier</a></h3><p>Arthur Charpentier, professor in Montréal, in Actuarial Science. Former professor-assistant at <a href="http://www.ensae.fr/">ENSAE Paristech</a>, associate professor at <a href="http://www.polytechnique.edu/">Ecole Polytechnique</a> and assistant professor in Economics at <a href="http://www.univ-rennes1.fr/">Université de Rennes 1</a>.  Graduated from <a href="http://www.ensae.fr/">ENSAE</a>, Master in Mathematical Economics (<a href="http://www.mastermasef.org/">Paris Dauphine</a>), PhD in Mathematics (<a href="http://www.kuleuven.be/kuleuven/">KU Leuven</a>), and Fellow of the French <a href="http://www.institutdesactuaires.com//">Institute of Actuaries</a>.</p><p><a href='http://freakonometrics.hypotheses.org/author/freakonometrics' title='More posts by Arthur Charpentier'>More Posts</a>  - <a href='http://freakonometrics.hypotheses.org/' title='Arthur Charpentier'>Website</a> </p><p class="wpa-nomargin">Follow Me:<br /><a class='wpa-social-icons' href='http://www.twitter.com/freakonometrics'><img src='http://f.hypotheses.org/wp-content/plugins/wp-about-author//images/twitter.png' alt='Twitter'/></a><a class='wpa-social-icons' href='http://www.linkedin.com/in/arthurcharpentier'><img src='http://f.hypotheses.org/wp-content/plugins/wp-about-author//images/linkedin.png' alt='LinkedIn'/></a><a class='wpa-social-icons' href='https://plus.google.com/105552119226087107211'><img src='http://f.hypotheses.org/wp-content/plugins/wp-about-author//images/googleplus.png' alt='Google Plus'/></a></p></div></div>
<p class="syndicated-attribution"><br />
<br />
<font color=#8c1717><b>Please comment on the article here:</b></font> <a href="http://freakonometrics.hypotheses.org/6803"><b>Freakonometrics » Statistics</b></a>
<br />
<br /></p><p>The post <a href="http://www.statsblogs.com/2013/05/23/generating-a-markov-chain-vs-computing-the-transition-matrix/">Generating a Markov chain vs. computing the transition matrix</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p><img src="http://feeds.feedburner.com/~r/statsblogs/~4/BoN_An6cLAw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.statsblogs.com/2013/05/23/generating-a-markov-chain-vs-computing-the-transition-matrix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.statsblogs.com/2013/05/23/generating-a-markov-chain-vs-computing-the-transition-matrix/</feedburner:origLink></item>
		<item>
		<title>Validation of Software for Bayesian Models Using Posterior Quantiles</title>
		<link>http://feedproxy.google.com/~r/statsblogs/~3/rM2ydBMObJE/</link>
		<comments>http://www.statsblogs.com/2013/05/23/validation-of-software-for-bayesian-models-using-posterior-quantiles/#comments</comments>
		<pubDate>Thu, 23 May 2013 13:41:26 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Bayesian statistics]]></category>
		<category><![CDATA[STAN]]></category>
		<category><![CDATA[Statistical computing]]></category>

		<guid isPermaLink="false">http://andrewgelman.com/?p=18572</guid>
		<description><![CDATA[<p><p>Every once in awhile I get a question that I can directly answer from my published research. When that happens it makes me so happy. Here&#8217;s an example. Patrick Lam wrote, Suppose one develops a Bayesian model to estimate a parameter theta. Now suppose one wants to evaluate the model via simulation by generating fake [...]</p><p>The post <a href="http://andrewgelman.com/2013/05/23/validation-of-software-for-bayesian-models-using-posterior-quantiles-2/">Validation of Software for Bayesian Models Using Posterior Quantiles</a> appeared first on <a href="http://andrewgelman.com">Statistical Modeling, Causal Inference, and Social Science</a>.</p></p><p>The post <a href="http://www.statsblogs.com/2013/05/23/validation-of-software-for-bayesian-models-using-posterior-quantiles/">Validation of Software for Bayesian Models Using Posterior Quantiles</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution">(This article was originally published at <a href="http://andrewgelman.com">Statistical Modeling, Causal Inference, and Social Science</a>, and syndicated at <a href="http://www.statsblogs.com">StatsBlogs</a>.)
<br /></p>
<p>Every once in awhile I get a question that I can directly answer from my published research.  When that happens it makes me so happy.</p>
<p>Here&#8217;s an example.  Patrick Lam wrote,</p>
<blockquote><p>Suppose one develops a Bayesian model to estimate a parameter theta.  Now suppose one wants to evaluate the model via simulation by generating fake data where you know the value of theta and see how well you recover theta with your model, assuming that you use the posterior mean as the estimate.  The traditional frequentist way of evaluating it might be to generate many datasets and see how well your estimator performs each time in terms of unbiasedness or mean squared error or something.  But given that unbiasedness means nothing to a Bayesian and there is no repeated sampling interpretation in a Bayesian model, how would you suggest one would evaluate a Bayesian model?</p></blockquote>
<p>My reply:</p>
<blockquote><p>I actually have <a href="http://www.stat.columbia.edu/~gelman/research/published/Cook_Software_Validation.pdf">a paper on this</a>!  It is by Cook, Gelman, and Rubin.  The idea is to draw theta from the prior distribution.  You can find the paper in the published papers section on my website.</p>
<p>P.S. Although unbiasedness doesn&#8217;t mean much to a Bayesian, calibration does.</p></blockquote>
<p>We&#8217;re planning on implementing this in Stan at some point.</p>
<p>The post <a href="http://andrewgelman.com/2013/05/23/validation-of-software-for-bayesian-models-using-posterior-quantiles-2/">Validation of Software for Bayesian Models Using Posterior Quantiles</a> appeared first on <a href="http://andrewgelman.com">Statistical Modeling, Causal Inference, and Social Science</a>.</p>
<p class="syndicated-attribution"><br />
<br />
<font color=#8c1717><b>Please comment on the article here:</b></font> <a href="http://andrewgelman.com/2013/05/23/validation-of-software-for-bayesian-models-using-posterior-quantiles-2/"><b>Statistical Modeling, Causal Inference, and Social Science</b></a>
<br />
<br /></p><p>The post <a href="http://www.statsblogs.com/2013/05/23/validation-of-software-for-bayesian-models-using-posterior-quantiles/">Validation of Software for Bayesian Models Using Posterior Quantiles</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p><img src="http://feeds.feedburner.com/~r/statsblogs/~4/rM2ydBMObJE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.statsblogs.com/2013/05/23/validation-of-software-for-bayesian-models-using-posterior-quantiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.statsblogs.com/2013/05/23/validation-of-software-for-bayesian-models-using-posterior-quantiles/</feedburner:origLink></item>
		<item>
		<title>Bayes Pharma 2013 (4)</title>
		<link>http://feedproxy.google.com/~r/statsblogs/~3/gY48xM35AaU/</link>
		<comments>http://www.statsblogs.com/2013/05/23/bayes-pharma-2013-4/#comments</comments>
		<pubDate>Thu, 23 May 2013 13:32:00 +0000</pubDate>
		<dc:creator>Gianluca Baio</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Bayesian statistics]]></category>

		<guid isPermaLink="false">http://www.statsblogs.com/?guid=1dfc33da2435117dfeb50a8e2933b417</guid>
		<description><![CDATA[<p>The conference is officially over and the breaking news is that I have managed to succeed where the lot in the picture right next to this miserably failed.&#160;Somehow they lost the bid to bring the world cup to London (beaten by Qatar!).&#160;[Royal]...</p><p>The post <a href="http://www.statsblogs.com/2013/05/23/bayes-pharma-2013-4/">Bayes Pharma 2013 (4)</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution">(This article was originally published at <a href="http://gianlubaio.blogspot.com/">Gianluca Baio's blog</a>, and syndicated at <a href="http://www.statsblogs.com">StatsBlogs</a>.)
<br /></p>
<div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-_pzrsxoeWik/UZ4XFNlLgII/AAAAAAAAA0g/V2nxOjeCQ8s/s1600/images.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="253" src="http://2.bp.blogspot.com/-_pzrsxoeWik/UZ4XFNlLgII/AAAAAAAAA0g/V2nxOjeCQ8s/s400/images.jpg" width="400" /></a></div><span style="font-family: Trebuchet MS, sans-serif;">The conference is officially over and the breaking news is that I have managed to succeed where the lot in the picture right next to this miserably failed.&nbsp;</span><span style="font-family: 'Trebuchet MS', sans-serif;">Somehow they lost the bid to bring the world cup to London (beaten by Qatar!).&nbsp;</span><br /><span style="font-family: 'Trebuchet MS', sans-serif;"><br /></span><span style="font-family: 'Trebuchet MS', sans-serif;">[Royal] We, on the other hand, won by a landslide the right to organise the next Bayes Pharma! $-$&nbsp;</span><span style="font-family: Trebuchet MS, sans-serif;">of course, I was actually ambushed by <a href="http://www.erasmusmc.nl/biostatistiek/People/Faculty/ELesaffre/" >Emmanuel</a> and <a href="http://www.arlenda.com/en/page/45/company" >Bruno</a>&nbsp;who very cleverly pointed out that it would be nice to take the conference to London, if only someone was in the scientific committee that could organise it...</span><br /><span style="font-family: Trebuchet MS, sans-serif;"><br /></span><span style="font-family: Trebuchet MS, sans-serif;">I blame <a href="http://www.cornebise.com/julien/" >Julien</a> for all this! ;</span><span style="font-family: 'Trebuchet MS', sans-serif;">-)</span>
<p class="syndicated-attribution"><br />
<br />
<font color=#8c1717><b>Please comment on the article here:</b></font> <a href="http://gianlubaio.blogspot.com/2013/05/bayes-pharma-2013-4.html"><b>Gianluca Baio's blog</b></a>
<br />
<br /></p><p>The post <a href="http://www.statsblogs.com/2013/05/23/bayes-pharma-2013-4/">Bayes Pharma 2013 (4)</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p><img src="http://feeds.feedburner.com/~r/statsblogs/~4/gY48xM35AaU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.statsblogs.com/2013/05/23/bayes-pharma-2013-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="" length="" type="" />
		<feedburner:origLink>http://www.statsblogs.com/2013/05/23/bayes-pharma-2013-4/</feedburner:origLink></item>
		<item>
		<title>Netflix adultery statistic debunked</title>
		<link>http://feedproxy.google.com/~r/statsblogs/~3/mDyx3-qY-Lw/</link>
		<comments>http://www.statsblogs.com/2013/05/23/netflix-adultery-statistic-debunked/#comments</comments>
		<pubDate>Thu, 23 May 2013 12:23:00 +0000</pubDate>
		<dc:creator>junkcharts</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Bias]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Film]]></category>
		<category><![CDATA[Significance]]></category>
		<category><![CDATA[Statisticians]]></category>
		<category><![CDATA[Story time]]></category>
		<category><![CDATA[Television]]></category>
		<category><![CDATA[Variability]]></category>

		<guid isPermaLink="false">http://www.statsblogs.com/?guid=ae1536be8b560d4c86c15814859135b2</guid>
		<description><![CDATA[<p>Andrew Sullivan links to Maureen O'Connor (link) who picked up on Netflix's recent advertising pitch mischievously titled &#34;Netflix adultery&#34;. Andrew highlighted this statistical result, with Maureen's interpretation, supposedly sourced from Netflix although I wasn't able to find the actual study. (I added the emphasis.) In a study of 2000 American adults, 12 percent confessed to watching ahead on TV shows they were supposed to save to watch with their partners. Ten percent admitted to being the victim of Netflix adultery, which means either 2 percent are blissfully unaware of their partners’ indiscretions, or the cheaters are hitting multiple victims. This...</p><p>The post <a href="http://www.statsblogs.com/2013/05/23/netflix-adultery-statistic-debunked/">Netflix adultery statistic debunked</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution">(This article was originally published at <a href="http://junkcharts.typepad.com/numbersruleyourworld/">Numbers Rule Your World</a>, and syndicated at <a href="http://www.statsblogs.com">StatsBlogs</a>.)
<br /></p>

<div><p>Andrew Sullivan <a href="http://dish.andrewsullivan.com/2013/05/20/queue-jumping/"  title="link to Andrew Sullivan">links</a> to Maureen O&#039;Connor (<a href="http://nymag.com/thecut/2013/05/netflix-adultery-afflicts-half-of-relationships.html"  title="link to New York Magazine">link</a>) who picked up on Netflix&#039;s recent advertising pitch mischievously titled &quot;Netflix adultery&quot;. Andrew highlighted this statistical result, with Maureen&#039;s interpretation, supposedly sourced from Netflix although I wasn&#039;t able to find the actual study. (I added the emphasis.)</p>
<p style="padding-left: 30px;">In a study of 2000 American adults, 12 percent confessed to watching 
ahead on TV shows they were supposed to save to watch with their 
partners. Ten percent admitted to being the victim of Netflix adultery, 
<strong>which means either 2 percent are blissfully unaware of their partners’ 
indiscretions, or the cheaters are hitting multiple victims</strong>. </p>
<p>This last sentence is &quot;<a href="http://junkcharts.typepad.com/numbersruleyourworld/story-time"  title="other posts about story time">story time</a>&quot;. There is nothing in the study to prove or disprove this story. A third explanation -- which is more likely than the other two -- is that the 2 percent difference is pure noise. The margin of error of this study is about 1.3 percent plus or minus around each of those percentages. </p>
<p>The conclusion also contains a number of suspicious elements. First, it&#039;s unclear how exactly 2000 people responded. Second, not all adults have partners so either the 2000 people were pre-screened and not just any adult, or the percentages are biased by unattached people who could not have cheated. </p>
<p>Thirdly, Maureen made an assumption that both partners of each couple responded, which is highly unlikely. There are really eight types of couples: both cheated, which leads to four types depending on whether each partner confessed to the other; the first partner cheated or the second partner cheated, each of which leads to two types depending on whether there was a confession. Each couple may have returned one or two surveys. Given such complexity, the two percentages from the survey cannot be simply interpreted.</p>
<p>Finally, Netflix should disclose how the sample was selected.</p></div>

<p class="syndicated-attribution"><br />
<br />
<font color=#8c1717><b>Please comment on the article here:</b></font> <a href="http://junkcharts.typepad.com/numbersruleyourworld/2013/05/netflix-adultery-statistic-debunked.html"><b>Numbers Rule Your World</b></a>
<br />
<br /></p><p>The post <a href="http://www.statsblogs.com/2013/05/23/netflix-adultery-statistic-debunked/">Netflix adultery statistic debunked</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p><img src="http://feeds.feedburner.com/~r/statsblogs/~4/mDyx3-qY-Lw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.statsblogs.com/2013/05/23/netflix-adultery-statistic-debunked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.statsblogs.com/2013/05/23/netflix-adultery-statistic-debunked/</feedburner:origLink></item>
		<item>
		<title>Bayes Pharma 2013 (3)</title>
		<link>http://feedproxy.google.com/~r/statsblogs/~3/UxtZJ_piAAc/</link>
		<comments>http://www.statsblogs.com/2013/05/22/bayes-pharma-2013-3/#comments</comments>
		<pubDate>Wed, 22 May 2013 19:58:00 +0000</pubDate>
		<dc:creator>Gianluca Baio</dc:creator>
				<category><![CDATA[Statistics]]></category>
		<category><![CDATA[Bayesian statistics]]></category>

		<guid isPermaLink="false">http://www.statsblogs.com/?guid=f88a4338440a44e8cdbe2843b4f25179</guid>
		<description><![CDATA[<p>Another very interesting day. The highlight of the morning was, in my opinion, David Ohlssen's talk. David is with Novartis US and has discussed a few issues related with subgroup analysis, pointing out the potential strengths of applying a Bayesian ap...</p><p>The post <a href="http://www.statsblogs.com/2013/05/22/bayes-pharma-2013-3/">Bayes Pharma 2013 (3)</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p>]]></description>
			<content:encoded><![CDATA[<p class="syndicated-attribution">(This article was originally published at <a href="http://gianlubaio.blogspot.com/">Gianluca Baio's blog</a>, and syndicated at <a href="http://www.statsblogs.com">StatsBlogs</a>.)
<br /></p>
<span style="font-family: Trebuchet MS, sans-serif;">Another very interesting day. The highlight of the morning was, in my opinion, David Ohlssen's talk. David is with Novartis US and has discussed a few issues related with subgroup analysis, pointing out the potential strengths of applying a Bayesian approach.</span><br /><span style="font-family: Trebuchet MS, sans-serif;"><br /></span><span style="font-family: Trebuchet MS, sans-serif;">In the afternoon, a very good session on missing data. <a href="http://www1.imperial.ac.uk/medicine/people/n.best/" >Nicky</a> and <a href="http://www1.imperial.ac.uk/medicine/people/a.mason/" >Alexina's</a> talks were very good and with plenty of interesting insights $-$ I'd like to incorporate some of them in the lectures for Social Statistics next year (although usually the students are not familiar with Bayesian statistics, so that is probably a bit complex to do). I think all the talks will be soon available on the Bayes Pharma <a href="http://www.bayes-pharma.org/" >website</a>.</span><br /><span style="font-family: Trebuchet MS, sans-serif;"><br /></span><span style="font-family: Trebuchet MS, sans-serif;">Finally, following the advice of a very nice local young lady, we went to dinner to a sort of <a href="http://www.bazarrotterdam.nl/" >North African/Middle Eastern restaurant</a>, which was really nice.</span>
<p class="syndicated-attribution"><br />
<br />
<font color=#8c1717><b>Please comment on the article here:</b></font> <a href="http://gianlubaio.blogspot.com/2013/05/bayes-pharma-2013-3.html"><b>Gianluca Baio's blog</b></a>
<br />
<br /></p><p>The post <a href="http://www.statsblogs.com/2013/05/22/bayes-pharma-2013-3/">Bayes Pharma 2013 (3)</a> appeared first on <a href="http://www.statsblogs.com">Statistics Blogs</a>.</p><img src="http://feeds.feedburner.com/~r/statsblogs/~4/UxtZJ_piAAc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.statsblogs.com/2013/05/22/bayes-pharma-2013-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.statsblogs.com/2013/05/22/bayes-pharma-2013-3/</feedburner:origLink></item>
	</channel>
</rss>
