statsample 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e32ce8b87a157542c8041bf3889f54813676210e
4
- data.tar.gz: 8278c505bf3784168686f38127cb0cd77dde09c1
3
+ metadata.gz: 5515b5f0d30630f682398136f8f39bbf218ff9ad
4
+ data.tar.gz: 333e360a7c490ab5b10f3f76aa0852ec34be63e2
5
5
  SHA512:
6
- metadata.gz: 2f89743784e92b0f86d1bc689c04aad9410b106b03227af73ca42f04a574f3127209c13e08923045f2962e286cbe45019bd3da1493a0a7cf2475ff42d75c6ee8
7
- data.tar.gz: ae6ee9a5b2c52d273f665e428bfc2de1fc7cd6ff78f3ef9b32711848a2c9bf5d6b2f73047786999b07d15c0b0b97f6a5373aab8a6475957cebab1250b8e765c6
6
+ metadata.gz: 05c837e2b3058784a2b7073f64decf414afeaf8d755964f0997c8b5536c9e18337b1eec61663e2111febe87a3e83388689f65f3e36300ca7a7a177ddad0ef3b7
7
+ data.tar.gz: 4f8df36dc6b8cb62c1fe5c37e60c5ad04b387f0e6a0d684efc58beb2fae2998a81f4898aeab3402dbfc221a603b010bff37c8e34f70da575dd8b5b47a7d073c6
@@ -0,0 +1,15 @@
1
+ language:
2
+ ruby
3
+
4
+ rvm:
5
+ - '1.9.3'
6
+ - '2.0.0'
7
+ - '2.1.1'
8
+
9
+ script:
10
+ bundle exec rake test
11
+
12
+ before_install:
13
+ - sudo apt-get update -qq
14
+ - sudo apt-get install -y libgsl0-dev r-base r-base-dev
15
+ - sudo Rscript -e "install.packages(c('Rserve','irr'),,'http://cran.us.r-project.org')"
data/Gemfile CHANGED
@@ -5,5 +5,13 @@ gem 'mocha', '0.14.0' #:require=>'mocha/setup'
5
5
  gem 'shoulda','3.5.0'
6
6
  gem 'shoulda-matchers','2.2.0'
7
7
  gem 'hoe'
8
- gem 'bio-statsample-timeseries'
8
+ #gem 'bio-statsample-timeseries'
9
9
  gem 'reportbuilder'
10
+ gem 'dirty-memoize'
11
+ gem 'distribution'
12
+ gem 'extendmatrix'
13
+ gem 'minimization'
14
+ gem 'rserve-client'
15
+ gem 'rubyvis'
16
+ gem 'spreadsheet'
17
+ gem 'rb-gsl'
@@ -1,28 +1,27 @@
1
1
  GEM
2
2
  remote: https://www.rubygems.org/
3
3
  specs:
4
- activesupport (3.2.10)
5
- i18n (~> 0.6)
6
- multi_json (~> 1.0)
7
- bio-statsample-timeseries (0.2.1)
8
- activesupport (= 3.2.10)
9
- statsample (= 1.2.0)
4
+ activesupport (4.1.1)
5
+ i18n (~> 0.6, >= 0.6.9)
6
+ json (~> 1.7, >= 1.7.7)
7
+ minitest (~> 5.1)
8
+ thread_safe (~> 0.1)
9
+ tzinfo (~> 1.1)
10
10
  clbustos-rtf (0.4.2)
11
11
  dirty-memoize (0.0.4)
12
12
  distribution (0.7.0)
13
13
  extendmatrix (0.3.1)
14
- fastercsv (1.5.5)
15
- hoe (3.4.0)
14
+ hoe (3.12.0)
16
15
  rake (>= 0.8, < 11.0)
17
- i18n (0.6.5)
18
- json (1.7.6)
19
- metaclass (0.0.1)
16
+ i18n (0.6.9)
17
+ json (1.8.1)
18
+ metaclass (0.0.4)
20
19
  minimization (0.2.1)
21
20
  text-table (~> 1.2)
22
- minitest (4.3.3)
21
+ minitest (5.3.5)
23
22
  mocha (0.14.0)
24
23
  metaclass (~> 0.0.1)
25
- multi_json (1.8.0)
24
+ narray (0.6.0.9)
26
25
  prawn (0.8.4)
27
26
  prawn-core (>= 0.8.4, < 0.9)
28
27
  prawn-layout (>= 0.8.4, < 0.9)
@@ -32,49 +31,48 @@ GEM
32
31
  prawn-security (0.8.4)
