Reliability Scale analysis

In [2]:
require 'statsample'

Statsample::Analysis.store(Statsample::Reliability) do 
  Daru.lazy_update = true
  samples=100
  a=rnorm(samples)
  
  ds = Daru::DataFrame.new({})
  
  20.times do |i|
    ds["v#{i}".to_sym]= a + rnorm(samples,0,0.2)
  end  
  ds.update
  
  rel=Statsample::Reliability::ScaleAnalysis.new(ds)
  summary rel
  
  ms=Statsample::Reliability::MultiScaleAnalysis.new(:name=>"Multi Scale analyss") do |m|
    m.scale "Scale 1", ds.clone([:v1, :v2, :v3, :v4, :v5, :v6, :v7, :v8, :v9, :v10])
    m.scale "Scale 2", ds.clone([:v11, :v12, :v13, :v14, :v15, :v16, :v17, :v18, :v19])
  end
  
  summary ms
  
  Daru.lazy_update = false
end

Statsample::Analysis.run_batch
Analysis 2015-06-04 13:31:06 +0530
= Statsample::Reliability
  == Reliability Analysis
    Summary for Reliability Analysis
+------------------------------+--------------------+
| Valid Items                  | 20                 |
| Valid cases                  | 100                |
| Sum mean                     | -0.6359            |
| Sum sd                       | 17.7154            |
| Sum median                   | -2.054407295286337 |
+------------------------------+--------------------+
| Item mean                    | -0.0318            |
| Item sd                      | 0.8858             |
+------------------------------+--------------------+
| Skewness                     | 0.2122             |
| Kurtosis                     | 0.4319             |
+------------------------------+--------------------+
| Cronbach's alpha             | 0.9975             |
| Standarized Cronbach's alpha | 0.9975             |
| Mean rpb                     | 0.9750             |
| Variances mean               | 0.821453           |
| Covariances mean             | 0.782646           |
+------------------------------+--------------------+

    Items for obtain alpha(0.8) : 0
    Items for obtain alpha(0.9) : 0
    Items report for Reliability Analysis
