Model Predictions for var_estimate Objects

# S3 method for var_estimate
predict(object, summary = TRUE, cred = 0.95, iter = NULL, progress = TRUE, ...)

Arguments

object

object of class var_estimate

summary

summarize the posterior samples (defaults to TRUE).

cred

credible interval used for summarizing

iter

number of posterior samples (defaults to all in the object).

progress

Logical. Should a progress bar be included (defaults to TRUE) ?

...

Currently ignored

Value

The predicted values for each regression model.

Examples

# \donttest{ # data Y <- subset(ifit, id == 1)[,-1] # fit model with alias (var_estimate also works) fit <- var_estimate(Y, progress = FALSE) # fitted values pred <- predict(fit, progress = FALSE) # predicted values (1st outcome) pred[,,1]
#> Post.mean Post.sd Cred.lb Cred.ub #> [1,] 0.560627435 0.2523756 0.070838458 1.05272733 #> [2,] 0.276600157 0.1817005 -0.081306017 0.63086059 #> [3,] -0.083270881 0.3344414 -0.732190556 0.57609139 #> [4,] -0.127521641 0.4020395 -0.904802008 0.67049924 #> [5,] 0.154511004 0.3507406 -0.545024438 0.83927139 #> [6,] 0.374360980 0.1887526 0.007630708 0.74612224 #> [7,] 0.484958878 0.2098394 0.074002470 0.89699830 #> [8,] 0.472030579 0.2458139 -0.008829115 0.95022763 #> [9,] 0.356801474 0.2154501 -0.068015662 0.78417929 #> [10,] 0.428515754 0.1726074 0.089657774 0.77188095 #> [11,] -0.661260511 0.4692029 -1.593498612 0.25146972 #> [12,] -0.565225683 0.4373493 -1.411989383 0.29967663 #> [13,] 0.068798443 0.2595876 -0.437620864 0.58748137 #> [14,] -0.384726637 0.3778110 -1.125819275 0.33773387 #> [15,] 0.087082376 0.1474895 -0.204819584 0.37430464 #> [16,] 0.231765342 0.1989793 -0.164056640 0.61913557 #> [17,] 0.313462717 0.2433768 -0.174918426 0.79055225 #> [18,] 0.200657057 0.2881305 -0.365630710 0.76889322 #> [19,] 0.173187203 0.2515454 -0.315756387 0.67134042 #> [20,] 0.164126120 0.2201185 -0.270417277 0.59758088 #> [21,] -0.327392752 0.3047888 -0.937719359 0.27054878 #> [22,] 0.216396339 0.1681531 -0.109569272 0.54579782 #> [23,] 0.237450797 0.1455088 -0.038825944 0.52022839 #> [24,] 0.091379369 0.3512290 -0.607522790 0.77206820 #> [25,] 0.534926724 0.3147300 -0.085879861 1.15532977 #> [26,] 0.195611974 0.2285409 -0.263447560 0.63703864 #> [27,] 0.214809587 0.1944311 -0.164785830 0.59245745 #> [28,] 0.124687813 0.1496751 -0.167225432 0.40878161 #> [29,] 0.069586858 0.2330248 -0.393799849 0.52529480 #> [30,] -0.231885986 0.1997609 -0.625973893 0.15182580 #> [31,] 0.212720321 0.4073946 -0.600480628 1.03034710 #> [32,] 0.032836244 0.2001304 -0.364911900 0.42755947 #> [33,] -0.216893923 0.1926509 -0.587803997 0.16428769 #> [34,] -0.015999702 0.1874637 -0.382803034 0.34975292 #> [35,] -0.861298083 0.4277906 -1.682123078 -0.01261367 #> [36,] -0.691402316 0.3768820 -1.419753080 0.04418526 #> [37,] -0.680301006 0.4383060 -1.534062544 0.17062741 #> [38,] -0.675622455 0.4602275 -1.591988224 0.22543669 #> [39,] -0.274879407 0.3383689 -0.934719420 0.38471533 #> [40,] 0.183105759 0.1341461 -0.083077595 0.44477399 #> [41,] -0.182431674 0.2009837 -0.576486842 0.20657054 #> [42,] -0.149334324 0.3300779 -0.810610955 0.49732414 #> [43,] 0.018778121 0.2439035 -0.462350733 0.49574900 #> [44,] 0.013133816 0.2077381 -0.402728837 0.41973744 #> [45,] 0.071473834 0.2738050 -0.458813165 0.61002815 #> [46,] 0.270219664 0.1215282 0.030756479 0.51414014 #> [47,] 0.274401852 0.1993999 -0.114986794 0.66654291 #> [48,] -0.304164980 0.3920094 -1.077071644 0.46257546 #> [49,] 0.019560405 0.1234860 -0.225862329 0.25921567 #> [50,] 0.065348395 0.2193078 -0.363589351 0.49308186 #> [51,] 0.045654660 0.1426791 -0.237000798 0.32910518 #> [52,] 0.167487855 0.1602163 -0.150632450 0.47950886 #> [53,] 0.099135289 0.1921146 -0.280341020 0.47781447 #> [54,] 0.160873112 0.1978277 -0.234770494 0.55631851 #> [55,] 0.112458087 0.1497946 -0.186318745 0.39942261 #> [56,] -0.014449534 0.1950580 -0.397640742 0.35609563 #> [57,] 0.521226789 0.2074824 0.120780535 0.93002573 #> [58,] 0.101434338 0.2249844 -0.335290545 0.54071740 #> [59,] 0.270230694 0.3877671 -0.478696541 1.03042153 #> [60,] 0.023285286 0.2581462 -0.483643465 0.52091782 #> [61,] -0.048232630 0.2814648 -0.612961525 0.50153227 #> [62,] -0.198330843 0.2478956 -0.684497259 0.29333361 #> [63,] -0.154084608 0.2258718 -0.594557041 0.29511751 #> [64,] 0.238798752 0.3510233 -0.452468092 0.93882458 #> [65,] 0.090615668 0.4113975 -0.734298523 0.90322920 #> [66,] 0.275598835 0.2200137 -0.153266402 0.70858934 #> [67,] -0.353880978 0.3083065 -0.964427375 0.24538964 #> [68,] 0.213316272 0.1679499 -0.119826349 0.53657196 #> [69,] 0.142398185 0.2489146 -0.330259331 0.61951613 #> [70,] -0.402433503 0.4170258 -1.235959839 0.41890386 #> [71,] 0.068935934 0.2483940 -0.422299463 0.55213897 #> [72,] -0.123113954 0.1974752 -0.515519405 0.26953949 #> [73,] -0.117597767 0.2055160 -0.523274708 0.28638882 #> [74,] -0.101126093 0.2052520 -0.497798851 0.29872519 #> [75,] -0.153432694 0.1682604 -0.476213442 0.18083079 #> [76,] -0.063083851 0.1498825 -0.357863991 0.23039383 #> [77,] -0.176418627 0.1353384 -0.443317469 0.09582333 #> [78,] -0.056466050 0.2842886 -0.616271543 0.51210740 #> [79,] -0.487637853 0.3923318 -1.263649554 0.27444453 #> [80,] 0.093514086 0.2160796 -0.343106794 0.51904052 #> [81,] 0.006162858 0.1007113 -0.188299033 0.20276111 #> [82,] -0.286098115 0.2099627 -0.696018230 0.12774854 #> [83,] -0.435111671 0.3880708 -1.198025791 0.30548781 #> [84,] 0.439650059 0.2594423 -0.052517754 0.94799390 #> [85,] 0.209966325 0.2040420 -0.191705993 0.60919396 #> [86,] 0.132835755 0.3953120 -0.643318726 0.90541448 #> [87,] -0.198695167 0.1688959 -0.532339138 0.13224247 #> [88,] -0.062435099 0.2284181 -0.512220565 0.38383314 #> [89,] -0.290706032 0.2158757 -0.716211268 0.13933132 #> [90,] 0.125263049 0.3400022 -0.521338687 0.78540362 #> [91,] -0.223877748 0.3235152 -0.864820447 0.41884651 #> [92,] -0.148168175 0.2238295 -0.584872299 0.29804325 #> [93,] -0.272816093 0.2827177 -0.823866805 0.27938287
# }