# NOT RUN {
f <- blrm(y ~ age + sex)
P <- PostF(f)
P(b2 > 0) # Model is a1 + b1*age + b2*(sex == 'male')
P(b1 < 0 & b2 > 0) # Post prob of a compound assertion
# To compute probabilities using original parameter names:
P <- PostF(f, name='orig')
P(age < 0) # Post prob of negative age effect
P(`sex=male` > 0)
f <- blrm(y ~ sex + pol(age, 2))
P <- PostF(f)
# Compute and plot posterior density of the vertex of the
# quadratic age effect
plot(P(-b2 / (2 * b3)))
# The following would be useful in age and sex interacted
k <- contrast(f, list(age=c(30, 50), sex='male'),
list(age=c(30, 50), sex='female'),
cnames=c('age 30 M-F', 'age 50 M-F'))
P <- PostF(k)
P(`age 30 M-F` > 0 & `age 50 M-F` > 0)
##'
# }
Run the code above in your browser using DataLab