+----------+----------+---------+-----------------+----------------+---------------+---------------------+------------------+
|   item   |   mean   |   sd    | mean if deleted | var if deleted | sd if deleted |  item-total correl. | alpha if deleted |
+----------+----------+---------+-----------------+----------------+---------------+---------------------+------------------+
| v0(v0)   | -0.01939 | 0.91391 | -0.61649        | 282.86748      | 16.81866      | 0.98017             | 0.99737          |
| v1(v1)   | -0.01105 | 0.90391 | -0.62483        | 283.35031      | 16.83301      | 0.97490             | 0.99740          |
| v2(v2)   | -0.04160 | 0.89147 | -0.59428        | 283.80743      | 16.84659      | 0.97324             | 0.99741          |
| v3(v3)   | 0.00590  | 0.89465 | -0.64177        | 283.75704      | 16.84509      | 0.97134             | 0.99742          |
| v4(v4)   | -0.03419 | 0.91352 | -0.60169        | 283.12127      | 16.82621      | 0.97192             | 0.99741          |
| v5(v5)   | -0.00990 | 0.90108 | -0.62598        | 283.35560      | 16.83317      | 0.97795             | 0.99738          |
| v6(v6)   | -0.06509 | 0.91126 | -0.57079        | 282.94896      | 16.82109      | 0.98039             | 0.99736          |
| v7(v7)   | -0.03301 | 0.91149 | -0.60287        | 283.23276      | 16.82952      | 0.97038             | 0.99742          |
| v8(v8)   | -0.05375 | 0.89613 | -0.58213        | 283.64726      | 16.84183      | 0.97348             | 0.99741          |
| v9(v9)   | -0.07195 | 0.90778 | -0.56392        | 283.21608      | 16.82902      | 0.97514             | 0.99740          |
| v10(v10) | -0.02870 | 0.91018 | -0.60718        | 283.07772      | 16.82491      | 0.97718             | 0.99738          |
| v11(v11) | -0.02767 | 0.92831 | -0.60821        | 282.42700      | 16.80556      | 0.97899             | 0.99737          |
| v12(v12) | -0.03720 | 0.87348 | -0.59868        | 284.31081      | 16.86152      | 0.97639             | 0.99739          |
| v13(v13) | -0.05193 | 0.94256 | -0.58395        | 282.20356      | 16.79892      | 0.97078             | 0.99743          |
| v14(v14) | -0.00975 | 0.91671 | -0.62613        | 282.89654      | 16.81953      | 0.97602             | 0.99739          |
| v15(v15) | -0.03857 | 0.86246 | -0.59731        | 284.93006      | 16.87987      | 0.96718             | 0.99745          |
| v16(v16) | -0.01798 | 0.92181 | -0.61790        | 282.57388      | 16.80993      | 0.98128             | 0.99736          |
| v17(v17) | -0.07719 | 0.90038 | -0.55869        | 283.47451      | 16.83670      | 0.97463             | 0.99740          |
| v18(v18) | -0.02076 | 0.89879 | -0.61511        | 283.40454      | 16.83462      | 0.97888             | 0.99737          |
| v19(v19) | 0.00792  | 0.92351 | -0.64380        | 282.85021      | 16.81815      | 0.97000             | 0.99743          |
+----------+----------+---------+-----------------+----------------+---------------+---------------------+------------------+

    -50.00 : *
    -39.00 : ******
    -28.00 : *********
    -17.00 : *********************
    -6.00 : ***************************
     5.00 : ********************
    16.00 : **********
    27.00 : *****
    38.00 : 
    49.00 : *
  == Multi Scale analyss
    === Reliability analysis of scales
      ==== Scale Scale 1
        Summary for Scale Scale 1
+------------------------------+---------------------+
| Valid Items                  | 10                  |
| Valid cases                  | 100                 |
| Sum mean                     | -0.3434             |
| Sum sd                       | 8.8514              |
| Sum median                   | -1.0470435648512906 |
+------------------------------+---------------------+
| Item mean                    | -0.0343             |
| Item sd                      | 0.8851              |
+------------------------------+---------------------+
| Skewness                     | 0.1727              |
| Kurtosis                     | 0.5424              |
+------------------------------+---------------------+
| Cronbach's alpha             | 0.9952              |
| Standarized Cronbach's alpha | 0.9952              |
| Mean rpb                     | 0.9740              |
| Variances mean               | 0.817537            |
| Covariances mean             | 0.779684            |
+------------------------------+---------------------+

        Items for obtain alpha(0.8) : 0
        Items for obtain alpha(0.9) : 0
        Items report for Scale Scale 1
+----------+----------+---------+-----------------+----------------+---------------+---------------------+------------------+
|   item   |   mean   |   sd    | mean if deleted | var if deleted | sd if deleted |  item-total correl. | alpha if deleted |
+----------+----------+---------+-----------------+----------------+---------------+---------------------+------------------+
| v1(v1)   | -0.01105 | 0.90391 | -0.33231        | 63.52256       | 7.97010       | 0.97215             | 0.99468          |
| v10(v10) | -0.04160 | 0.89147 | -0.30176        | 63.70750       | 7.98170       | 0.97287             | 0.99467          |
| v2(v2)   | 0.00590  | 0.89465 | -0.34926        | 63.67059       | 7.97939       | 0.97187             | 0.99469          |
| v3(v3)   | -0.03419 | 0.91352 | -0.30917        | 63.36891       | 7.96046       | 0.97246             | 0.99468          |
| v4(v4)   | -0.00990 | 0.90108 | -0.33347        | 63.49721       | 7.96851       | 0.97753             | 0.99454          |
| v5(v5)   | -0.06509 | 0.91126 | -0.27828        | 63.31355       | 7.95698       | 0.97941             | 0.99449          |
| v6(v6)   | -0.03301 | 0.91149 | -0.31036        | 63.40747       | 7.96288       | 0.97193             | 0.99469          |
| v7(v7)   | -0.05375 | 0.89613 | -0.28961        | 63.61415       | 7.97585       | 0.97446             | 0.99462          |
| v8(v8)   | -0.07195 | 0.90778 | -0.27141        | 63.46304       | 7.96637       | 0.97209             | 0.99468          |
| v9(v9)   | -0.02870 | 0.91018 | -0.31466        | 63.38617       | 7.96154       | 0.97513             | 0.99460          |
+----------+----------+---------+-----------------+----------------+---------------+---------------------+------------------+

        -30.00 : *
        -24.00 : 
        -18.00 : *******
        -12.00 : ****************
        -6.00 : ******************************
         0.00 : *************************
         6.00 : ************
        12.00 : *******
        18.00 : *
        24.00 : *
      ==== Scale Scale 2
        Summary for Scale Scale 2
