I am trying to do the IRT group analysis on my data. I am using Stata 15 on Mac.
The problem is that when I try to run the following group analysis, I get an error message "variable type not found (error in option group()) r(111);"
The code I tried to run is as follows: irt rsm q1 q2 q3 q4 q5 q6 q7 q8 q9 q10, group(type) or irt rsm q1 q2 q3 q4 q5 q6 q7 q8 q9 q10, group(group)
My data consists of 10 items in 5-point Likert scale. The data includes a 'type' variable indicating who completed the survey (direct report, parent support/direct report, parent-report). The data looks like this. I have recoded group variable into type, to make it numerical just in case.
input byte(q1 q2 q3 q4 q5 q6 q7 q8 q9 q10) str7 group type
5 4 4 4 4 5 4 4 4 4 "direct" 0
2 5 5 5 4 4 5 5 5 4 "direct" 0
5 1 5 1 5 5 5 5 5 5 "direct" 0
4 4 4 4 4 5 4 3 3 5 "direct" 0
5 5 5 5 5 5 4 5 5 5 "direct" 0
5 4 4 4 4 3 4 22 5 "direct" 0
4 4 4 4 4 4 4 4 3 4 "direct" 0
5 2 4 4 5 4 5 4 4 4 "direct" 0
4 3 4 3 4 4 1 4 4 3 "support" 1
5 5 4 4 4 4 3 4 4 3 "direct" 0
5 5 5 5 5 2 5 5 5 5 "direct" 0
5 4 2 4 5 5 3 4 5 4 "direct" 0
5 4 5 5 5 5 5 5 2 5 "direct" 0
4 3 4 3 5 4 4 4 4 5 "direct" 0
4 5 3 3 4 1 4 3 5 4 "direct" 0
3 5 3 5 4 4 3 4 4 5 "direct" 0
4 3 1 4 4 5 3 4 4 3 "direct" 0
5 4 4 4 3 5 3 4 1 5 "direct" 0
4 3 4 4 3 4 5 4 4 4 "direct" 0
4 1 4 5 3 5 3 4 3 5 "parent" 2
The code "irt rsm q1 q2 q3 q4 q5 q6 q7 q8 q9 q10" does work.
When I tried to run by type (sort: irt rsm q1 q2 q3 q4 q5 q6 q7 q8 q9 q10)
Everything runs fine with the group, direct. Then when it comes to -> group = parent, I get an error message that says
variable _one not allowed
Variable _one is reserved for internal use by irt rsm. drop or rename the existing variable _one
and rerun the command.
r(110);
That said, I tried to run the group analysis with the web data to figure out what I was doing wrong. Then I still get the same error message. The codes I tried were
webuse masc2
irt 2pl q1 q2 q3 q4 q5 q6 q7 q8 q9 , group(female)
And then I get this error message:
variable female not found
(error in option group())
r(111);
Could someone enlighten me on how to handle this?
The problem is that when I try to run the following group analysis, I get an error message "variable type not found (error in option group()) r(111);"
The code I tried to run is as follows: irt rsm q1 q2 q3 q4 q5 q6 q7 q8 q9 q10, group(type) or irt rsm q1 q2 q3 q4 q5 q6 q7 q8 q9 q10, group(group)
My data consists of 10 items in 5-point Likert scale. The data includes a 'type' variable indicating who completed the survey (direct report, parent support/direct report, parent-report). The data looks like this. I have recoded group variable into type, to make it numerical just in case.
input byte(q1 q2 q3 q4 q5 q6 q7 q8 q9 q10) str7 group type
5 4 4 4 4 5 4 4 4 4 "direct" 0
2 5 5 5 4 4 5 5 5 4 "direct" 0
5 1 5 1 5 5 5 5 5 5 "direct" 0
4 4 4 4 4 5 4 3 3 5 "direct" 0
5 5 5 5 5 5 4 5 5 5 "direct" 0
5 4 4 4 4 3 4 22 5 "direct" 0
4 4 4 4 4 4 4 4 3 4 "direct" 0
5 2 4 4 5 4 5 4 4 4 "direct" 0
4 3 4 3 4 4 1 4 4 3 "support" 1
5 5 4 4 4 4 3 4 4 3 "direct" 0
5 5 5 5 5 2 5 5 5 5 "direct" 0
5 4 2 4 5 5 3 4 5 4 "direct" 0
5 4 5 5 5 5 5 5 2 5 "direct" 0
4 3 4 3 5 4 4 4 4 5 "direct" 0
4 5 3 3 4 1 4 3 5 4 "direct" 0
3 5 3 5 4 4 3 4 4 5 "direct" 0
4 3 1 4 4 5 3 4 4 3 "direct" 0
5 4 4 4 3 5 3 4 1 5 "direct" 0
4 3 4 4 3 4 5 4 4 4 "direct" 0
4 1 4 5 3 5 3 4 3 5 "parent" 2
The code "irt rsm q1 q2 q3 q4 q5 q6 q7 q8 q9 q10" does work.
When I tried to run by type (sort: irt rsm q1 q2 q3 q4 q5 q6 q7 q8 q9 q10)
Everything runs fine with the group, direct. Then when it comes to -> group = parent, I get an error message that says
variable _one not allowed
Variable _one is reserved for internal use by irt rsm. drop or rename the existing variable _one
and rerun the command.
r(110);
That said, I tried to run the group analysis with the web data to figure out what I was doing wrong. Then I still get the same error message. The codes I tried were
webuse masc2
irt 2pl q1 q2 q3 q4 q5 q6 q7 q8 q9 , group(female)
And then I get this error message:
variable female not found
(error in option group())
r(111);
Could someone enlighten me on how to handle this?
Comment