Page 1 of 1

Number of thresholds to use in hybrid ordered model with no data in one level

Posted: 20 Aug 2020, 15:56
by valeria toledo
Hi, I am trying to estimate a hybrid model with ordered indicators. I have succesfully run this type of model with other datasets previously succesfully, but I have encounter a problem with the current dataset I am using.

I have a variable with the following levels
levels=c(1,2,3,4,5),labels=c("Strongly Disagree","Disagree","Neither","Agree","Strongly Agree")))

I have tried running a ordered logit with 4 taus but I am getting an error.
ol_settings1 = list(outcomeOrdered=concerned,
V=zeta_IND_concerned*LV_IND,
tau=c(tau_IND_concerned_1,
tau_IND_concerned_2,
tau_IND_concerned_3,
tau_IND_concerned_4),
rows=(task==1),
componentName="indic_IND_concerned")
The problem is that for the level "2" I have no data, so basically it means that there are less "treshold coefficients " than 4. Actually if I recode this variable and change the "3"<-2, "4"<-3..so on. and run the model with 3 Taus, the model works perfectly!

So, I have managed to twist the data to run the model but I am not sure it is correct, so I would like to know if its possible to code the "ol_settigs" with 4 steps even though there is no data for one level?

Re: Number of thresholds to use in hybrid ordered model with no data in one level

Posted: 21 Aug 2020, 21:18
by dpalma
Hi Valeria,

Indeed, you cannot estimate thresholds for levels that are not observed. So, as there are no "disagree" responses in you data, you need to drop that level and pretend it doesn't exist, so your model considers only four possible responses. You can implement that in two ways:
  • By subtracting 1 from all responses that are bigger than 2 (as you did) or,
  • Use the "code" option to skip the non-selected level in the model definition, in your case it would be as follows

    Code: Select all

    ol_settings1 = list(outcomeOrdered = concerned,
                        V = zeta_IND_concerned*LV_IND,
                        tau = c(tau_IND_concerned_1,
                                tau_IND_concerned_2,
                                tau_IND_concerned_3,
                                tau_IND_concerned_4),
                        rows = (task==1),
                        coding =c(1,3,4,5),
                        componentName = "indic_IND_concerned")
    I cannot be certain that this will work with your data, as I don't know if your dependant variable (concerned) is stored as a factor or a numeric variable, but try if this works. If it doesn't you can try using code=c("Strongly Disagree","Neither","Agree","Strongly Agree").
Cheers
David

Re: Number of thresholds to use in hybrid ordered model with no data in one level

Posted: 22 Aug 2020, 11:13
by valeria toledo
Hi David,
I saw the coding option from another comment but it didn't occur to me to use it like that. This solution makes the coding much clearer.
Thanks a lot for your reply!

Re: Number of thresholds to use in hybrid ordered model with no data in one level

Posted: 22 Aug 2020, 11:50
by valeria toledo
Hi David,
thanks a lot your time and suggestions. My data has a numeric format, so I tried the coding option as you first suggested (skipping level 2).
Now I am getting a new error:

"Testing probability function (apollo_probabilities)
Error in apollo_ol(ol_settings1, functionality) :
Threshold vector length +1 does not match number of elements in argument 'coding'.
Called from: apollo_ol(ol_settings1, functionality)"

Re: Number of thresholds to use in hybrid ordered model with no data in one level

Posted: 23 Aug 2020, 21:55
by dpalma
Hi Valeria,

As now there are only four different possible levels (1,3,4,5), you only need three thresholds. So the correct code should be:

Code: Select all

ol_settings1 = list(outcomeOrdered = concerned,
                    V = zeta_IND_concerned*LV_IND,
                    tau = c(tau_IND_concerned_1,
                            tau_IND_concerned_3,
                            tau_IND_concerned_4),
                    rows = (task==1),
                    coding =c(1,3,4,5),
                    componentName = "indic_IND_concerned")
Sorry for the mistake.

Cheers
David

Re: Number of thresholds to use in hybrid ordered model with no data in one level

Posted: 24 Aug 2020, 11:03
by valeria toledo
Hi David, that worked perfectly.
Thanks a lot for your time and help, I really appreciate it.

Best
Valeria Toledo