~l3on/ubuntu/precise/rkward/rebuild1

« back to all changes in this revision

Viewing changes to rkward/plugins/analysis/irt/dichotomous/par_est_2pl.php

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-05-11 21:58:23 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090511215823-m2f3gehcvapwrzgp
Tags: 0.5.0d-0ubuntu1
* New upstream release (LP: #375213)
* Bump Standards-Version to 3.8.1
* Drop cmake, libphon-dev from build-deps
* Update maintainer field

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?
 
2
function preprocess () {
 
3
  // we'll need the ltm package, so in case it's not loaded...
 
4
?>
 
5
  require(ltm)
 
6
<?}
 
7
 
 
8
function calculate () {
 
9
  // let's read all values into php variables for the sake of readable code
 
10
  $constraint   = getRK_val("constraint");
 
11
  $startval     = getRK_val("startval");
 
12
  $startval_mtx = getRK_val("startval_mtx");
 
13
  $naaction     = getRK_val("naaction");
 
14
  $irtparam     = getRK_val("irtparam");
 
15
  $optimeth     = getRK_val("optimeth");
 
16
  $verbose      = getRK_val("verbose");
 
17
  // these are 2pl specific
 
18
  $ghk_2pl      = getRK_val("ghk_2pl");
 
19
  $iterem       = getRK_val("iterem");
 
20
  $iterqn_2pl   = getRK_val("iterqn_2pl");
 
21
  $interact     = getRK_val("interact");
 
22
 
 
23
  ///////////////////////////////////
 
24
  // check for selected advanced control options
 
25
  $control = array() ;
 
26
  if($iterem != "40")
 
27
    $control[] = "iter.em=".$iterem ;
 
28
  if($iterqn_2pl != "150")
 
29
    $control[] = "iter.qN=".$iterqn_2pl ;
 
30
  if($ghk_2pl != "15")
 
31
    $control[] = "GHk=".$ghk_2pl ;
 
32
  if($optimeth != "BFGS")
 
33
    $control[] = "method=\"".$optimeth."\"" ;
 
34
  if($verbose == "TRUE")
 
35
    $control[] ="verbose=TRUE" ;
 
36
 
 
37
?>estimates.2pl <<- ltm(<? getRK("x"); ?> ~ z1<?
 
38
                  // any additional options?
 
39
                  if($interact == "TRUE") echo(" * z2");
 
40
                  if($constraint) echo(", constraint=".$constraint);
 
41
                  if($irtparam != "TRUE") echo(", IRT.param=FALSE");
 
42
                  if($startval == "random") echo(", start.val=\"random\"");
 
43
                  if($startval == "matrix") echo(", start.val=".$startval_mtx);
 
44
                  if($naaction) echo(", na.action=".$naaction);
 
45
                  // finally check if any advanced control options must be inserted
 
46
                  if($control) echo(", control=list(".join(", ", $control).")");
 
47
 ?>)
 
48
<?}
 
49
 
 
50
function printout () {
 
51
?>
 
52
rk.header ("2PL parameter estimation")
 
53
rk.print (estimates.2pl)
 
54
<?
 
55
}
 
56
?>
 
 
b'\\ No newline at end of file'