dgirt returns a fitted model object of class dgirt_fit, which inherits from dgo_fit.

Details

dgo 0.2.8 deprecated the dgirtfit class and replaced it with the dgirt_fit class.

Slots

dgirt_in

dgirtin-class data used to fit the model.

See also

Examples

data(toy_dgirtfit) # summarize the fitted results summary(toy_dgirtfit, pars = 'xi')
#> Error in ss[["summary"]]: subscript out of bounds
# get posterior means with a convenience function get_posterior_mean(toy_dgirtfit, pars = 'theta_bar')
#> param state race3 year mean #> 1: theta_bar SC black 2009 2.38534059 #> 2: theta_bar SC black 2010 1.29432287 #> 3: theta_bar SC other 2009 -1.45219991 #> 4: theta_bar SC other 2010 0.06047909 #> 5: theta_bar SC white 2009 -1.76593109 #> 6: theta_bar SC white 2010 -1.50148111 #> 7: theta_bar VA black 2009 2.18758597 #> 8: theta_bar VA black 2010 1.58467566 #> 9: theta_bar VA other 2009 -1.07409462 #> 10: theta_bar VA other 2010 0.35206957 #> 11: theta_bar VA white 2009 -1.01025758 #> 12: theta_bar VA white 2010 -0.85962410
# generally apply functions to posterior samples after warmup; n.b. # `as.array` is iterations x chains x parameters so `MARGIN = 3` applies # `FUN` over iterations and chains apply(as.array(toy_dgirtfit, pars = 'xi'), 3, mean)
#> xi[1] xi[2] #> 1.6310294 0.1488338
# access the posterior samples head(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 #> 6: theta_bar SC black 2009 6 0.9672285