<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Bayesian Modeling in the Social Sciences</title>
	<atom:link href="http://cddesjardins.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cddesjardins.wordpress.com</link>
	<description></description>
	<lastBuildDate>Tue, 08 Dec 2009 18:14:19 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='cddesjardins.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/7e78713970b89b33723985b6671f200d?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Bayesian Modeling in the Social Sciences</title>
		<link>http://cddesjardins.wordpress.com</link>
	</image>
			<item>
		<title>Sane priors in a ZIP multilevel model</title>
		<link>http://cddesjardins.wordpress.com/2009/12/08/sane-priors-in-a-zip-model/</link>
		<comments>http://cddesjardins.wordpress.com/2009/12/08/sane-priors-in-a-zip-model/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 17:58:47 +0000</pubDate>
		<dc:creator>Desjardins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cddesjardins.wordpress.com/?p=166</guid>
		<description><![CDATA[My recent tardiness from this blog shouldn&#8217;t be an indication of it&#8217;s abandonment. Instead it&#8217;s an indication of a hectic semester with a trying analysis. 
I have been hard at work with a large data set with a dependent variable that has a Poisson distribution. Unfortunately, lots of subjects have zero bon this measure and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=166&subd=cddesjardins&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>My recent tardiness from this blog shouldn&#8217;t be an indication of it&#8217;s abandonment. Instead it&#8217;s an indication of a hectic semester with a trying analysis. </p>
<p>I have been hard at work with a large data set with a dependent variable that has a Poisson distribution. Unfortunately, lots of subjects have zero bon this measure and have forced me into the arena of zero-inflated Poisson models because of poor fit of the Poisson models. The ZIP model in this case is essential a Poisson model + Binomial model for the zero-inflation component. Also due to the complexity of my analysis and the multiple levels involved, I can&#8217;t estimate this model with maximum likelihood but instead am relying on Markov Chain Monte Carlo and specifically the <a href="http://cran.r-project.org/web/packages/MCMCglmm/index.html">MCMCglmm</a> package in <a href="www.r-project.org">R</a>. The author of the package, Jarrod Hadfield, has been incredibly helpful and extremely patient with my questions.  Unfortunately, my problem has even stumped him a little bit (the overall extremely poor fit of the predicted values from the Poisson model).  Right now I am trying to figure out the most sane priors to expedite mixing and converging. At the moment MCMCglmm v. 1.13 only allows<a href="http://en.wikipedia.org/wiki/Inverse-Wishart_distribution"> Inverse Wishart </a> priors for the variance components and Normal priors for the means (which I&#8217;ve not specified but instead am using the default). However, Jarrod has informed that there will be a new version with a massive overhaul with more options for different priors.  I&#8217;ve decided to use weak but informative Inverse Wishart priors while fixing the residual variance of the zero-inflation component because it can&#8217;t be estimated.</p>
<p><code>prior=list(R=list(V=diag(c(1,1e-10)), nu=0.001, fix=2),<br />
       G=list(G1=list(V=diag(2)*0.021e-10, nu=0.001)))<br />
 </code></p>
<p>To run the ZIP model I have sent MCMCglmm the following code:<br />
<code>system.time(q1.zip &lt;- MCMCglmm(y ~ trait + trait:time-1 + trait:I(time)^2,saveX=TRUE,saveZ=TRUE,random=~us(trait):id.f, nitt=200,burnin=50,rcov=~idh(trait):units,<br />
data=dat1,verbose=TRUE,singular.ok=TRUE,pr=TRUE,<br />
pl=TRUE,prior=prior,DIC=TRUE,family="zipoisson"))<br />
</code></p>
<p>However, MCMCglmm doesn&#8217;t like these prior as they are too weak:<br />
<code>Error in MCMCglmm(y ~ trait + trait:time - 1 + trait:I(time)^2, saveX = TRUE,  : Mixed model equations singular: use a (stronger) prior Timing stopped at: 1485.42 44.79 1551.59<br />
</code></p>
<p>Back to the drawing board &#8230; I will update this when/if I can get this model to converge!</p>
<p>PS &#8211; This blog has subscribers! Thanks and I&#8217;ll try to update more often to make subscriptions actual worth it.</p>
<p>PSS &#8211; I will start working on a MS in Statistics in Fall 2010 and hope to finish it in Spring 2012 and then my PhD in Quantitative Methods in Education in Fall 2013. I think my MS will help provide me with a more thorough understanding of the statistical models I run as well as giving me a deeper understanding of Bayesian methods and MCMC. My plans are to continue to use this blog as a way to deliver Bayesian in a non-technical way to the applied researcher in the social sciences and maybe Ecology if someone can send some data!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cddesjardins.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cddesjardins.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cddesjardins.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cddesjardins.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cddesjardins.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cddesjardins.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cddesjardins.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cddesjardins.wordpress.com/166/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cddesjardins.wordpress.com/166/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cddesjardins.wordpress.com/166/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=166&subd=cddesjardins&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cddesjardins.wordpress.com/2009/12/08/sane-priors-in-a-zip-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80c20dd845c14236ac637a03f2899065?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Desjardins</media:title>
		</media:content>
	</item>
		<item>
		<title>How-to: VIM, GNU R, and LaTeX</title>
		<link>http://cddesjardins.wordpress.com/2009/10/24/vim-gnu-r-and-latex/</link>
		<comments>http://cddesjardins.wordpress.com/2009/10/24/vim-gnu-r-and-latex/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 15:05:41 +0000</pubDate>
		<dc:creator>Desjardins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cddesjardins.wordpress.com/?p=159</guid>
		<description><![CDATA[Recently I switched from Emacs to VIM. Mostly because I&#8217;ve felt that the default keybindings are more sane. The first thing I needed to do was to find a plugin for VIM that worked for R. Well here is that plugin. The follow the directions there for installation. (If you need help leave me a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=159&subd=cddesjardins&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Recently I switched from <a href="http://www.gnu.org/software/emacs/">Emacs</a> to <a href="http://www.vim.org/">VIM</a>. Mostly because I&#8217;ve felt that the default keybindings are more sane. The first thing I needed to do was to find a plugin for VIM that worked for R. Well here is that <a href="http://www.vim.org/scripts/script.php?script_id=2628">plugin</a>. The follow the directions there for installation. (If you need help leave me a comment). VIM will automatically detect that it is in R mode when opening a *.R file. </p>
<p>Two quick tips to get you started:<br />
<code><br />
# To open R<br />
\rf<br />
# To send code to R<br />
\d<br />
</code></p>
<p>Also, if you need a LaTeX plugin for VIM <a href="http://vim-latex.sourceforge.net/">here it is</a>. It also has very sane keybindings. I recommend not using the Debian package as it didn&#8217;t work for me. To get LaTeX to compile in PDF mode by default I added the following to ~/.vimrc:</p>
<p><code><br />
" Set pdf as default target<br />
let g:Tex_DefaultTargetFormat='pdf'<br />
</code></p>
<p>That&#8217;s it. And in complete disclosure, I am really using the GTK-front end of VIM known as GVIM. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cddesjardins.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cddesjardins.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cddesjardins.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cddesjardins.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cddesjardins.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cddesjardins.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cddesjardins.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cddesjardins.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cddesjardins.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cddesjardins.wordpress.com/159/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=159&subd=cddesjardins&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cddesjardins.wordpress.com/2009/10/24/vim-gnu-r-and-latex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80c20dd845c14236ac637a03f2899065?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Desjardins</media:title>
		</media:content>
	</item>
		<item>
		<title>SEM in WinBUGS</title>
		<link>http://cddesjardins.wordpress.com/2009/10/24/sem-in-winbugs/</link>
		<comments>http://cddesjardins.wordpress.com/2009/10/24/sem-in-winbugs/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 14:51:44 +0000</pubDate>
		<dc:creator>Desjardins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cddesjardins.wordpress.com/?p=149</guid>
		<description><![CDATA[For my MITER research, I have been working with a faculty member in the University of Minnesota&#8217;s Institute of Child Development. I have been involved on a couple of projects with this group. One project involved longitudinal modeling of work competency (from childhood to adulthood) using structural equation modeling (SEM). This project examined how childhood [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=149&subd=cddesjardins&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>For my <a href="http://www.cehd.umn.edu/miter/">MITER research</a>, I have been working with a faculty member in the University of Minnesota&#8217;s <a href="http://www.cehd.umn.edu/ICD/">Institute of Child Development</a>. I have been involved on a couple of projects with this group. One project involved longitudinal modeling of work competency (from childhood to adulthood) using structural equation modeling (SEM). This project examined how childhood competence in externalizing behaviors/conduct, academics, and socializing behaviors predict work as an adult. If you&#8217;re interested in this work, it has just been accepted and should be in press soon. (Feel free to email me for a copy of this manuscript and I&#8217;ll see if I can get a copy). </p>
<p>To do the SEM, we initially tried the <a href="http://socserv.mcmaster.ca/jfox/Misc/sem/index.html">sem</a> package in R. This proved to be to basic for us as it was unable to do a multi-group analysis. So we settled on MPlus. Even in MPlus, we were unable to run the models we really wanted to because the number of integration points were too many and MPlus would just error out. We dealt with it the best we could and I think our manuscript is strong and transparent about our computational problems.</p>
<p>After this paper was submitted, I become more interested in examining what sort of alternatives exist. Is there a Bayesian book on SEM? <a href="http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470024232.html">Well apparently there is</a>. In the Bayesian framework, latent constructs are just dealt with as missing data problems, making them more computationally solvable. Additionally, using Bayesian you work directly from your observed data and not from a covariance matrix. Because of this you can create more highly complex, developmentally appropriate models that are infeasible in traditional software. Even Bollen is writing about <a href="http://www.samsi.info/TR/tr2005-05.pdf">this</a>. </p>
<p>To help you get started. I am going to paste the code that I have used to replicate our models in WinBUGS. Unfortunately I can not share the data. But if you have specific data you can share then I&#8217;d be happy to modify the code as appropriate.</p>
<p><code><br />
model {<br />
for(i in 1:N){<br />
##########################<br />
# measurement equation model<br />
##########################<br />
for(j in 1:P){<br />
y[i,j]~dnorm(mu[i,j],psi[j])<br />
}<br />
##########################<br />
# alp[i] corresponds to the intercepts<br />
##########################<br />
mu[i,1]&lt;-xi[i,1]+alp[1]   ## Ext1<br />
mu[i,2]&lt;-lam[1]*xi[i,1]+alp[2]<br />
mu[i,3]&lt;-lam[2]*xi[i,1]+alp[3]<br />
mu[i,4]&lt;-xi[i,2]+alp[4]   ## Soc1<br />
mu[i,5]&lt;-lam[3]*xi[i,2]+alp[5]<br />
mu[i,6]&lt;-lam[4]*xi[i,2]+alp[6]<br />
mu[i,7]&lt;-xi[i,3]+alp[7]   ## Aca1<br />
mu[i,8]&lt;-lam[5]*xi[i,3]+alp[8]<br />
mu[i,9]&lt;-lam[6]*xi[i,3]+alp[9]<br />
mu[i,10]&lt;-xi[i,4]+alp[10]   ## Ext2<br />
mu[i,11]&lt;-lam[7]*xi[i,4]+alp[11]<br />
mu[i,12]&lt;-lam[8]*xi[i,4]+alp[12]<br />
mu[i,13]&lt;-xi[i,5]+alp[13]   ## Soc2<br />
mu[i,14]&lt;-lam[9]*xi[i,5]+alp[14]<br />
mu[i,15]&lt;-lam[10]*xi[i,5]+alp[15]<br />
mu[i,16]&lt;-xi[i,6]+alp[16]   ## Aca2<br />
mu[i,17]&lt;-lam[11]*xi[i,6]+alp[17]<br />
mu[i,18]&lt;-lam[12]*xi[i,6]+alp[18]<br />
mu[i,19]&lt;-xi[i,7]+alp[19]   ## Work2<br />
mu[i,20]&lt;-lam[13]*xi[i,7]+alp[20]<br />
mu[i,21]&lt;-lam[14]*xi[i,7]+alp[21]<br />
##########################<br />
# structural equation model<br />
##########################<br />
xi[i,1:3]~dmnorm(u[1:3],phi[1:3,1:3])   ## factor loadings are multivariate normal<br />
xi[i,4]~dnorm(ext2[i],psd)<br />
xi[i,5]~dnorm(soc2[i],psd)<br />
xi[i,6]~dnorm(aca2[i],psd)<br />
xi[i,7]~dnorm(work2[i],psd)<br />
##########################<br />
# continuity Paths<br />
##########################<br />
ext2[i]&lt;-gam[1]*xi[i,1]<br />
soc2[i]&lt;-gam[2]*xi[i,2]<br />
aca2[i]&lt;-gam[3]*xi[i,3]<br />
work2[i]&lt;-gam[4]*xi[i,1] + gam[5]*xi[i,1] + gam[6]*xi[i,1]<br />
} #end of i<br />
##########################<br />
# priors on intercepts<br />
##########################<br />
for(j in 1:21){alp[j]~dnorm(0.0, 1.0)}<br />
##########################<br />
# priors on loadings and coefficients<br />
##########################<br />
lam[1]~dnorm(0.8,psi[1])<br />
lam[2]~dnorm(0.8,psi[2])<br />
lam[3]~dnorm(0.8,psi[3])<br />
lam[4]~dnorm(0.8,psi[4])<br />
lam[5]~dnorm(0.8,psi[5])<br />
lam[6]~dnorm(0.8,psi[6])<br />
lam[7]~dnorm(0.8,psi[7])<br />
lam[8]~dnorm(0.8,psi[8])<br />
lam[9]~dnorm(0.8,psi[9])<br />
lam[10]~dnorm(0.8,psi[10])<br />
lam[11]~dnorm(0.8,psi[11])<br />
lam[12]~dnorm(0.8,psi[12])<br />
lam[13]~dnorm(0.8,psi[13])<br />
lam[14]~dnorm(0.8,psi[14])<br />
for(j in 1:6){gam[j]~dnorm(0.5, psd)}<br />
##########################<br />
#priors on precisions<br />
##########################<br />
for(j in 1:P){<br />
psi[j]~dgamma(9.0, 4.0)<br />
sgm[j]&lt;-1/psi[j]<br />
}<br />
psd~dgamma(9.0, 4.0)<br />
sgd&lt;-1/psd<br />
phi[1:3,1:3]~dwish(R[1:3,1:3], 5)<br />
phx[1:3,1:3]&lt;-inverse(phi[1:3,1:3])<br />
} #end of model<br />
</code></p>
<p>I&#8217;d be happy to answer any questions about the code. Note this is just the model, not the starting values. I usually let WinBUGS generate them for me. Bad practice I know, but as long as my chains mix I am not worried.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cddesjardins.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cddesjardins.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cddesjardins.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cddesjardins.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cddesjardins.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cddesjardins.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cddesjardins.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cddesjardins.wordpress.com/149/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cddesjardins.wordpress.com/149/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cddesjardins.wordpress.com/149/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=149&subd=cddesjardins&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cddesjardins.wordpress.com/2009/10/24/sem-in-winbugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80c20dd845c14236ac637a03f2899065?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Desjardins</media:title>
		</media:content>
	</item>
		<item>
		<title>WinBUGS and OpenBUGS on Debian GNU/Linux Lenny</title>
		<link>http://cddesjardins.wordpress.com/2009/10/24/winbugs-and-openbugs-on-debian-gnulinux-lenny/</link>
		<comments>http://cddesjardins.wordpress.com/2009/10/24/winbugs-and-openbugs-on-debian-gnulinux-lenny/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 14:16:34 +0000</pubDate>
		<dc:creator>Desjardins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cddesjardins.wordpress.com/?p=145</guid>
		<description><![CDATA[A quick how-to for installing WinBUGS and OpenBUGS on Debian GNU/Linux Lenny. I am sure this will work on other distributions. The only issue might be that certain distributions ship different versions of  wine . I am use wine 1.0.1, with other versions of wine YMMV.
First, install wine

su -
aptitude install wine

Second, go here and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=145&subd=cddesjardins&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A quick how-to for installing WinBUGS and OpenBUGS on Debian GNU/Linux Lenny. I am sure this will work on other distributions. The only issue might be that certain distributions ship different versions of <a href="http://www.winehq.org/"> wine </a>. I am use wine 1.0.1, with other versions of wine YMMV.</p>
<p>First, install wine<br />
<code><br />
su -<br />
aptitude install wine<br />
</code></p>
<p>Second, go here and download the <a href="http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/winbugs14.zip"> WinBUGS </a> and <a href="http://mathstat.helsinki.fi/openbugs/OpenBUGS.zip"> OpenBUGS </a> binaries. It is important to note that OpenBUGS is the development version of WinBUGS and it&#8217;s open-source.</p>
<p>I also encourage you to check out <a href="http://www-fis.iarc.fr/~martyn/software/jags/">JAGS</a>. I have created a 64-bit package of JAGS that is available <a href="http://cddesjardins.wordpress.com/2009/04/28/jags-package-for-debian-lenny-amd-64">here</a> for Debian. If you&#8217;re a R user and do a lot of multilevel modeling, I recommend <a href="http://cran.r-project.org/web/packages/MCMCglmm/index.html"> MCMCglmm </a>. </p>
<p>Third, assuming you&#8217;ve downloaded these files to ~/Downloads, for WinBUGS do the following:<br />
<code><br />
unzip ~/Downloads/winbugs14.zip<br />
</code></p>
<p>And for OpenBUGS do the following:</p>
<p><code><br />
mkdir -p ~/Downloads/openbugs<br />
mv ~/Downloads/OpenBUGS.zip ~/Downloads/openbugs<br />
unzip ~/Downloads/openbugs/OpenBUGS.zip<br />
</code></p>
<p>Now everything is reading to go. To launch WinBUGS:<br />
<code><br />
wine ~/Downloads/WinBUGS14/WinBUGS14.exe<br />
</code><br />
To launch OpenBUGS:<br />
<code><br />
wine ~/Downloads/openbugs/winbugs.exe<br />
</code><br />
Note the first line of code is for WinBUGS and the second line is for OpenBUGS. </p>
<p>Don&#8217;t forget to add the <a href="http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/WinBUGS14_immortality_key.txt">immortality key</a> and the <a href="http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/patches.shtml">patch for WinBUGS.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cddesjardins.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cddesjardins.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cddesjardins.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cddesjardins.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cddesjardins.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cddesjardins.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cddesjardins.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cddesjardins.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cddesjardins.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cddesjardins.wordpress.com/145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=145&subd=cddesjardins&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cddesjardins.wordpress.com/2009/10/24/winbugs-and-openbugs-on-debian-gnulinux-lenny/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80c20dd845c14236ac637a03f2899065?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Desjardins</media:title>
		</media:content>
	</item>
		<item>
		<title>Bayesian Guide for Education</title>
		<link>http://cddesjardins.wordpress.com/2009/10/24/bayesian-guide-for-education/</link>
		<comments>http://cddesjardins.wordpress.com/2009/10/24/bayesian-guide-for-education/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 00:04:32 +0000</pubDate>
		<dc:creator>Desjardins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cddesjardins.wordpress.com/?p=136</guid>
		<description><![CDATA[I have been working on a gentle, very applied introduction to Bayesian aimed at educational researchers. I&#8217;ve uploaded the guide. Feel free to download it and if you do please provide feedback. 
 Click here for the Bayesian guide
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=136&subd=cddesjardins&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I have been working on a gentle, very applied introduction to Bayesian aimed at educational researchers. I&#8217;ve uploaded the guide. Feel free to download it and if you do please provide feedback. </p>
<p><a href="http://cddesjardins.files.wordpress.com/2009/10/bayesiannotes_10232009.pdf"> Click here for the Bayesian guide</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cddesjardins.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cddesjardins.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cddesjardins.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cddesjardins.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cddesjardins.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cddesjardins.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cddesjardins.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cddesjardins.wordpress.com/136/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cddesjardins.wordpress.com/136/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cddesjardins.wordpress.com/136/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=136&subd=cddesjardins&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cddesjardins.wordpress.com/2009/10/24/bayesian-guide-for-education/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80c20dd845c14236ac637a03f2899065?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Desjardins</media:title>
		</media:content>
	</item>
		<item>
		<title>R just got a little more love from Debian</title>
		<link>http://cddesjardins.wordpress.com/2009/07/30/r-just-got-a-little-more-love-from-debian/</link>
		<comments>http://cddesjardins.wordpress.com/2009/07/30/r-just-got-a-little-more-love-from-debian/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 16:23:02 +0000</pubDate>
		<dc:creator>Desjardins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cddesjardins.wordpress.com/?p=130</guid>
		<description><![CDATA[
Announcing cran2deb: 1700+ Debian packages from almost all of CRAN
------------------------------------------------------------------

Last Friday's presentation at UseR! 2009 was the first really public mention
of 'cran2deb'. It provides Debian packages of all of CRAN. It started as
Charles' project from last year's Google Summer of Code, was further extended
by us over the last year.

We currently build for the testing distribution [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=130&subd=cddesjardins&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><blockquote>
<pre>Announcing cran2deb: 1700+ Debian packages from almost all of CRAN
------------------------------------------------------------------

Last Friday's presentation at UseR! 2009 was the first really public mention
of 'cran2deb'. It provides Debian packages of all of CRAN. It started as
Charles' project from last year's Google Summer of Code, was further extended
by us over the last year.

We currently build for the testing distribution and the i386 and amd64
architectures. This is now publically useable and we welcome wider testing
by Debian users. We hope to extend this to Ubuntu during the summer or fall.

I include what I blogged earlier (which you may have seen via Planet Debian
and/or Planet R).  This also contains the /etc/apt/sources.list entries:

   cran2deb: Would you like 1700+ new Debian / R packages ?

   As I mentioned in my [8]quick write-up of UseR 2009, one of my talks
   was about cran2deb: a system to turn (essentially) all [1]CRAN packages
   into directly apt-get-able binary packages.

   This is essentially a '2.0' version of earlier work with Steffen
   Moeller and David Vernazobres which we had presented in 2007. Then, the
   approach was top-down and monolithic which started to show its limits.
   This time, the idea was to borrow the successful bottom-up approach of
   my [2]CRANberries feed.

   The bulk of the work was done by Charles Blundell as part of his Google
   Summer of Code 2008 project which I had suggested and mentored. After
   that project had concluded, we both felt we should continue with it and
   bring it to 'production'. The CRAN hosts provided us with a (virtual
   Xen) machine to build on, and we are now ready to more publically
   announce the availability of the repositories for i386 and amd64:

      deb <a href="http://debian.cran.r-project.org/cran2deb/debian-i386">http://debian.cran.r-project.org/cran2deb/debian-i386</a> testing/

   and

      deb <a href="http://debian.cran.r-project.org/cran2deb/debian-amd64">http://debian.cran.r-project.org/cran2deb/debian-amd64</a> testing/

   A few more details are provided in [3]our presentation slides. We look
   forward to hearing from folks using; the r-sig-debian list may be a
   good venue for this.

   References
   1. <a href="http://cran.r-project.org/">http://cran.r-project.org/</a>
   2. <a href="http://dirk.eddelbuettel.com/cranberries">http://dirk.eddelbuettel.com/cranberries</a>
   3. <a href="http://dirk.eddelbuettel.com/papers/useR2009cran2deb.pdf">http://dirk.eddelbuettel.com/papers/useR2009cran2deb.pdf</a>

Please direct questions to r-sig-debian (which has subscriber-only posts) or
debian-science. 

Regards,  Dirk and Charles

--
Three out of two people have difficulties with fractions.</pre>
</blockquote>
<p>I would like to thank Dirk and Charles for their hard work!</p>
<p>Original message posted by Dirk:</p>
<p>https://stat.ethz.ch/pipermail/r-sig-debian/2009-July/000805.html</p>
<blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cddesjardins.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cddesjardins.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cddesjardins.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cddesjardins.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cddesjardins.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cddesjardins.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cddesjardins.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cddesjardins.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cddesjardins.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cddesjardins.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=130&subd=cddesjardins&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cddesjardins.wordpress.com/2009/07/30/r-just-got-a-little-more-love-from-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80c20dd845c14236ac637a03f2899065?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Desjardins</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple OpenBUGS MR example</title>
		<link>http://cddesjardins.wordpress.com/2009/06/17/simple-openbugs-mr-example/</link>
		<comments>http://cddesjardins.wordpress.com/2009/06/17/simple-openbugs-mr-example/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 20:43:37 +0000</pubDate>
		<dc:creator>Desjardins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cddesjardins.wordpress.com/?p=116</guid>
		<description><![CDATA[Below is some OpenBUGS code that I created that models income as a function of age, race, and educational status. This is a simple MR example and can easily be replicated in R with the lm() function.

## OpenBUGS Model
model{
for( i in 1:6641) {
income[i] ~ dnorm(mu[i], tau)
mu[i] &#60;- beta0 + beta1*educ[i] + beta2*age[i] + beta3*race[i]
}
## Priors
#beta0 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=116&subd=cddesjardins&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Below is some OpenBUGS code that I created that models income as a function of age, race, and educational status. This is a simple MR example and can easily be replicated in R with the <code>lm()</code> function.<br />
<code><br />
## OpenBUGS Model<br />
model{<br />
for( i in 1:6641) {<br />
income[i] ~ dnorm(mu[i], tau)<br />
mu[i] &lt;- beta0 + beta1*educ[i] + beta2*age[i] + beta3*race[i]<br />
}<br />
## Priors<br />
#beta0 ~ dflat()<br />
#beta1 ~ dflat()<br />
#beta2 ~ dflat()<br />
#beta3 ~ dflat()<br />
## Hypothesized Priors, deduced by "peaking"<br />
beta0 ~ dnorm(3, 0.1)<br />
beta1 ~ dnorm(0.3, 0.1)<br />
beta2 ~ dnorm(0.01,0.5)<br />
beta3 ~ dnorm(0, 0.1)<br />
tau ~ dgamma(0.1,0.1)<br />
sigma &lt;- 1/sqrt(tau)<br />
}<br />
## Initial values<br />
list(beta0 = 0, beta1 = 1, beta2 = 1, beta3 = 1, tau = 1)<br />
</code></p>
<p>You can get the data and a file that contains the model and the initial values <a href="http://blog.lib.umn.edu/desja004/educationalpsychology/mr_income.txt">here</a>.  This is example is entirely didactic, comes with no warranty, and is entirely intended to help get folks up and running in *BUGS. </p>
<p>The most interesting bits: With this large sample size (n ~ 6000), the priors seem to be washed away by the data and the high similarity between the results from the Bayesian and the frequentist analyses (run via <code>lm</code> in R). </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cddesjardins.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cddesjardins.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cddesjardins.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cddesjardins.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cddesjardins.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cddesjardins.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cddesjardins.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cddesjardins.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cddesjardins.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cddesjardins.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=116&subd=cddesjardins&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cddesjardins.wordpress.com/2009/06/17/simple-openbugs-mr-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80c20dd845c14236ac637a03f2899065?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Desjardins</media:title>
		</media:content>
	</item>
		<item>
		<title>OpenBUGS and WinBUGS on Mac OS X</title>
		<link>http://cddesjardins.wordpress.com/2009/06/15/openbugs-and-winbugs-on-mac-os-x/</link>
		<comments>http://cddesjardins.wordpress.com/2009/06/15/openbugs-and-winbugs-on-mac-os-x/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 00:18:04 +0000</pubDate>
		<dc:creator>Desjardins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cddesjardins.wordpress.com/?p=102</guid>
		<description><![CDATA[I haven&#8217;t found a really good how-to for getting OpenBUGS and WinBUGS up and running on Mac OS X, so I thought I&#8217;d create a little how-to. Setting up these programs is super easy but requires MacPorts and  wine .  
First, you need to have the  Xcode  developer tools installed. Go [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=102&subd=cddesjardins&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I haven&#8217;t found a really good how-to for getting OpenBUGS and WinBUGS up and running on Mac OS X, so I thought I&#8217;d create a little how-to. Setting up these programs is super easy but requires MacPorts and <a href="http://www.winehq.org/"> wine </a>.  </p>
<p>First, you need to have the <a href="http://developer.apple.com/tools/xcode/index.html"> Xcode </a> developer tools installed. Go to Apple, create an account, and download them. </p>
<p>Second, install <a href="http://www.macports.org"> MacPorts </a> (get it <a href="http://svn.macports.org/repository/macports/downloads/MacPorts-1.7.1/MacPorts-1.7.1-10.5-Leopard.dmg"> here </a> for 10.5) by clicking the *.dmg file.</p>
<p>Third, open a terminal and type:<br />
<code><br />
sudo port install wine<br />
</code><br />
This will take about 20 minutes to compile wine and all its dependencies. </p>
<p>Fourth, download the WinBUGS zip file <a href="http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/winbugs14.zip"> here </a> and the OpenBUGS zip file <a href="http://mathstat.helsinki.fi/openbugs/OpenBUGS.zip"> here </a>.</p>
<p>Fifth, unzip the WinBUGS file by double clicking on it and it will create a folder called WinBUGS14. Move this to Applications. For OpenBUGS, I had to create a folder called OpenBUGS, move the zip file there, open up a terminal, and type <code> unzip OpenBUGS.zip </code> (double clicking this file did not work thus I fired up a terminal). This folder I then moved to Applications.</p>
<p>Sixth, to start WinBUGS open a terminal and type the following:<br />
<code><br />
cd /Applications/WinBUGS14<br />
wine WinBUGS14.exe<br />
</code></p>
<p>For OpenBUGS, open a terminal and type the following (assuming you created a folder named OpenBUGS with all the file from the OpenBUGS.zip files in them):<br />
<code><br />
cd /Applications/OpenBUGS<br />
wine winbugs.exe<br />
</code></p>
<p>Everything seems to work fine. The only thing I&#8217;ve noticed is that the fonts are not as nice in wine as they are in Windows and in WinBUGS some of the documentation doesn&#8217;t work properly (e.g. clicking on links does nothing), whereas in OpenBUGS they work flawlessly.</p>
<p>Please leave comments if this works/doesn&#8217;t work for you.  </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cddesjardins.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cddesjardins.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cddesjardins.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cddesjardins.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cddesjardins.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cddesjardins.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cddesjardins.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cddesjardins.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cddesjardins.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cddesjardins.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=102&subd=cddesjardins&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cddesjardins.wordpress.com/2009/06/15/openbugs-and-winbugs-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80c20dd845c14236ac637a03f2899065?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Desjardins</media:title>
		</media:content>
	</item>
		<item>
		<title>IES 2009 Poster Presentation</title>
		<link>http://cddesjardins.wordpress.com/2009/06/11/ies-2009-poster-presentation/</link>
		<comments>http://cddesjardins.wordpress.com/2009/06/11/ies-2009-poster-presentation/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 01:37:11 +0000</pubDate>
		<dc:creator>Desjardins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cddesjardins.wordpress.com/?p=83</guid>
		<description><![CDATA[This past Monday I presented a poster on my research at the  Institute of Education Sciences . It examined the influence of risk on reading and math achievement with a specific focus on treating risk as a dynamic and static covariate. Analysis was performed with the  lme4  package in R and graphs [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=83&subd=cddesjardins&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This past Monday I presented a poster on my research at the <a href="http://ies.ed.gov/director/conferences/09ies_conference/"> Institute of Education Sciences </a>. It examined the influence of risk on reading and math achievement with a specific focus on treating risk as a dynamic and static covariate. Analysis was performed with the <a href="http://cran.r-project.org/web/packages/lme4/index.html"> lme4 </a> package in R and graphs were created in <a href="http://had.co.nz/ggplot2/"> ggplot2 </a>. Model selection was done with the BIC. The static models overwhelmingly beat the dynamic models. Click on the picture to download a PDF of the poster. Feedback is welcomed.</p>
<p><a href="http://cddesjardins.files.wordpress.com/2009/06/ies_2009_final_cdd_2.pdf"><img class="aligncenter size-full wp-image-47" title="IES2009" src="http://cddesjardins.files.wordpress.com/2009/06/slide11.jpg?w=450&#038;h=300" alt="IES2009" width="450" height="300" /></a></p>
<p>Finally, this blog will now be updated at least weekly with more comprehensive notes on Bayesian analysis, R and WinBUGS code. </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cddesjardins.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cddesjardins.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cddesjardins.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cddesjardins.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cddesjardins.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cddesjardins.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cddesjardins.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cddesjardins.wordpress.com/83/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cddesjardins.wordpress.com/83/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cddesjardins.wordpress.com/83/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=83&subd=cddesjardins&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cddesjardins.wordpress.com/2009/06/11/ies-2009-poster-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80c20dd845c14236ac637a03f2899065?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Desjardins</media:title>
		</media:content>

		<media:content url="http://cddesjardins.files.wordpress.com/2009/06/slide11.jpg" medium="image">
			<media:title type="html">IES2009</media:title>
		</media:content>
	</item>
		<item>
		<title>Bayesian Hierarchical Modeling</title>
		<link>http://cddesjardins.wordpress.com/2009/05/15/bayesian-hierarchical-modeling/</link>
		<comments>http://cddesjardins.wordpress.com/2009/05/15/bayesian-hierarchical-modeling/#comments</comments>
		<pubDate>Fri, 15 May 2009 16:21:53 +0000</pubDate>
		<dc:creator>Desjardins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://cddesjardins.wordpress.com/?p=79</guid>
		<description><![CDATA[I&#8217;ve now dug a bit deeper into Carlin &#38; Louis (2008) compliments of the end of the semester and have finally gotten around to Bayesian hierarchical modeling. The extensions of Bayesian models to more levels is very easy to do in WinBUGS (or OpenBUGS). Really the only thing you need to specify are priors and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=79&subd=cddesjardins&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve now dug a bit deeper into Carlin &amp; Louis (2008) compliments of the end of the semester and have finally gotten around to Bayesian hierarchical modeling. The extensions of Bayesian models to more levels is very easy to do in WinBUGS (or OpenBUGS). Really the only thing you need to specify are priors and your model. Specification of priors seems to be a relatively simple thing to do in most cases. Priors for most model encountered in social sciences seem often follow Gamma distributions. Adding random effects to a model just requires additional priors for these variables (I believe they&#8217;re referred to as hyperpriors). So in the model you&#8217;ll have priors for precision (the reciprocal of variance), the random effects (often Gamma or Normal), and the fixed effects (often Normal or you could specify a flat or uniform prior). It&#8217;s important to try and pick a conjugate prior. Beyond priors, you just need to specify your model and finally initial values and WinBUGS is ready to roll. Don&#8217;t forget you have to burn in before you simulate. The authors seem to always run MCMC 1000 times before actual simulations.</p>
<p>Later today or in the next few days I plan to run a hierarchical model with achievement as my outcome, students and schools as random effects, and risk status and gender as my independent variables. I will post the WinBUGS code and discuss a little of the model selection done with DIC. Also I will play around with prior specification and see how that affects my estimates and Bayesian CIs.  Note: All the data shared here is simulated and does not represent any projects that I am currently involved.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cddesjardins.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cddesjardins.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cddesjardins.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cddesjardins.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cddesjardins.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cddesjardins.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cddesjardins.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cddesjardins.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cddesjardins.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cddesjardins.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cddesjardins.wordpress.com&blog=7235916&post=79&subd=cddesjardins&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cddesjardins.wordpress.com/2009/05/15/bayesian-hierarchical-modeling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/80c20dd845c14236ac637a03f2899065?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Desjardins</media:title>
		</media:content>
	</item>
	</channel>
</rss>