tristanz / OpenIRT (http://people.fas.harvard.edu/~tzajonc/openirt.html)

Bayesian and Maximum Likelihood Estimation of Item Response Theory (IRT) Models

Clone this repository (size: 589.9 KB): HTTPS / SSH
$ hg clone http://bitbucket.org/tristanz/openirt
commit 17: 75ee25b40593
parent 16: a5f32ba85c58
branch: default
Changed encoding
Tristan Zajonc / tristanz
8 months ago

Changed (Δ167 bytes):

raw changeset »

Stata/openirt.pkg (24 lines added, 24 lines removed)

Stata/openirt.sthlp (138 lines added, 138 lines removed)

Stata/stata.toc (5 lines added, 5 lines removed)

Up to file-list Stata/openirt.pkg:

1
v 1.0
2
d openirt. Bayesian and Maximum Likelihood Estimation of Item Response Theory (IRT) models.
3
d Tristan Zajonc (tristanz@gmail.com).
4
d
5
d OpenIRT estimates 2PL and 3PL Item Response Theory (IRT) models for dichotomous data.
6
It includes Bayesian MCMC estimation of item parameters and abilities, and maximum
7
likelihood ability estimates.  The Bayesian methods includes both expected 
8
posterior (EAP) and plausible values (PV) ability and item parameter estimates.
9
d
10
d OpenIRT is designed to be flexible. It allows any combination of items, abilities, 
11
and responses to be missing.  For instance, fixed anchor items can be used to place
12
children and items on a known scale; missing responses can be used to link multiple
13
overlapping test forms; and known abilities can be used to calibrate new items 
14
and abilities parameters.
15
16
f openirt.ado
17
f openirt.sthlp
18
G WIN OpenIRT.exe openirt.exe
19
G MAC openirt_osx openirt.exe
20
G LINUX openirt_linux openirt.exe
21
F openirt.ini
22
F naep_children.dta
23
F naep_items.dta
24
F naep.do
1
v 1.0
2
d openirt. Bayesian and Maximum Likelihood Estimation of Item Response Theory (IRT) models.
3
d Tristan Zajonc (tristanz@gmail.com).
4
d
5
d OpenIRT estimates 2PL and 3PL Item Response Theory (IRT) models for dichotomous data.
6
It includes Bayesian MCMC estimation of item parameters and abilities, and maximum
7
likelihood ability estimates.  The Bayesian methods includes both expected 
8
posterior (EAP) and plausible values (PV) ability and item parameter estimates.
9
d
10
d OpenIRT is designed to be flexible. It allows any combination of items, abilities, 
11
and responses to be missing.  For instance, fixed anchor items can be used to place
12
children and items on a known scale; missing responses can be used to link multiple
13
overlapping test forms; and known abilities can be used to calibrate new items 
14
and abilities parameters.
15
16
f openirt.ado
17
f openirt.sthlp
18
G WIN OpenIRT.exe openirt.exe
19
G MAC openirt_osx openirt.exe
20
G LINUX openirt_linux openirt.exe
21
F openirt.ini
22
F naep_children.dta
23
F naep_items.dta
24
F naep.do

Up to file-list Stata/openirt.sthlp:

1
{smcl}
2
{cmd:help openirt} {right: Item Response Theory (IRT) Estimation}
3
{hline}
4
5
{title:Title}
6
7
{p2colset 5 20 22 2}{...}
8
{p2col :{hi:openirt} {hline 2}}Bayesian and Maximum Likelihood Estimation of Item Response Theory Models{p_end}
9
{p2colreset}{...}
10
11
12
{title:Syntax}
13
	
14
{p 8 16 2}
15
{opt openirt} {cmd:,} [{it:options}]
16
17
{synoptset 35 tabbed}{...}
18
{synopthdr}
19
{synoptline}
20
{syntab:Required options}
21
{synopt :{opt id(varname)}}unique respondent ID{p_end}
22
{synopt :{opt item_prefix(name)}}prefix of item variables{p_end}
23
{synopt :{opt save_item_parameters("filename")}}filename to save item parameter estimates{p_end}
24
{synopt :{opt save_trait_parameters("filename")}}filename to save trait/ability parameter estimates{p_end}
25
26
{syntab:Parameter options}
27
{synopt :{opt model("3PL")}}default model type ("2PL" or "3PL"){p_end}
28
{synopt :{opt theta(varname)}}variable name holding fixed trait/ability parameters{p_end}
29
{synopt :{opt fixed_item_file("filename")}}filename holding fixed item parameters{p_end}
30
31
{syntab:MCMC options}
32
{synopt :{opt samplesize(integer 2000)}}Sample size for MCMC estimation{p_end}
33
{synopt :{opt burnin(integer 1000)}}Burn in period for MCMC estimation{p_end}
34
35
{title:Description}
36
37
{pstd}
38
{cmd:openirt} estimates 2PL and 3PL Item Response Theory (IRT) models using both Bayesian MCMC and Maximum Likelihood methods.
39
40
{title:Options}
41
42
{dlgtab:Required Options}
43
44
{phang} 
45
{opt id(varname)} specifies the variable holding the unique integer respondent ID.
46
47
{phang}
48
{opt item_prefix(name)} specifies the prefix used for each item or questions. For instance, item_prefix(item) would select any items with names item# (i.e. item1, item2, item3, etc). Item IDs must be unique but do not need to be contiguous. 
49
50
{phang}
51
{opt save_item_parameters("filename")} specifies the filename where item parameters should be saved. If the file already exists, it will be overwritten.
52
53
{phang} 
54
{opt save_trait_parameters("filename")} specifies the filename where trait/ability parameters should be saved. If the file already exists, it will be overwritten.
55
56
{dlgtab:Parameter Options}
57
58
{phang}
59
{opt model("3PL")} specifies the default model for items.  The default model is the three parameter logistic model (3PL).  {opt model("2PL")} forces the guessing parameter to zero, given the two parameter logistic model.  Fixed items specified in {opt fixed_item_file(filename)} will override the default model type.  This allows a mixture of 3PL and 2PL models.
60
61
{phang}
62
{opt theta(varname)} specifies variable name holding fixed trait or ability parameters.  Any missing entries will be treated as free parameters.
63
64
{phang}
65
{opt fixed_item_file("filename")} specifies filename holding fixed item types and parameters.  The  file must include at least four variables: {it:id}, {it:type}, {it:a}, {it:b}, {it:c}.  {it:id} gives the unique item identifier that matches the {opt item_prefix(name)} id.  {it:type} should equal 1 for 2PL items and 2 for 3PL items. {it:a} is the item discrimination parameter, {it:b} is the item difficulty parameter, and {it:c} is the  item guessing parameter. Note: {cmd: openirt} assumes all items use the normal ogive metric ({it:D = 1.7}).
66
67
{dlgtab:MCMC Options}
68
69
{phang}
70
{opt samplesize(2000)} specifies the number of post burn in MCMC iterations (default = 2000). Plausible values are drawn at evenly spaced intervals from this sample, and EAP estimates are based on the mean of the entire sample. Larger sample sizes will reduce the monte carlo standard error.  In most applications the standard error of measurement dominates the monte carlo standard error after several thousand iterations.
71
72
{phang}
73
{opt burnin(1000)} specifies the number of burn in MCMC iterations (default = 1000).  MCMC estimates rely on the chain converging to a stationary state.  In most IRT applications this occurs quite quickly -- within several hundred iterations.  If estimates do not appear to be converging, increase the burn in period.
74
75
{title:Discussion}
76
77
{pstd}OpenIRT estimates 2PL and 3PL Item Response Theory (IRT) models for dichotomous (correct / incorrect) data using both Bayesian and Maximum Likelihood methods.{p_end}
78
79
{pstd}The software allows for missing (free) and fixed item parameters, abilities, and responses. This allows, for instance, equating of multiple overlapping test forms; equating test forms using a known reference population; and placing students on known ability metric using fixed item parameters from an item data bank such as TIMSS or NAEP (see, e.g, Das and Zajonc(2009)).{p_end}
80
81
{pstd}Unlike some other IRT software, OpenIRT includes both Bayesian MCMC and Maximum Likelihood estimates.  The software estimates expected posterior (EAP), plausible value (PV), and maximum likelihood (MLE) estimates of the underlying latent trait -- often called theta or ability.{p_end}
82
83
{pstd}Plausible values, or multiple imputations, are draws from the posterior of each respondent's ability parameter.  While potentially poor measures of each respondent's ability, plausible values allow accurate estimation of distributional quantities, such as the upper and lower quartiles, or fraction of students passing a particular threshold.  If the number of items is small, EAP and MLE estimates will generally yield very poor estimates of such quantities, with EAP understanding the standard deviation and MLE estimates overestimating the standard deviation.  See Das and Zajonc (2009) and Mislevy et al (1992).{p_end}
84
85
{pstd}{it:Note on speed}: Estimation can be slow due to the large number of free  parameters estimated using MCMC simulation.  Users with large data sets may wish to use small subsamples of data before running an analysis on the full sample.{p_end}
86
87
{title:Examples:  Scoring single form.}
88
89
{phang2}{cmd:. sysuse naep_children, clear}{p_end}
90
{phang2}{cmd:. openirt, id(id) save_item_parameters("items.dta") save_trait_parameters("traits.dta")}{p_end}
91
92
{title:Examples:  Scoring multiple overlapping forms.}
93
94
{phang}Create two overlapping exams:{p_end}
95
{phang2}{cmd:. sysuse naep_children, clear}{p_end}
96
{phang2}{cmd:. recode item1 item2 (0/1 = .) if _n =< 250}{p_end}
97
{phang2}{cmd:. recode item3 item4 (0/1 = .) if _n > 250}{p_end}
98
99
{phang}Score overlapping exams:{p_end}
100
{phang2}{cmd:. openirt, id(id) save_item_parameters("items.dta") save_trait_parameters("traits.dta")}{p_end}
101
102
{title:Examples:  Linking to fixed item parameters.}
103
104
{phang}Create 10 fixed items:{p_end}
105
{phang2}{cmd:. sysuse naep_items, clear}{p_end}
106
{phang2}{cmd:. keep if id < 10}{p_end}
107
{phang2}{cmd:. save fixed_items, replace}{p_end}
108
109
{phang}Score exam using mixed fixed and free items:{p_end}
110
{phang2}{cmd:. sysuse naep_children, clear}{p_end}
111
{phang2}{cmd:. openirt, id(id) save_item_parameters("items.dta") save_trait_parameters("traits.dta") fixed_item_file("fixed_items.dta")}{p_end}
112
113
114
{title:References}
115
116
{phang}
117
Das, J. and Zajonc, T. (2009)
118
"India shining and Bharat drowning: Comparing two Indian states to the worldwide distribution in mathematics achievement {it:Journal of Development Economics}
119
120
{phang}
121
Mislevy, R.J. and Beaton, A.E. and Kaplan, B. and Sheehan, K.M. (1992) "Estimating population characteristics from sparse matrix samples of item responses" {it:Journal of Educational Measurement}. 29:2
122
123
{phang}
124
Patz, R.J. and Junker, B.W. (1999) "A straightforward approach to Markov chain Monte Carlo methods for item response models" {it:Journal of Educational and Behavioral Statistics}. 24:2
125
126
{phang} 
127
Van der Linden, W.J. and Hambleton, R.K. (1997) {it:Handbook of modern item response theory}. Springer Verlag.
128
129
{title:Author}
130
131
{pstd}Tristan Zajonc{p_end}
132
{pstd}John F. Kennedy School of Government{p_end}
133
{pstd}Harvard University, Cambridge, MA 02138.{p_end}
134
{pstd}Email: tristanz@gmail.com{p_end}
135
{pstd}Web: http://ksghome.harvard.edu/~zajonct/{p_end}
136
137
138
1
{smcl}
2
{cmd:help openirt} {right: Item Response Theory (IRT) Estimation}
3
{hline}
4
5
{title:Title}
6
7
{p2colset 5 20 22 2}{...}
8
{p2col :{hi:openirt} {hline 2}}Bayesian and Maximum Likelihood Estimation of Item Response Theory Models{p_end}
9
{p2colreset}{...}
10
11
12
{title:Syntax}
13
	
14
{p 8 16 2}
15
{opt openirt} {cmd:,} [{it:options}]
16
17
{synoptset 35 tabbed}{...}
18
{synopthdr}
19
{synoptline}
20
{syntab:Required options}
21
{synopt :{opt id(varname)}}unique respondent ID{p_end}
22
{synopt :{opt item_prefix(name)}}prefix of item variables{p_end}
23
{synopt :{opt save_item_parameters("filename")}}filename to save item parameter estimates{p_end}
24
{synopt :{opt save_trait_parameters("filename")}}filename to save trait/ability parameter estimates{p_end}
25
26
{syntab:Parameter options}
27
{synopt :{opt model("3PL")}}default model type ("2PL" or "3PL"){p_end}
28
{synopt :{opt theta(varname)}}variable name holding fixed trait/ability parameters{p_end}
29
{synopt :{opt fixed_item_file("filename")}}filename holding fixed item parameters{p_end}
30
31
{syntab:MCMC options}
32
{synopt :{opt samplesize(integer 2000)}}Sample size for MCMC estimation{p_end}
33
{synopt :{opt burnin(integer 1000)}}Burn in period for MCMC estimation{p_end}
34
35
{title:Description}
36
37
{pstd}
38
{cmd:openirt} estimates 2PL and 3PL Item Response Theory (IRT) models using both Bayesian MCMC and Maximum Likelihood methods.
39
40
{title:Options}
41
42
{dlgtab:Required Options}
43
44
{phang} 
45
{opt id(varname)} specifies the variable holding the unique integer respondent ID.
46
47
{phang}
48
{opt item_prefix(name)} specifies the prefix used for each item or questions. For instance, item_prefix(item) would select any items with names item# (i.e. item1, item2, item3, etc). Item IDs must be unique but do not need to be contiguous. 
49
50
{phang}
51
{opt save_item_parameters("filename")} specifies the filename where item parameters should be saved. If the file already exists, it will be overwritten.
52
53
{phang} 
54
{opt save_trait_parameters("filename")} specifies the filename where trait/ability parameters should be saved. If the file already exists, it will be overwritten.
55
56
{dlgtab:Parameter Options}
57
58
{phang}
59
{opt model("3PL")} specifies the default model for items.  The default model is the three parameter logistic model (3PL).  {opt model("2PL")} forces the guessing parameter to zero, given the two parameter logistic model.  Fixed items specified in {opt fixed_item_file(filename)} will override the default model type.  This allows a mixture of 3PL and 2PL models.
60
61
{phang}
62
{opt theta(varname)} specifies variable name holding fixed trait or ability parameters.  Any missing entries will be treated as free parameters.
63
64
{phang}
65
{opt fixed_item_file("filename")} specifies filename holding fixed item types and parameters.  The  file must include at least four variables: {it:id}, {it:type}, {it:a}, {it:b}, {it:c}.  {it:id} gives the unique item identifier that matches the {opt item_prefix(name)} id.  {it:type} should equal 1 for 2PL items and 2 for 3PL items. {it:a} is the item discrimination parameter, {it:b} is the item difficulty parameter, and {it:c} is the  item guessing parameter. Note: {cmd: openirt} assumes all items use the normal ogive metric ({it:D = 1.7}).
66
67
{dlgtab:MCMC Options}
68
69
{phang}
70
{opt samplesize(2000)} specifies the number of post burn in MCMC iterations (default = 2000). Plausible values are drawn at evenly spaced intervals from this sample, and EAP estimates are based on the mean of the entire sample. Larger sample sizes will reduce the monte carlo standard error.  In most applications the standard error of measurement dominates the monte carlo standard error after several thousand iterations.
71
72
{phang}
73
{opt burnin(1000)} specifies the number of burn in MCMC iterations (default = 1000).  MCMC estimates rely on the chain converging to a stationary state.  In most IRT applications this occurs quite quickly -- within several hundred iterations.  If estimates do not appear to be converging, increase the burn in period.
74
75
{title:Discussion}
76
77
{pstd}OpenIRT estimates 2PL and 3PL Item Response Theory (IRT) models for dichotomous (correct / incorrect) data using both Bayesian and Maximum Likelihood methods.{p_end}
78
79
{pstd}The software allows for missing (free) and fixed item parameters, abilities, and responses. This allows, for instance, equating of multiple overlapping test forms; equating test forms using a known reference population; and placing students on known ability metric using fixed item parameters from an item data bank such as TIMSS or NAEP (see, e.g, Das and Zajonc(2009)).{p_end}
80
81
{pstd}Unlike some other IRT software, OpenIRT includes both Bayesian MCMC and Maximum Likelihood estimates.  The software estimates expected posterior (EAP), plausible value (PV), and maximum likelihood (MLE) estimates of the underlying latent trait -- often called theta or ability.{p_end}
82
83
{pstd}Plausible values, or multiple imputations, are draws from the posterior of each respondent's ability parameter.  While potentially poor measures of each respondent's ability, plausible values allow accurate estimation of distributional quantities, such as the upper and lower quartiles, or fraction of students passing a particular threshold.  If the number of items is small, EAP and MLE estimates will generally yield very poor estimates of such quantities, with EAP understanding the standard deviation and MLE estimates overestimating the standard deviation.  See Das and Zajonc (2009) and Mislevy et al (1992).{p_end}
84
85
{pstd}{it:Note on speed}: Estimation can be slow due to the large number of free  parameters estimated using MCMC simulation.  Users with large data sets may wish to use small subsamples of data before running an analysis on the full sample.{p_end}
86
87
{title:Examples:  Scoring single form.}
88
89
{phang2}{cmd:. sysuse naep_children, clear}{p_end}
90
{phang2}{cmd:. openirt, id(id) save_item_parameters("items.dta") save_trait_parameters("traits.dta")}{p_end}
91
92
{title:Examples:  Scoring multiple overlapping forms.}
93
94
{phang}Create two overlapping exams:{p_end}
95
{phang2}{cmd:. sysuse naep_children, clear}{p_end}
96
{phang2}{cmd:. recode item1 item2 (0/1 = .) if _n =< 250}{p_end}
97
{phang2}{cmd:. recode item3 item4 (0/1 = .) if _n > 250}{p_end}
98
99
{phang}Score overlapping exams:{p_end}
100
{phang2}{cmd:. openirt, id(id) save_item_parameters("items.dta") save_trait_parameters("traits.dta")}{p_end}
101
102
{title:Examples:  Linking to fixed item parameters.}
103
104
{phang}Create 10 fixed items:{p_end}
105
{phang2}{cmd:. sysuse naep_items, clear}{p_end}
106
{phang2}{cmd:. keep if id < 10}{p_end}
107
{phang2}{cmd:. save fixed_items, replace}{p_end}
108
109
{phang}Score exam using mixed fixed and free items:{p_end}
110
{phang2}{cmd:. sysuse naep_children, clear}{p_end}
111
{phang2}{cmd:. openirt, id(id) save_item_parameters("items.dta") save_trait_parameters("traits.dta") fixed_item_file("fixed_items.dta")}{p_end}
112
113
114
{title:References}
115
116
{phang}
117
Das, J. and Zajonc, T. (2009)
118
"India shining and Bharat drowning: Comparing two Indian states to the worldwide distribution in mathematics achievement {it:Journal of Development Economics}
119
120
{phang}
121
Mislevy, R.J. and Beaton, A.E. and Kaplan, B. and Sheehan, K.M. (1992) "Estimating population characteristics from sparse matrix samples of item responses" {it:Journal of Educational Measurement}. 29:2
122
123
{phang}
124
Patz, R.J. and Junker, B.W. (1999) "A straightforward approach to Markov chain Monte Carlo methods for item response models" {it:Journal of Educational and Behavioral Statistics}. 24:2
125
126
{phang} 
127
Van der Linden, W.J. and Hambleton, R.K. (1997) {it:Handbook of modern item response theory}. Springer Verlag.
128
129
{title:Author}
130
131
{pstd}Tristan Zajonc{p_end}
132
{pstd}John F. Kennedy School of Government{p_end}
133
{pstd}Harvard University, Cambridge, MA 02138.{p_end}
134
{pstd}Email: tristanz@gmail.com{p_end}
135
{pstd}Web: http://ksghome.harvard.edu/~zajonct/{p_end}
136
137
138

Up to file-list Stata/stata.toc:

1
v 1.0
2
d Stata programs by Tristan Zajonc
3
4
d Here are some potentially useful things I have written:
5
1
v 1.0
2
d Stata programs by Tristan Zajonc
3
4
d Here are some potentially useful things I have written:
5
6
6
p openirt Bayesian and Maximum Likelihood Estimation of Item Response Theory (IRT) models.