33
32
  prawn-svg (0.9.1.11)
34
33
  prawn (>= 0.8.4)
35
- rake (10.0.3)
36
- rdoc (3.12)
34
+ rake (10.3.2)
35
+ rb-gsl (1.16.0.1)
36
+ narray (>= 0.5.9)
37
+ rdoc (4.1.1)
37
38
  json (~> 1.4)
38
39
  reportbuilder (1.4.2)
39
40
  clbustos-rtf (~> 0.4.0)
40
41
  prawn (~> 0.8.4)
41
42
  prawn-svg (~> 0.9.1)
42
43
  text-table (~> 1.2)
43
- rserve-client (0.2.5)
44
+ rserve-client (0.3.1)
44
45
  ruby-ole (1.2.11.7)
45
46
  rubyvis (0.6.0)
46
47
  shoulda (3.5.0)
47
48
  shoulda-context (~> 1.0, >= 1.0.1)
48
49
  shoulda-matchers (>= 1.4.1, < 3.0)
49
- shoulda-context (1.1.5)
50
+ shoulda-context (1.2.1)
50
51
  shoulda-matchers (2.2.0)
51
52
  activesupport (>= 3.0.0)
52
- spreadsheet (0.6.9)
53
+ spreadsheet (0.9.7)
53
54
  ruby-ole (>= 1.0)
54
- statsample (1.2.0)
55
- dirty-memoize (~> 0.0)
56
- distribution (~> 0.6)
57
- extendmatrix (~> 0.3.1)
58
- fastercsv (> 0)
59
- minimization (~> 0.2.0)
60
- reportbuilder (~> 1.4)
61
- rserve-client (~> 0.2.5)
62
- rubyvis (~> 0.5)
63
- spreadsheet (~> 0.6.5)
64
- statsample-bivariate-extension (> 0)
65
- statsample-bivariate-extension (1.1.0)
66
- distribution (~> 0.6)
67
55
  text-table (1.2.3)
56
+ thread_safe (0.3.4)
57
+ tzinfo (1.2.1)
58
+ thread_safe (~> 0.1)
68
59
 
69
60
  PLATFORMS
70
61
  ruby
71
62
 
72
63
  DEPENDENCIES
73
- bio-statsample-timeseries
64
+ dirty-memoize
65
+ distribution
66
+ extendmatrix
74
67
  hoe
68
+ minimization
75
69
  minitest
76
70
  mocha (= 0.14.0)
71
+ rb-gsl
77
72
  rdoc
78
73
  reportbuilder
74
+ rserve-client
75
+ rubyvis
79
76
  shoulda (= 3.5.0)
80
77
  shoulda-matchers (= 2.2.0)
78
+ spreadsheet
@@ -1,3 +1,9 @@
1
+ === 1.4.0 / 2014-10-11
2
+ * Replaced README.txt for README.md
3
+ * Replace File.exists? for File.exist?
4
+ + New Dataset.join to join two dataset based on some fields
5
+ * Deleted MLE based regression (Probit and logistic). Now all GML methods are on statsample-glm
6
+
1
7
  === 1.3.1 / 2014-06-26
2
8
 
3
9
  * Example referred to a SimpleRegression class which doesn't exist. Updated to working example.
@@ -1,9 +1,10 @@
1
+ .travis.yml
1
2
  Gemfile
2
3
  Gemfile.lock
3
4
  History.txt
4
5
  LICENSE.txt
5
6
  Manifest.txt
6
- README.txt
7
+ README.md
7
8
  Rakefile
8
9
  benchmarks/correlation_matrix_15_variables.rb
9
10
  benchmarks/correlation_matrix_5_variables.rb
@@ -16,7 +17,6 @@ benchmarks/correlation_matrix_methods/correlation_matrix_with_graphics.ods
16
17
  benchmarks/correlation_matrix_methods/results.ds
17
18
  benchmarks/factor_map.rb
18
19
  benchmarks/helpers_benchmark.rb
19
- bin/statsample
20
20
  data/locale/es/LC_MESSAGES/statsample.mo
21
21
  doc_latex/manual/equations.tex
22
22
  examples/boxplot.rb
@@ -71,15 +71,8 @@ lib/statsample/graph/histogram.rb
71
71
  lib/statsample/graph/scatterplot.rb
72
72
  lib/statsample/histogram.rb
73
73
  lib/statsample/matrix.rb
74
- lib/statsample/mle.rb
75
- lib/statsample/mle/logit.rb
76
- lib/statsample/mle/normal.rb
77
- lib/statsample/mle/probit.rb
78
74
  lib/statsample/multiset.rb
