print method for dgo_fit-class objects

get_elapsed_time: extract chain run times from dgo_fit-class objects

summary method for dgo_fit-class objects

summarize method for dgo_fit-class objects

as.data.frame method for dgo_fit-class objects

rhats: extract split R-hats from dgo_fit-class objects

# S4 method for dgo_fit
show(object)

# S4 method for dgo_fit
print(x, ...)

print.dgo_fit(x, ...)

# S4 method for dgo_fit
get_elapsed_time(object, ...)

# S4 method for dgo_fit
summary(object, ..., verbose = FALSE)

# S4 method for dgo_fit
get_posterior_mean(object, pars = "theta_bar", ...)

summarize(x, ...)

# S4 method for dgo_fit
summarize(x, pars = "theta_bar", funs = c("mean", "sd",
  "median", "q_025", "q_975"))

# S3 method for dgo_fit
as.data.frame(x, ..., pars = "theta_bar",
  keep.rownames = FALSE)

rhats(x, ...)

# S4 method for dgo_fit
rhats(x, pars = "theta_bar")

Arguments

object

A dgo_fit-class object

x

A dgo_fit-class object

...

Further arguments to stanfit-class methods.

verbose

Whether to show the full output from the rstan method.

pars

Parameter name(s)

funs

Quoted names of summary functions. `q_025` is accepted as shorthand for `function(x) quantile(x, .025)`, and similarly `q_975`.

keep.rownames

Whether to retain original parameter names with numeric indexes, as output from RStan.

Value

A table giving split R-hats for model parameters

Examples

data(toy_dgirtfit) summarize(toy_dgirtfit)
#> param state race3 year mean sd median q_025 #> 1: theta_bar SC black 2009 2.38534059 2.0905203 1.78508548 0.5454592 #> 2: theta_bar SC black 2010 1.29432287 0.8970033 1.03984168 0.3001794 #> 3: theta_bar SC other 2009 -1.45219991 1.4420309 -1.06769498 -5.2832870 #> 4: theta_bar SC other 2010 0.06047909 0.8231323 0.05652235 -1.6102244 #> 5: theta_bar SC white 2009 -1.76593109 1.4941141 -1.33209918 -5.7727416 #> 6: theta_bar SC white 2010 -1.50148111 1.0729693 -1.23159639 -4.3021890 #> 7: theta_bar VA black 2009 2.18758597 1.8987323 1.69340313 0.4959218 #> 8: theta_bar VA black 2010 1.58467566 1.0397586 1.30697142 0.4353679 #> 9: theta_bar VA other 2009 -1.07409462 1.3340352 -0.73716626 -4.4457165 #> 10: theta_bar VA other 2010 0.35206957 0.6061441 0.29861246 -0.7661858 #> 11: theta_bar VA white 2009 -1.01025758 0.9022485 -0.75410914 -3.4172480 #> 12: theta_bar VA white 2010 -0.85962410 0.6614518 -0.67830912 -2.6348846 #> q_975 #> 1: 9.111421857 #> 2: 3.796029263 #> 3: 0.009404873 #> 4: 1.983181931 #> 5: -0.307192897 #> 6: -0.274740852 #> 7: 7.181299396 #> 8: 4.320350413 #> 9: 0.286921553 #> 10: 1.763698324 #> 11: -0.126133469 #> 12: -0.117435494
data(toy_dgirtfit) # access posterior samples as.data.frame(toy_dgirtfit, pars = 'theta_bar')
#> param state race3 year iteration value #> 1: theta_bar SC black 2009 1 3.5166090 #> 2: theta_bar SC black 2009 2 1.5096366 #> 3: theta_bar SC black 2009 3 1.7412044 #> 4: theta_bar SC black 2009 4 1.8779541 #> 5: theta_bar SC black 2009 5 1.6961017 #> --- #> 9596: theta_bar VA white 2010 796 -0.5914966 #> 9597: theta_bar VA white 2010 797 -2.2654140 #> 9598: theta_bar VA white 2010 798 -1.2288930 #> 9599: theta_bar VA white 2010 799 -1.5256979 #> 9600: theta_bar VA white 2010 800 -0.9425545
data(toy_dgirtfit) rhats(toy_dgirtfit)
#> Error in summary(x, par = pars, verbose = TRUE)$summary: $ operator is invalid for atomic vectors