Class: Statsample::SEM
- Inherits:
-
Object
- Object
- Statsample::SEM
- Extended by:
- Forwardable
- Defined in:
- lib/statsample/sem.rb,
lib/statsample/sem/model.rb,
lib/statsample/sem/openmxengine.rb,
lib/statsample/sem/semjfoxengine.rb
Defined Under Namespace
Classes: Model, OpenMxEngine, SemJFoxEngine
Constant Summary collapse
- VERSION =
'0.1.0'
Instance Attribute Summary collapse
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #compute ⇒ Object
- #engine_obj ⇒ Object
-
#initialize(opts = Hash.new, &block) ⇒ SEM
constructor
A new instance of SEM.
- #r_summary ⇒ Object
Constructor Details
#initialize(opts = Hash.new, &block) ⇒ SEM
Returns a new instance of SEM.
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/statsample/sem.rb', line 18 def initialize(opts=Hash.new, &block) default_opts={:name=>"SEM Analysis", :engine=>:sem} @opts=default_opts.merge(opts) @engine_obj=nil @name=@opts.delete :name @engine=@opts.delete :engine @model=Statsample::SEM::Model.new(:name=>@name) if block block.arity<1 ? instance_eval(&block) : block.call(self) end end |
Instance Attribute Details
#engine ⇒ Object
Returns the value of attribute engine.
15 16 17 |
# File 'lib/statsample/sem.rb', line 15 def engine @engine end |
#name ⇒ Object
Returns the value of attribute name.
14 15 16 |
# File 'lib/statsample/sem.rb', line 14 def name @name end |
Instance Method Details
#compute ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/statsample/sem.rb', line 29 def compute @engine_obj=case @engine when :openmx OpenMxEngine.new(@model) when :sem SemJFoxEngine.new(@model) end @engine_obj.compute @engine_obj end |
#engine_obj ⇒ Object
39 40 41 |
# File 'lib/statsample/sem.rb', line 39 def engine_obj @engine_obj||=compute end |
#r_summary ⇒ Object
42 43 44 |
# File 'lib/statsample/sem.rb', line 42 def r_summary engine_obj.r_summary end |