Webjags >> Main page Recent changes History

Built-in models_3PL

Difference between revisions from 2013/12/26 21:10 and 2013/12/26 21:02.
!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)
p_{ij} = c_j + \frac{1-c_j}{1+\exp[-\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\).
where \(\theta_i\) is the latent trait for person \(i\), \(\beta_j\) is the item difficulty parameter,  \(\alpha_j\) is the item discrimination parameter and \(c_j\) is a guessing parameter for item \(j\).

!BUGS code

{{
model{
for (i in 1:N){
for (j in 1:T){
p[i,j]<-upp[i,j]/lowp[i,j]
p[i,j]<-c[j]+(1-c[j])/(1+exp(-alpha[j]*(theta[i]-beta[j])))
upp[i,j]<-gamma[j]+alpha[j]*(theta[i]-beta[j])
lowp[i,j]<-1+alpha[j]*(theta[i]-beta[j])
theta[i]~dnorm(0,1)
}
for (j in 1:T){
alpha[j]~dnorm(0,.0001)
beta[j]~dnorm(0, .0001)
c[j]~dnorm(0,.001)
}
gamma[j]~dnorm(0,.001)I(0,)
}}




Powered by LionWiki. Last changed: 2024/12/10 23:04 Erase cookies History