79
75
  lib/statsample/regression.rb
80
- lib/statsample/regression/binomial.rb
81
- lib/statsample/regression/binomial/logit.rb
82
- lib/statsample/regression/binomial/probit.rb
83
76
  lib/statsample/regression/multiple.rb
84
77
  lib/statsample/regression/multiple/alglibengine.rb
85
78
  lib/statsample/regression/multiple/baseengine.rb
@@ -107,6 +100,7 @@ lib/statsample/test/umannwhitney.rb
107
100
  lib/statsample/test/wilcoxonsignedrank.rb
108
101
  lib/statsample/vector.rb
109
102
  lib/statsample/vector/gsl.rb
103
+ lib/statsample/version.rb
110
104
  po/es/statsample.mo
111
105
  po/es/statsample.po
112
106
  po/statsample.pot
@@ -114,11 +108,9 @@ references.txt
114
108
  setup.rb
115
109
  test/fixtures/bank2.dat
116
110
  test/fixtures/correlation_matrix.rb
117
- test/fixtures/crime.txt
118
111
  test/fixtures/hartman_23.matrix
119
112
  test/fixtures/repeated_fields.csv
120
113
  test/fixtures/stock_data.csv
121
- test/fixtures/test_binomial.csv
122
114
  test/fixtures/test_csv.csv
123
115
  test/fixtures/test_xls.xls
124
116
  test/fixtures/tetmat_matrix.txt
@@ -143,9 +135,7 @@ test/test_factor_pa.rb
143
135
  test/test_ggobi.rb
144
136
  test/test_gsl.rb
145
137
  test/test_histogram.rb
146
- test/test_logit.rb
147
138
  test/test_matrix.rb
148
- test/test_mle.rb
149
139
  test/test_multiset.rb
150
140
  test/test_regression.rb
151
141
  test/test_reliability.rb
@@ -1,9 +1,10 @@
1
- = Statsample
1
+ # Statsample
2
2
 
3
- http://ruby-statsample.rubyforge.org/
3
+ Homepage :: https://github.com/clbustos/statsample
4
4
 
