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 33: 3840a3fec345
parent 32: f25783f65bdf
branch: default
Added int check.
Tristan Zajonc / tristanz
6 months ago

Changed (Δ112 bytes):

raw changeset »

Stata/openirt.ado (7 lines added, 6 lines removed)

src/openirt.cpp (2 lines added, 3 lines removed)

src/openirt.h (2 lines added, 1 lines removed)

Up to file-list Stata/openirt.ado:

@@ -52,10 +52,11 @@ program openirt
52
52
	}
53
53
	qui recode _all (.=-9999)
54
54
	qui gen `group' = 1
55
	qui outsheet `id' `group' `theta' `item_prefix'* using openirt_tmp.txt, replace delim(" ") noquote nolabel nonames
55
	tempfile openirt_tmp
56
	qui outsheet `id' `group' `theta' `item_prefix'* using `openirt_tmp', replace delim(" ") noquote nolabel nonames
56
57
	capture erase `response_file'
57
	filefilter openirt_tmp.txt `response_file', from("\r\n") to("\n")
58
	capture erase openirt_tmp.txt
58
	filefilter `openirt_tmp' `response_file', from("\r\n") to("\n")
59
	capture erase `openirt_tmp'
59
60
	
60
61
	* Write out parameter data
61
62
	display as text "Setting up parameter data..."
@@ -111,10 +112,10 @@ program openirt
111
112
	qui compress
112
113
	sort id
113
114
	isid id
114
	qui outsheet id type numcat a b c d1 d2 d3 d4 using openirt_tmp.txt, replace delim(" ") noquote nolabel nonames
115
	qui outsheet id type numcat a b c d1 d2 d3 d4 using `openirt_tmp', replace delim(" ") noquote nolabel nonames
115
116
	capture erase `item_file'
116
	filefilter openirt_tmp.txt `item_file', from("\r\n") to("\n")
117
	capture erase openirt_tmp.txt
117
	filefilter `openirt_tmp' `item_file', from("\r\n") to("\n")
118
	capture erase `openirt_tmp'
118
119
	
119
120
	* Run estimation routine from shell
120
121
	qui findfile openirt.exe

Up to file-list src/openirt.cpp:

30
30
#include "openirt.h"
31
31
32
32
int main(int argc, char* argv[]) {
33
	 // Timer
34
   boost::timer timer;
35
 
33
	// Timer
34
  boost::timer timer;
36
35
  // Process command line and load config file.
37
36
  StartUp(argc, argv);
38
37
	InitResults();

Up to file-list src/openirt.h:

24
24
// OTHER DEALINGS IN THE SOFTWARE.
25
25
26
26
#include "mcmc.h"
27
#include <limits>
27
28
28
29
/// Process command line and config file
29
30
void StartUp(int argc, char* argv[]) {
@@ -99,7 +100,7 @@ void StartUp(int argc, char* argv[]) {
99
100
  responses.num_items = responses.x.cols();
100
101
  responses.num_groups = max(responses.group);
101
102
  cout << "Responses added: " << responses.num_responses << endl;
102
103
  std::out << "Max int limit: " << std::numeric_limits<int>::max() << std::endl;
103
104
}
104
105
105
106
/// 2PL Item Response Functions