StanDCM.ppmc: A function to calculate percentage of extreme p-values for...

Description Usage Arguments Value Author(s) Examples

View source: R/StanDCM.ppmc.R

Description

The StanDCM.ppmc Function to automate Stan code generation for LCDMs with binary responses

Usage

1
2
3
4
5
6
7
8
StanDCM.ppmc(
  stan.model,
  response.matrix,
  n.sim = NULL,
  n.burnin = NULL,
  plot.option = FALSE,
  type = "sumscores"
)

Arguments

stan.model

A rStan object

response.matrix

the response matrix used by RStan Object

n.sim

number of simulations for Posterior Predictive Model Checking

n.burnin

number of burn-in iterations

plot.option

logical. whether to provide a plot for ppmc using ggplot2

type

The test statistics to perform PPMC. The default is "sumscores". Setting "chisq" will calculate the bivariate item Chi square.

Value

p-values tables

Author(s)

Jihong Zhang, University of Iowa, jihong-zhang@uiowa.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
load("data.RData")
Qmatrix<-cbind(Qmatrix,rep(1,9)); Qmatrix[1,1]<-0
dim(respMatrix)
misspecifiedQmatrix <- Qmatrix
misspecifiedQmatrix[1:6,] <- 1-Qmatrix[1:6,]
misspecifiedQmatrix[1,3] = 0
mod2 <- StanDINA.run(misspecifiedQmatrix,response.matrix = respMatrix,iter=100,init.list='cdm', chain.num = 3, warmup = 20)
StanDCM.ppmc(stan.model = mod2, response.matrix = respMatrix, n.sim = 1000, n.burnin = 1, plot.option = FALSE)

## End(Not run)

JihongZ/StanDCM documentation built on June 27, 2020, 7:51 a.m.