+------------------------------+--------------------+
| Valid Items                  | 9                  |
| Valid cases                  | 100                |
| Sum mean                     | -0.2731            |
| Sum sd                       | 8.0002             |
| Sum median                   | -0.508167259967186 |
+------------------------------+--------------------+
| Item mean                    | -0.0303            |
| Item sd                      | 0.8889             |
+------------------------------+--------------------+
| Skewness                     | 0.2502             |
| Kurtosis                     | 0.3290             |
+------------------------------+--------------------+
| Cronbach's alpha             | 0.9946             |
| Standarized Cronbach's alpha | 0.9947             |
| Mean rpb                     | 0.9739             |
| Variances mean               | 0.824273           |
| Covariances mean             | 0.785909           |
+------------------------------+--------------------+

        Items for obtain alpha(0.8) : 0
        Items for obtain alpha(0.9) : 0
        Items report for Scale Scale 2
+----------+----------+---------+-----------------+----------------+---------------+---------------------+------------------+
|   item   |   mean   |   sd    | mean if deleted | var if deleted | sd if deleted |  item-total correl. | alpha if deleted |
+----------+----------+---------+-----------------+----------------+---------------+---------------------+------------------+
| v11(v11) | -0.02767 | 0.92831 | -0.24546        | 50.23527       | 7.08768       | 0.98083             | 0.99369          |
| v12(v12) | -0.03720 | 0.87348 | -0.23593        | 51.06596       | 7.14604       | 0.97526             | 0.99391          |
| v13(v13) | -0.05193 | 0.94256 | -0.22120        | 50.16754       | 7.08290       | 0.96972             | 0.99410          |
| v14(v14) | -0.00975 | 0.91671 | -0.26337        | 50.48105       | 7.10500       | 0.97360             | 0.99393          |
| v15(v15) | -0.03857 | 0.86246 | -0.23455        | 51.29881       | 7.16232       | 0.96818             | 0.99416          |
| v16(v16) | -0.01798 | 0.92181 | -0.25515        | 50.30906       | 7.09289       | 0.98229             | 0.99364          |
| v17(v17) | -0.07719 | 0.90038 | -0.19593        | 50.72663       | 7.12226       | 0.97202             | 0.99399          |
| v18(v18) | -0.02076 | 0.89879 | -0.25236        | 50.69197       | 7.11983       | 0.97700             | 0.99382          |
| v19(v19) | 0.00792  | 0.92351 | -0.28104        | 50.46942       | 7.10418       | 0.96647             | 0.99418          |
+----------+----------+---------+-----------------+----------------+---------------+---------------------+------------------+

        -30.00 : 
        -24.00 : *
        -18.00 : *******
        -12.00 : **************
        -6.00 : *****************************
         0.00 : ****************************
         6.00 : ****************
        12.00 : ****
        18.00 : 
        24.00 : *