summary.bcf | R Documentation |
We strongly suggest updating the coda package to our Github version, which uses the Stan effective size computation. We found the native coda effective size computation to be overly optimistic in some situations and are in discussions with the coda package authors to change it on CRAN.
## S3 method for class 'bcf'
summary(
object,
...,
params_2_summarise = c("sigma", "tau_bar", "mu_bar", "yhat_bar")
)
object |
output from a BCF predict run. |
... |
additional arguments affecting the summary produced. |
params_2_summarise |
parameters to summarise. |
No return value, called for side effects
## Not run:
# data generating process
p = 3 #two control variables and one moderator
n = 250
set.seed(1)
x = matrix(rnorm(n*p), nrow=n)
# create targeted selection
q = -1*(x[,1]>(x[,2])) + 1*(x[,1]<(x[,2]))
# generate treatment variable
pi = pnorm(q)
z = rbinom(n,1,pi)
# tau is the true (homogeneous) treatment effect
tau = (0.5*(x[,3] > -3/4) + 0.25*(x[,3] > 0) + 0.25*(x[,3]>3/4))
# generate the response using q, tau and z
mu = (q + tau*z)
# set the noise level relative to the expected mean function of Y
sigma = diff(range(q + tau*pi))/8
# draw the response variable with additive error
y = mu + sigma*rnorm(n)
# If you didn't know pi, you would estimate it here
pihat = pnorm(q)
bcf_fit = bcf(y, z, x, x, pihat, nburn=2000, nsim=2000)
# Get model fit diagnostics
summary(bcf_fit)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.