Method: GECS.quickMeans

Defined in:
lib/GECS.rb

.quickMeans(bagOfHolding, id) ⇒ Object

Add the following parameter to the data and effects of a specified experiment: mean, original method, 95% confidence. This is a quick way to summarize results when more complicated options are not needed. All values are computed as Floats with no respect for the original data type or its precision.

bagOfHolding

A BagOfHolding.

id

Experiment id.



613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
# File 'lib/GECS.rb', line 613

def GECS.quickMeans(bagOfHolding,id)
  throw "Bag is nil" if bagOfHolding.nil?
  throw "Experiments are nil" if bagOfHolding.experiments.nil?
  throw "No such experiment" if id >= bagOfHolding.experiments.length

  exp = bagOfHolding.experiments[id]
  throw "Null experiment" if exp.nil?
  throw "Null indvars" if exp.indVars.nil?
  throw "Null depvars" if exp.depVars.nil?
  numfacs = exp.indVars.length
  numdeps = exp.depVars.length
  throw "Not enough indvars" if numfacs < 1
  throw "Not enough depvars" if numdeps < 1

  parmDef = ParmDef.new(bagOfHolding.getOrAddParm("mean"),
    bagOfHolding.getOrAddEstMethod("original"),
    {bagOfHolding.getOrAddEstMethodParm("coverage probability")=>0.95})
  meanId = bagOfHolding.getOrAddParmDef(parmDef)
  bagOfHolding.ests ||= Hash.new
  enumerateKeys(bagOfHolding,id).each{|key|
    bagOfHolding.ests[key] ||= Array.new(numdeps,nil)
    for di in 0..numdeps-1
      cell = refactorExtract(bagOfHolding,key,di)
	unless cell.nil?
 bagOfHolding.ests[key][di] ||= Hash.new
 bagOfHolding.ests[key][di][meanId] = quickInterval(cell)
	end
    end
  }
end