// globals

function preprocess () {
  

echo ('  require(eRm)\n');
}

function calculate () {
  
  design       = getValue("design");
  design_mtx   = getValue("design_mtx");
  etastart     = getValue("etastart");
  etastart_vec = getValue("etastart_vec");
  stderr       = getValue("stderr");
  sumnull      = getValue("sumnull");

echo ('estimates.rsm <<- RSM(' + getValue("x"));
                  
                  if(design == "matrix") echo (", W="+design_mtx);
                  if(stderr != "se") echo (", se=FALSE");
                  if(sumnull != "sum0") echo (", sum0=FALSE");
                  if(etastart == "startval") echo (", etaStart="+etastart_vec);
 echo (')\n');
}

function printout () {
echo ('rk.header ("RSM  parameter estimation")\n');
echo ('rk.print (estimates.rsm)\n');
}
