Skip to content

Instantly share code, notes, and snippets.

@lokeshh
Created March 26, 2016 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lokeshh/68581abf3cd2a74bea92 to your computer and use it in GitHub Desktop.
Save lokeshh/68581abf3cd2a74bea92 to your computer and use it in GitHub Desktop.
(venv) lokeshh:~/workspace/sciruby-notebooks (update_notebooks) $ gem uninstall statsample
You have requested to uninstall the gem:
statsample-2.0.1
sciruby-full-0.2.7 depends on statsample (~> 2.0)
statsample-bivariate-extension-1.2.0 depends on statsample (~> 2.0)
statsample-glm-0.2.1 depends on statsample (~> 2.0)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN] y
Successfully uninstalled statsample-2.0.1
(venv) lokeshh:~/workspace/sciruby-notebooks (update_notebooks) $ gem uninstall statsample-bivariate-extension
Successfully uninstalled statsample-bivariate-extension-1.2.0
(venv) lokeshh:~/workspace/sciruby-notebooks (update_notebooks) $ gem install statsample-bivariate-extension
Fetching: statsample-2.0.1.gem (100%)
***************************************************
Thanks for installing statsample.
*****************************************************
Successfully installed statsample-2.0.1
Fetching: statsample-bivariate-extension-1.2.0.gem (100%)
Successfully installed statsample-bivariate-extension-1.2.0
2 gems installed
(venv) lokeshh:~/workspace/sciruby-notebooks (update_notebooks) $ irb
2.2.1 :001 > require 'statsample'
=> true
2.2.1 :002 >
2.2.1 :003 > Statsample::Analysis.store(Statsample::Bivariate::Polychoric) do
2.2.1 :004 > ct=Matrix[[rand(10)+50, rand(10)+50, rand(10)+1],
2.2.1 :005 > [rand(20)+5, rand(50)+4, rand(10)+1],
2.2.1 :006 > [rand(8)+1, rand(12)+1, rand(10)+1]]
2.2.1 :007?>
2.2.1 :008 > # Estimation of polychoric correlation using two-step (default)
2.2.1 :009 > poly=polychoric(ct, :name=>"Polychoric with two-step", :debug=>false)
2.2.1 :010?> summary poly
2.2.1 :011?>
2.2.1 :012 > # Estimation of polychoric correlation using joint method (slow)
2.2.1 :013 > poly=polychoric(ct, :method=>:joint, :name=>"Polychoric with joint")
2.2.1 :014?> summary poly
2.2.1 :015?>
2.2.1 :016 > # Uses polychoric series (not recomended)
2.2.1 :017 >
2.2.1 :018 > poly=polychoric(ct, :method=>:polychoric_series, :name=>"Polychoric with polychoric series")
2.2.1 :019?> summary poly
2.2.1 :020?> end
LoadError: cannot load such file -- statsample/bivariate/polychoric
from (irb):3
from /home/ubuntu/.rvm/rubies/ruby-2.2.1/bin/irb:11:in `<main>'
2.2.1 :021 >
2.2.1 :022 > Statsample::Analysis.run_batch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment