Skip to content

Instantly share code, notes, and snippets.

@MJacobs1985
Created December 3, 2021 14:56
Show Gist options
  • Select an option

  • Save MJacobs1985/34b9c4197ed53e82fc511fa790f92ed2 to your computer and use it in GitHub Desktop.

Select an option

Save MJacobs1985/34b9c4197ed53e82fc511fa790f92ed2 to your computer and use it in GitHub Desktop.
m13.4 <- ulam(
alist(
ADG ~ dnorm(m0,s0),
m0 <- a[Country]+ b[Year]+c[Treatment],
a[Country] ~ dnorm(m1, s1),
b[Year] ~ dnorm(m2, s2),
c[Treatment] ~ dnorm(m3, s3),
m1 ~ dnorm(38,10),
m2 ~ dnorm(14,5),
m3 ~ dnorm(0,2),
s1 ~ dnorm(6,3),
s2 ~ dnorm(4,2),
s3 ~ dnorm(0.5,0.01),
s0 ~ dnorm(43,6)
), data=d , chains=4 , cores=4 , log_lik=TRUE )
m13.4
precis( m13.4 , depth=2 )
plot( precis(m13.4,depth=2) ) # also plot
show(m13.4)
precis(m13.4 , 2 )
pairs(m13.4 )
traceplot(m13.4)
trankplot(m13.2 )
coef(m13.4)
par(mfrow = c(4, 5))
postcheck(m13.4)
rethinking::compare( m13.1, m13.2, m13.4 )
post <- extract.samples(m13.4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment