Permalink
Browse files

* Added Regression::Multiple::GslEngine

* Added setup.rb
* Crosstab#row_label and #column_name
* DominanceAnalysis and DominanceAnalysisBootstrap uses Dataset#labels for Vector names.
  • Loading branch information...
1 parent 36fc84c commit 58f3c0b3962d10322345a89b1eebbe4ee62016e9 @clbustos committed Aug 4, 2009
View
@@ -1,6 +1,9 @@
-=== 0.3.2 / 2009-08-?
+=== 0.3.2 / 2009-08-04
* Added Regression::Multiple::GslEngine
+* Added setup.rb
+* Crosstab#row_label and #column_name
+* DominanceAnalysis and DominanceAnalysisBootstrap uses Dataset#labels for Vector names.
=== 0.3.1 / 2009-08-03
View
@@ -1,4 +1,5 @@
History.txt
+LICENSE.txt
Manifest.txt
README.txt
bin/statsample
@@ -38,13 +39,15 @@ lib/statsample/multiset.rb
lib/statsample/regression.rb
lib/statsample/regression/multiple.rb
lib/statsample/regression/multiple/alglibengine.rb
+lib/statsample/regression/multiple/gslengine.rb
lib/statsample/regression/multiple/rubyengine.rb
lib/statsample/regression/simple.rb
lib/statsample/reliability.rb
lib/statsample/resample.rb
lib/statsample/srs.rb
lib/statsample/test.rb
lib/statsample/vector.rb
+setup.rb
test/_test_chart.rb
test/test_anova.rb
test/test_codification.rb
View
@@ -10,7 +10,7 @@ This package allows to process files and databases for statistical purposes, wit
== FEATURES:
* Multiple Regression. Listwise analysis optimized with use of Alglib library. Pairwise analysis is executed on pure ruby and reports same values as SPSS
-* Dominance Analysis. Based on Bodescu and Azen papers, DominanceAnalysis? class can report dominance analysis for a sample and DominanceAnalysis?. Bootstrap can execute bootstrap analysis to determine dominance stability, as recomended by Azen & Bodescu (2003).
+* Dominance Analysis. Based on Bodescu and Azen papers, DominanceAnalysis class can report dominance analysis for a sample and DominanceAnalysisBootstrap can execute bootstrap analysis to determine dominance stability, as recomended by Azen & Bodescu (2003).
* Classes for Vector, Datasets (set of Vectors) and Multisets (multiple datasets with same fields and type of vectors), and multiple methods to manipulate them
* Module Codification, to help to codify open questions
* Converters to and from database and csv files, and to output Mx and GGobi files
@@ -65,13 +65,16 @@ Optional:
== INSTALL:
-gem install ruby-statsample
+ sudo gem install ruby-statsample
For optimization on *nix env
-gem install ruby-statsample-optimization
+ sudo gem install ruby-statsample-optimization
+Available setup.rb file
+
+ sudo gem ruby setup.rb
== LICENSE:
-GPL-2
+GPL-2 (See LICENSE.txt)
View
@@ -14,7 +14,7 @@ Hoe.spec('statsample') do |p|
p.rubyforge_name = "ruby-statsample"
p.developer('Claudio Bustos', 'clbustos@gmail.com')
p.extra_deps << ["spreadsheet","=0.6.4"] << "svg-graph"
- p.clean_globs << "test/images/*"
+ p.clean_globs << "test/images/*" << "demo/item_analysis/*" << "demo/Regression"
# p.rdoc_pattern = /^(lib|bin|ext\/distributions)|txt$/
end
View
@@ -1,2 +1,2 @@
-#!/usr/bin/ruby
+#! /usr/bin/ruby1.8
echo "Nothing today!"
View
@@ -1,14 +1,22 @@
# = statsample.rb -
-
-# Process files and databases for statistical purposes, with focus on
-# estimation of parameters for several types of samples (simple random,
-# stratified and multistage sampling).
+# Statsample - Statistic package for Ruby
+# Copyright (C) 2008-2009 Claudio Bustos
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# Copyright (C) 2008-2009 Claudio Bustos
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-# Claudio Bustos mailto:clbustos_AT_gmail.com
-# :stopdoc:
$:.unshift(File.dirname(__FILE__))
$:.unshift(File.expand_path(File.dirname(__FILE__)+"/../ext"))
@@ -28,10 +36,6 @@ def create_test(*args,&proc)
[description, fields, Proc.new]
end
-# Process files and databases for statistical purposes, with focus on
-# estimation of parameters for several types of samples (simple random,
-# stratified and multistage sampling).
-
begin
require 'rbgsl'
HAS_GSL=true
@@ -54,11 +58,15 @@ module Statsample
end
end
-#
-# :startdoc:
+#
+# Modules for statistical analysis
+# See first:
+# * Converter : several modules to import and export data
+# * Vector: The base class of all analysis
+# * Dataset: An union of vectors.
#
module Statsample
- VERSION = '0.3.1'
+ VERSION = '0.3.2'
SPLIT_TOKEN = ","
autoload(:Database, 'statsample/converters')
autoload(:Anova, 'statsample/anova')
@@ -5,6 +5,7 @@ module Statsample
#
class Crosstab
attr_reader :v_rows, :v_cols
+ attr_accessor :row_label, :column_label
def initialize(v1,v2)
raise ArgumentError, "Both arguments should be Vectors" unless v1.instance_of? Vector and v2.instance_of? Vector
raise ArgumentError, "Vectors should be the same size" unless v1.size==v2.size
@@ -86,7 +87,10 @@ def summary(report_type=ConsoleSummary)
cn=cols_names
total=0
total_cols=cn.inject({}) {|a,x| a[x]=0;a}
- out.add "Chi Square: #{chi_square}"
+ out.add "Chi Square: #{chi_square}\n"
+ out.add "Rows: #{@row_label}\n" unless @row_label.nil?
+ out.add "Columns: #{@column_label}\n" unless @column_label.nil?
+
t=Statsample::ReportTable.new([""]+cols_names+["Total"])
rn.each{|row|
total_row=0
@@ -197,7 +197,7 @@ def summary(report_type=ConsoleSummary)
row=["Overall averages","",""]+@fields.collect{|f|
sprintf("%0.3f",g[f])
}
- t.add_row(row)
+ t.add_row(row)
out.parse_table(t)
out.nl
@@ -4,6 +4,7 @@ class Bootstrap
include Writable
attr_reader :samples_td,:samples_cd,:samples_gd,:samples_ga, :fields
attr_writer :lr_class
+ attr_accessor :ds
def initialize(ds,y_var)
@ds=ds
@y_var=y_var
@@ -103,7 +104,7 @@ def summary(report_type=ConsoleSummary)
table.header=["var","mean","se","p.5","p.95"]
@fields.each{|f|
v=@samples_ga[f].to_vector(:scale)
- row=[f, sprintf("%0.3f",v.mean), sprintf("%0.3f",v.sd), sprintf("%0.3f",v.percentil(5)),sprintf("%0.3f",v.percentil(95))]
+ row=[@ds.vector_label(f), sprintf("%0.3f",v.mean), sprintf("%0.3f",v.sd), sprintf("%0.3f",v.percentil(5)),sprintf("%0.3f",v.percentil(95))]
table.add_row(row)
}
@@ -115,7 +116,7 @@ def summary_pairs(pair,std,ttd)
[0,0.5,1].each{|n|
freqs[n]=0 if freqs[n].nil?
}
- name=pair[0]+" - "+pair[1]
+ name=@ds.vector_label(pair[0])+" - "+@ds.vector_label(pair[1])
[name,f(ttd,1),f(std.mean,4),f(std.sd),f(freqs[1]), f(freqs[0]), f(freqs[0.5]), f(freqs[ttd])]
end
def f(v,n=3)
@@ -1,6 +0,0 @@
-module Statsample
- # Diverse multivariate methods
- module Multivariate
-
- end
-end

0 comments on commit 58f3c0b

Please sign in to comment.