skipTrack.results | R Documentation |
This function calculates inference results on Betas, Gammas, and cijs based on the provided MCMC results. It returns summaries such as credible intervals for Betas, Gammas, wald-type confidence intervals for cijs, and Gelman-Rubin PSRF diagnostics for all 3. Note that true values and converage are included in the output if trueVals is supplied, but otherwise not.
skipTrack.results(stFit, trueVals = NULL, burnIn = 750)
stFit |
Object result of skipTrack.fit function. |
trueVals |
Optional named list containing true values for Betas, Gammas, and cijs. (Also can use output of skipTrack.simulate) |
burnIn |
Number of MCMC iterations to discard as burn-in per chain. |
A list containing the following elements:
Betas |
data.frame with 95% credible intervals and (if trueVals is supplied) true values for Betas and Coverage tag. |
Gammas |
data.frame with 95% credible intervals and (if trueVals is supplied) true values for Gammas and Coverage tag. |
cijs |
data.frame with Wald-type 95% confidence intervals and (if trueVals is supplied) true values for cijs and Coverage tags. |
Diagnostics |
data.frame with ess and gelman-rubin diagnostics from genMCMCDiag package, for parameter sets 'Betas', 'Gammas' and 'cijs'. |
#Simulated data
simDat <- skipTrack.simulate(n = 100, skipProb = c(.7, .2, .1))
#Run model fit (should typically run with much more than 50 reps)
modFit <- skipTrack.fit(Y = simDat$Y, cluster = simDat$cluster, chains = 2, reps = 50)
modFit
# If using simulated data (which includes access to ground truth):
#
skipTrack.results(modFit, trueVals = simDat, burnIn = 25)
#Recommended burnIn with real data is at least 750
#
# If not using simulated data:
#
skipTrack.results(modFit, burnIn = 25)
#Recommended burnIn with real data is at least 750
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.