Multiple Group

158 views
Skip to first unread message

Caio Lucidius Naberezny Azevedo

unread,
Sep 17, 2017, 9:39:10 PM9/17/17
to mirt-package
Hi,

I have a total of 80 items and 4 groups (named 1,2,3,4).  Items 1-20 are the same for groups 1 and 2, 21-40 for groups 2 and 3, 41-60 for groups 3 and 4. Items 61-80 are exclusive applied to group 4. I have tried the following syntax:

("grupos" is a factor vector with characters "1","2","3","4") "mYmirt" is a 0 and 1 matrix with NA to not observed response (also indicating the incomplete design above described)

name <- 'old2PL'
par <- c(a=1,b = -2)
est <- c(TRUE,TRUE)
P.old2PL <- function(par,Theta, ncat){
  b <- par[2]
  a <- par[1]
  P1 <- 1 / (1 + exp(-1*a*(Theta - b)))
  cbind(1-P1, P1)
}
lbound <- c(0, -Inf)
ubound <- c(Inf, Inf)

P.old2PLfunc <- createItem(name, par=par,lbound=lbound, ubound=ubound, est=est, P=P.old2PL)

model.group <- mirt.model('F = 1-80,
                          CONSTRAINB = (1-20,a,c(1,2)),(1-20,b,c(1,2)),
                          CONSTRAINB = (21-40,a,c(2,3)),(21-40,b,c(2,3)),
                          CONSTRAINB = (41-60,a,c(3,4)),(41-60,b,c(3,4)),
                          PRIOR = (1-80, a, lnorm, 0.1991, 0,8143), 
                          (1-80, b, norm, 0, 1)')

mg <- multipleGroup(mYmirt, model=model.group ,group = grupos,
                    c(rep('old2PL',vI)),customItems=list(old2PL=P.old2PLfunc), 
                    SE=TRUE,method='EM',
                    quadpts=40,TOL=0.001,
                    invariance=c('free_means','free_var'))

Which returned the following message:

Error: Prior type specified in PRIOR = ... not available
In addition: Warning message:
In UpdatePrior(PrepList, model, groupNames = Data$groupNames) :
  NAs introduced by coercion

Could anyone help me?

Thanks a lot,

Caio

Phil Chalmers

unread,
Sep 17, 2017, 10:23:06 PM9/17/17
to Caio Lucidius Naberezny Azevedo, mirt-package
On Sun, Sep 17, 2017 at 9:39 PM, Caio Lucidius Naberezny Azevedo <cna...@gmail.com> wrote:
Hi,

I have a total of 80 items and 4 groups (named 1,2,3,4).  Items 1-20 are the same for groups 1 and 2, 21-40 for groups 2 and 3, 41-60 for groups 3 and 4. Items 61-80 are exclusive applied to group 4. I have tried the following syntax:

("grupos" is a factor vector with characters "1","2","3","4") "mYmirt" is a 0 and 1 matrix with NA to not observed response (also indicating the incomplete design above described)

name <- 'old2PL'
par <- c(a=1,b = -2)
est <- c(TRUE,TRUE)
P.old2PL <- function(par,Theta, ncat){
  b <- par[2]
  a <- par[1]
  P1 <- 1 / (1 + exp(-1*a*(Theta - b)))
  cbind(1-P1, P1)
}
lbound <- c(0, -Inf)
ubound <- c(Inf, Inf)

P.old2PLfunc <- createItem(name, par=par,lbound=lbound, ubound=ubound, est=est, P=P.old2PL)

model.group <- mirt.model('F = 1-80,
                          CONSTRAINB = (1-20,a,c(1,2)),(1-20,b,c(1,2)),
                          CONSTRAINB = (21-40,a,c(2,3)),(21-40,b,c(2,3)),
                          CONSTRAINB = (41-60,a,c(3,4)),(41-60,b,c(3,4)),
                          PRIOR = (1-80, a, lnorm, 0.1991, 0,8143), 

I think you mean 0.8143 rather than 0,8143. The c(1,2) also look peculiar in the CONSTRAINB portions. 

Also, is there some reason you prefer to use the customized classical IRT form instead of the default item types? The discrimination-difficulty parameterization is not as stable as the slope intercept form; I imagine this is to compare to more historical programs, such as BILOG-MG. 

Phil
 
                          (1-80, b, norm, 0, 1)')

mg <- multipleGroup(mYmirt, model=model.group ,group = grupos,
                    c(rep('old2PL',vI)),customItems=list(old2PL=P.old2PLfunc), 
                    SE=TRUE,method='EM',
                    quadpts=40,TOL=0.001,
                    invariance=c('free_means','free_var'))

Which returned the following message:

Error: Prior type specified in PRIOR = ... not available
In addition: Warning message:
In UpdatePrior(PrepList, model, groupNames = Data$groupNames) :
  NAs introduced by coercion

Could anyone help me?

Thanks a lot,

Caio

--
You received this message because you are subscribed to the Google Groups "mirt-package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Caio Lucidius Naberezny Azevedo

unread,
Sep 18, 2017, 8:10:36 AM9/18/17
to mirt-package
Hi Phil,

Thanks. Indeed, there was an error. It should be "0.8143". Now the message is : "Parameter 'a' does not exist for item 1". I consider the original parameterization since I am interested in the respective standar errors and, as far as I know, I would need to use the Delta method, for example, if I consider the mirt's parameterization. Also, the "c(1,2)" referres to that I want to keep that parameters as the same between groups 1 and 2. I could not find any example about the use of "OptionalGroup" argument, so I tried that. I could not find any example about the use of "OptionalGroup".

Best,

Caio

Phil Chalmers

unread,
Sep 19, 2017, 6:32:43 AM9/19/17
to Caio Lucidius Naberezny Azevedo, mirt-package
On Mon, Sep 18, 2017 at 8:10 AM, Caio Lucidius Naberezny Azevedo <cna...@gmail.com> wrote:
Hi Phil,

Thanks. Indeed, there was an error. It should be "0.8143". Now the message is : "Parameter 'a' does not exist for item 1".

Hmm, this could be a bug. I'll have to check it out, as I don't think I've ever tested custom itemtypes with syntax intended for between-group constraints. 
 
I consider the original parameterization since I am interested in the respective standar errors and, as far as I know, I would need to use the Delta method, for example, if I consider the mirt's parameterization.

To each their own, but I have many negative opinions about the 'difficulty' parameter. 
 
Also, the "c(1,2)" referres to that I want to keep that parameters as the same between groups 1 and 2. I could not find any example about the use of "OptionalGroup" argument, so I tried that. I could not find any example about the use of "OptionalGroup".

Right, this looks like an omission on my part in the syntax. I'll have to add it into the package at some point. Sorry for the annoyance. In the meantime, if you want to specify some list of constraints given the starting value labels, then that's possible:

sv <- multipleGroup(..., pars = 'values')
View(sv)
constrains <- list(c(1,2), ....)
model <- multipleGroup(..., constrain=constraints)
 
HTH. 

Phil

--

Caio Lucidius Naberezny Azevedo

unread,
Sep 20, 2017, 1:44:55 PM9/20/17
to mirt-package

Hi Phil,

Thank you very much for your answer. I was talking to a coleague of mine, he is also a "mirt" user, and he told me that it is not necessary to inform to "mirt"  among which tests the items are common, since mirt recognizes that through the item names. I runned with succes a modified sytax and it seems that worked well. However, I have other points:

1. It seems that more care is necessary on the choice the item hyperparameters (command PRIOR) since the multipleGroup did no run, in my case, for some choices. In these cases, I got the message “Prior type specified in PRIOR = ... not available”

2. I was not able to consider a user specified item response function using creatItem function along with multipleGroup function. I got the message “ Parameter 'a' does not exist for item 1”. It seems, as you said, that there is some bug. Let me know if I can help you on this. 

Which negative opinions do you have about the "difficulty" parameter?

Best,

Caio
To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package...@googlegroups.com.

Phil Chalmers

unread,
Sep 21, 2017, 8:44:12 AM9/21/17
to Caio Lucidius Naberezny Azevedo, mirt-package
On Wed, Sep 20, 2017 at 1:44 PM, Caio Lucidius Naberezny Azevedo <cna...@gmail.com> wrote:

Hi Phil,

Thank you very much for your answer. I was talking to a coleague of mine, he is also a "mirt" user, and he told me that it is not necessary to inform to "mirt"  among which tests the items are common, since mirt recognizes that through the item names. I runned with succes a modified sytax and it seems that worked well. However, I have other points:

1. It seems that more care is necessary on the choice the item hyperparameters (command PRIOR) since the multipleGroup did no run, in my case, for some choices. In these cases, I got the message “Prior type specified in PRIOR = ... not available”

Which priors are you seeing this issue with? This could be related to the customItem inputs as well, but this has been tested in the past and should be working.

2. I was not able to consider a user specified item response function using creatItem function along with multipleGroup function. I got the message “ Parameter 'a' does not exist for item 1”. It seems, as you said, that there is some bug. Let me know if I can help you on this. 


If you wouldn't mind, could you open a simple reproducible issue on the Github repository? It doesn't have to be your data (simulated via simdata() is fine), just so long as I can reproduce it quickly.
 
Which negative opinions do you have about the "difficulty" parameter?

This paper should demonstrate my opinions pretty well, though I've talked about this on the forum as well: http://www.tandfonline.com/doi/full/10.1080/00273171.2017.1329082
 
To unsubscribe from this group and stop receiving emails from it, send an email to mirt-package+unsubscribe@googlegroups.com.

Caio Lucidius Naberezny Azevedo

unread,
Oct 2, 2017, 9:38:26 AM10/2/17
to mirt-package
Dear Phil,

Thanks for the answer and for the reference. I apologize for the delay in answering. I never used Github before but I will try to let available the example as soon as possible, maybe with a short description.

Best,

Caio

Phil Chalmers

unread,
Nov 15, 2017, 4:04:37 PM11/15/17
to Caio Lucidius Naberezny Azevedo, mirt-package
Just a follow-up, this issue is likely now fixed on the latest dev version due to a reorganisation of the internal syntax. There's also new specification options for declare priors, constraints, and so on within each group, rather than across all sub-groups. Cheers.

Phil
Reply all
Reply to author
Forward
0 new messages