WebBUGS >> Main page Recent changes Show source History

Built-in models:2PL

Model

Let \(y_{ij}, i=1,\ldots,N, j=1,\ldots,T\) denote the response for person \(i\) on item \(j\) that takes value 0 or 1. The 2PL model can be written as

\[ y_{ij} \sim B(p_{ij}) \] \[ \log\frac{p_{ij} }{1-p_{ij} } = \alpha_j(\theta_i - \beta_j) \] \[ \theta_i \sim N(0,1) \]

where \(\theta_i\) is the latent trait for person \(i\), \(\beta_j\) is the item difficulty parameter and \(\alpha_j\) is the item discrimination parameter for item \(j\).

BUGS code

model{
  for (i in 1:N){
    for (j in 1:T){
  #Change logit to probit for ogive model
      logit(p[i,j])<-alpha[j]*(theta[i]-beta[j])
      y[i,j]~dbern(p[i,j])
    }
    theta[i]~dnorm(0,1)
  }
  for (j in 1:T){
    alpha[j]~dnorm(0,.0001)
    beta[j]~dnorm(0, .0001)
  }
}


Powered by LionWiki. Last changed: 2014/11/11 21:49 Erase cookies Show source History