5
+ [![Build Status](https://travis-ci.org/clbustos/statsample.svg?branch=master)](https://travis-ci.org/clbustos/statsample)
5
6
 
6
- == DESCRIPTION:
7
+ ## DESCRIPTION
7
8
 
8
9
  A suite for basic and advanced statistics on Ruby. Tested on Ruby 2.1.1p76 (June 2014), 1.8.7, 1.9.1, 1.9.2 (April, 2010), ruby-head(June, 2011) and JRuby 1.4 (Ruby 1.8.7 compatible).
9
10
 
@@ -24,7 +25,7 @@ Include:
24
25
  * Creates reports on text, html and rtf, using ReportBuilder gem
25
26
  * Graphics: Histogram, Boxplot and Scatterplot
26
27
 
27
- == PRINCIPLES
28
+ ## Principles
28
29
 
29
30
  * Software Design:
30
31
  * One module/class for each type of analysis
@@ -38,7 +39,7 @@ Include:
38
39
  * Go beyond Null Hiphotesis Testing, using confidence intervals and effect sizes when possible
39
40
  * (When possible) All references for methods are documented, providing sensible information on documentation
40
41
 
41
- == FEATURES:
42
+ ## Features
42
43
 
43
44
  * Classes for manipulation and storage of data:
44
45
  * Statsample::Vector: An extension of an array, with statistical methods like sum, mean and standard deviation
@@ -81,7 +82,7 @@ Include:
81
82
  * Module Statsample::Test provides several methods and classes to perform inferencial statistics
82
83
  * Statsample::Test::BartlettSphericity
83
84
  * Statsample::Test::ChiSquare
84
- * Statsample::Test::F
85
+ * Statsample::Test::F
85
86
  * Statsample::Test::KolmogorovSmirnov (only D value)
86
87
  * Statsample::Test::Levene
87
88
  * Statsample::Test::UMannWhitney
@@ -95,81 +96,95 @@ Include:
95
96
  * Gem +statsample-sem+ provides a DSL to R libraries +sem+ and +OpenMx+
96
97
  * Close integration with gem <tt>reportbuilder</tt>, to easily create reports on text, html and rtf formats.
97
98
 
98
- == Examples of use:
99
-
100
- See multiples examples of use on [http://github.com/clbustos/statsample/tree/master/examples/]
101
-
102
- === Boxplot
103
-
104
- require 'statsample'
105
- ss_analysis(Statsample::Graph::Boxplot) do
106
- n=30
107
- a=rnorm(n-1,50,10)
108
- b=rnorm(n, 30,5)
109
- c=rnorm(n,5,1)
110
- a.push(2)
111
- boxplot(:vectors=>[a,b,c], :width=>300, :height=>300, :groups=>%w{first first second}, :minimum=>0)
112
- end
113
- Statsample::Analysis.run # Open svg file on *nix application defined
114
-
115
- === Correlation matrix
116
-
117
- require 'statsample'
118
- # Note R like generation of random gaussian variable
119
- # and correlation matrix
120
-
121
- ss_analysis("Statsample::Bivariate.correlation_matrix") do
122
- samples=1000
123
- ds=data_frame(
124
- 'a'=>rnorm(samples),
125
- 'b'=>rnorm(samples),
126
- 'c'=>rnorm(samples),
127
- 'd'=>rnorm(samples))
128
- cm=cor(ds)
129
- summary(cm)
130
- end
131
-
132
- Statsample::Analysis.run_batch # Echo output to console
133
-
134
-
135
- == REQUIREMENTS:
99
+ # Examples of use:
100
+
101
+ See the [examples folder](https://github.com/clbustos/statsample/tree/master/examples/) too.
102
+
103
+ ## Boxplot
104
+
105
+ ```ruby
106
+ require 'statsample'
107
+
108
+ ss_analysis(Statsample::Graph::Boxplot) do
109
+ n=30
110
+ a=rnorm(n-1,50,10)
111
+ b=rnorm(n, 30,5)
112
+ c=rnorm(n,5,1)
113
+ a.push(2)
114
+ boxplot(:vectors=>[a,b,c], :width=>300, :height=>300, :groups=>%w{first first second}, :minimum=>0)
115
+ end
116
+ Statsample::Analysis.run # Open svg file on *nix application defined
117
+ ```
118
+
119
+ ### Correlation matrix
120
+
121
+ ```ruby
122
+ require 'statsample'
123
+ # Note R like generation of random gaussian variable
124
+ # and correlation matrix
125
+
126
+ ss_analysis("Statsample::Bivariate.correlation_matrix") do
127
+ samples=1000
128
+ ds=data_frame(
129
+ 'a'=>rnorm(samples),
130
+ 'b'=>rnorm(samples),
131
+ 'c'=>rnorm(samples),
132
+ 'd'=>rnorm(samples))
133
+ cm=cor(ds)
134
+ summary(cm)
135
+ end
136
+
137
+ Statsample::Analysis.run_batch # Echo output to console
138
+ ```
139
+
140
+ ## Requirements
136
141
 
137
142
  Optional:
138
143
 
139
144
  * Plotting: gnuplot and rbgnuplot, SVG::Graph
140
- * Factorial analysis and polychorical correlation(joint estimate and polychoric series): gsl library and rb-gsl (http://rb-gsl.rubyforge.org/). You should install it using <tt>gem install gsl</tt>.
145
+ * Factorial analysis and polychorical correlation(joint estimate and polychoric series): gsl library and rb-gsl (https://rubygems.org/gems/rb-gsl/). You should install it using <tt>gem install rb-gsl</tt>.
141
146
 
142
- <b>Note</b>: Use gsl 1.12.109 or later.
147
+ *Note*: Use gsl 1.12.109 or later.
143
148
 
144
- == RESOURCES
149
+ ## Resources
145
150
 
146
- * Source code on github: http://github.com/clbustos/statsample
147
- * API: http://ruby-statsample.rubyforge.org/statsample/
148
- * Bug report and feature request: http://github.com/clbustos/statsample/issues
149
- * E-mailing list: http://groups.google.com/group/statsample
151
+ * Source code on github :: http://github.com/clbustos/statsample
152
+ * Docs :: http://rubydoc.info/gems/statsample/
153
+ * Bug report and feature request :: http://github.com/clbustos/statsample/issues
154
+ * E-mailing list :: http://groups.google.com/group/statsample
150
155
 
151
- == INSTALL:
156
+ # Installation
152
157
 
153
- $ sudo gem install statsample
158
+ ```bash
159
+ $ sudo gem install statsample
160
+ ```
154
161
 
155
162
  On *nix, you should install statsample-optimization to retrieve gems gsl, statistics2 and a C extension to speed some methods.
156
163
 
157
164
  There are available precompiled version for Ruby 1.9 on x86, x86_64 and mingw32 archs.
158
165
 
159
- $ sudo gem install statsample-optimization
166
+ ```bash
167
+ $ sudo gem install statsample-optimization
168
+ ```
160
169
 
161
170
  If you use Ruby 1.8, you should compile statsample-optimization, usign parameter <tt>--platform ruby</tt>
162
171
 
163
- $ sudo gem install statsample-optimization --platform ruby
172
+ ```bash
173
+ $ sudo gem install statsample-optimization --platform ruby
174
+ ```
164
175
 
165
176
  If you need to work on Structural Equation Modeling, you could see +statsample-sem+. You need R with +sem+ or +OpenMx+ [http://openmx.psyc.virginia.edu/] libraries installed
166
177
 
167
- $ sudo gem install statsample-sem
178
+ ```bash
179
+ $ sudo gem install statsample-sem
180
+ ```
168
181
 
169
182
  Available setup.rb file
170
183
 
171
- sudo gem ruby setup.rb
184
+ ```bash
185
+ sudo gem ruby setup.rb
186
+ ```
172
187
 
173
- == LICENSE:
188
+ ## License
174
189
 
175
190
  GPL-2 (See LICENSE.txt)
data/Rakefile CHANGED
@@ -42,12 +42,14 @@ end
42
42
 
43
43
  h=Hoe.spec('statsample') do
44
44
  self.version=Statsample::VERSION
45
+ self.urls=["https://github.com/clbustos/statsample"]
45
46
  #self.testlib=:minitest
46
- # self.rubyforge_name = "ruby-statsample"
47
+ self.readme_file = 'README.md'
48
+ self.urls = ['https://github.com/clbustos/statsample']
47
49
  self.developer('Claudio Bustos', 'clbustos@gmail.com')
48
- self.extra_deps << ["spreadsheet","~>0.6.5"] << ["reportbuilder", "~>1.4"] << ["minimization", "~>0.2.0"] << ["fastercsv", ">0"] << ["dirty-memoize", "~>0.0"] << ["extendmatrix","~>0.3.1"] << ["statsample-bivariate-extension", ">0"] << ["rserve-client", "~>0.2.5"] << ["rubyvis", "~>0.5"] << ["distribution", "~>0.6"]
50
+ self.extra_deps << ["spreadsheet","~>0.6"] << ["reportbuilder", "~>1.4"] << ["minimization", "~>0.2.0"] << ["fastercsv", ">0"] << ["dirty-memoize", "~>0.0"] << ["extendmatrix","~>0.3.1"] << ["statsample-bivariate-extension", ">0"] << ["rserve-client"] << ["rubyvis"] << ["distribution"]
49
51
 
50
- self.extra_dev_deps << ["hoe","~>0"] << ["shoulda","~>3.1.1"] << ["minitest", "~>2.0"] << ["rserve-client", "~>0"] << ["gettext", "~>0"] << ["mocha", "~>0"] << ["hoe-git", "~>0"]
52
+ self.extra_dev_deps << ["hoe","~>0"] << ["shoulda","~>3"] << ["minitest", "~>2"] << ["gettext", "~>0"] << ["mocha", "~>0"] << ["hoe-git", "~>0"]
51
53
 
52
54
  self.clean_globs << "test/images/*" << "demo/item_analysis/*" << "demo/Regression"
53
55
  self.post_install_message = <<-EOF
@@ -98,6 +100,7 @@ Rake::RDocTask.new(:docs) do |rd|
98
100
  end
99
101
 
100
102
  end
103
+
101
104
  desc 'Publish rdocs with analytics support'
102
105
  task :publicar_docs => [:clean, :docs] do
103
106
  ruby %{agregar_adsense_a_doc.rb}
@@ -133,7 +133,6 @@ module Statsample
133
133
 
134
134
  create_has_library :gsl
135
135
 
136
- VERSION = '1.3.1'
137
136
  SPLIT_TOKEN = ","
138
137
  autoload(:Analysis, 'statsample/analysis')
139
138
  autoload(:Database, 'statsample/converters')
@@ -165,7 +164,7 @@ module Statsample
165
164
  class << self
166
165
  # Load a object saved on a file.
167
166
  def load(filename)
168
- if File.exists? filename
167
+ if File.exist? filename
169
168
  o=false
170
169
  File.open(filename,"r") {|fp| o=Marshal.load(fp) }
171
170
  o
@@ -290,4 +289,4 @@ require 'statsample/dataset'
290
289
  require 'statsample/crosstab'
291
290
  require 'statsample/matrix'
292
291
  require 'statsample/shorthand'
293
-
292
+ require 'statsample/version'