Previous: Functions and Variables for descriptive statistics, Up: descriptive   [Contents][Index]

45.4 Functions and Variables for statistical graphs

関数: barsplot (data1, data2, …, option_1, option_2, …)
関数: barsplot_description (…)

1変量、多変量どちらの標本でも離散統計変数の棒グラフをプロットします

dataは1標本を意味する結果のリストかもしれませんし、 それぞれサイズmn個の標本を意味するmn列の行列かもしれません。

利用可能なオプションは以下のものです:

関数barsplot_descriptionは 他のグラフィックオブジェクトと一緒に複雑なシーンを生成するために グラフィックオブジェクトを生成します。 wxMaximaとiMaximaインターフェイスで埋め込みヒストグラムを生成するための 関数wxbarsplotもあります。

例:

行列形式での1変量標本。絶対頻度。

(%i1) load ("descriptive")$
(%i2) m : read_matrix (file_search ("biomed.data"))$
(%i3) barsplot(
        col(m,2),
        title        = "Ages",
        xlabel       = "years",
        box_width    = 1/2,
        fill_density = 3/4)$

異なるサイズの2つの標本。 相対頻度とユーザー宣言の色を使って。

(%i1) load ("descriptive")$
(%i2) l1:makelist(random(10),k,1,50)$
(%i3) l2:makelist(random(10),k,1,100)$
(%i4) barsplot(
        l1,l2,
        box_width    = 1,
        fill_density = 1,
        bars_colors  = [black, grey],
        frequencies = relative,
        sample_keys = ["A", "B"])$

サイズが等しい4つの非数標本。

(%i1) load ("descriptive")$
(%i2) barsplot(
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        title  = "Asking for something to four groups",
        ylabel = "# of individuals",
        groups_gap   = 3,
        fill_density = 0.5,
        ordering     = ordergreatp)$

スタックバー。

(%i1) load ("descriptive")$
(%i2) barsplot(
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        makelist([Yes, No, Maybe][random(3)+1],k,1,50),
        title  = "Asking for something to four groups",
        ylabel = "# of individuals",
        grouping     = stacked,
        fill_density = 0.5,
        ordering     = ordergreatp)$

複数プロット文脈でのbarsplot

(%i1) load ("descriptive")$
(%i2) l1:makelist(random(10),k,1,50)$
(%i3) l2:makelist(random(10),k,1,100)$
(%i4) bp1 : 
        barsplot_description(
         l1,
         box_width = 1,
         fill_density = 0.5,
         bars_colors = [blue],
         frequency = relative)$
(%i5) bp2 : 
        barsplot_description(
         l2,
         box_width = 1,
         fill_density = 0.5,
         bars_colors = [red],
         frequency = relative)$
(%i6) draw(gr2d(bp1), gr2d(bp2))$

棒グラフ関連オプションについては、パッケージdrawbarsを参照してください。 関数histogrampiechartも参照してください。

関数: boxplot (data)
関数: boxplot (data, option_1, option_2, …)
関数: boxplot_description ( …)

この関数は箱ひげ図をプロットします。 引数dataはリストだったり行列だったりします。 箱ひげ図は主に異なる標本の比較に使われるので、リストはあまり興味深くありません。 行列の場合には多変量統計変数の複数成分おw比較することが可能です。 しかし、できる限り異なる標本サイズの標本のリストも許すようにしています。 実際、これは、パッケージdescriptiveの中で この種のデータ構造を許容する唯一の関数です

利用可能なオプションは以下のものです:

関数boxplot_descriptionは 他のグラフィックオブジェクトと一緒に複雑なシーンを生成するために グラフィックオブジェクトを生成します。 wxMaximaとiMaximaインターフェイスで埋め込みヒストグラムを生成するための 関数wxbarsplotもあります。

例:

多変量標本の箱ひげ図。

(%i1) load ("descriptive")$
(%i2) s2 : read_matrix(file_search("wind.data"))$
(%i3) boxplot(s2,
        box_width  = 0.2,
        title      = "Windspeed in knots",
        xlabel     = "Stations",
        color      = red,
        line_width = 2)$

異なるサイズの3つの標本の箱ひげ図。

(%i1) load ("descriptive")$
(%i2) A :
       [[6, 4, 6, 2, 4, 8, 6, 4, 6, 4, 3, 2],
        [8, 10, 7, 9, 12, 8, 10],
        [16, 13, 17, 12, 11, 18, 13, 18, 14, 12]]$
(%i3) boxplot (A, box_orientation = horizontal)$
関数: histogram (list)
関数: histogram (list, option_1, option_2, …)
関数: histogram (one_column_matrix)
関数: histogram (one_column_matrix, option_1, option_2, …)
関数: histogram (one_row_matrix)
関数: histogram (one_row_matrix, option_1, option_2, …)
関数: histogram_description (…)

この関数は一連の標本からヒストグラムをプロットします。 標本データは数のリストか一次元行列に保存しなければいけません。

利用可能なオプションは以下のものです:

関数 histogram_descriptionは他のグラフィックオブジェクトと一緒に 複雑なシーンを生成するのに適したグラフィックオブジェクトを生成します。 wxMaximaと iMaximaインターフェイスで埋め込みヒストグラムを生成する 関数wxhistogramもあります。

例:

8クラスを持つ簡単なヒストグラム。

(%i1) load ("descriptive")$
(%i2) s1 : read_list (file_search ("pidigits.data"))$
(%i3) histogram (
           s1,
           nclasses     = 8,
           title        = "pi digits",
           xlabel       = "digits",
           ylabel       = "Absolute frequency",
           fill_color   = grey,
           fill_density = 0.6)$

ヒストグラムの境界を-2と12に、クラス数を3に設定します。 また予め定義されたチックを導入します:

(%i1) load ("descriptive")$
(%i2) s1 : read_list (file_search ("pidigits.data"))$
(%i3) histogram (
           s1,
           nclasses     = [-2,12,3],
           htics        = ["A", "B", "C"],
           terminal     = png,
           fill_color   = "#23afa0",
           fill_density = 0.6)$

xrangeを設定しシーンの中に明示的な曲線を足すのに histogram_descriptionを利用します:

(%i1) load ("descriptive")$
(%i2) ( load("distrib"),
        m: 14, s: 2,
        s2: random_normal(m, s, 1000) ) $
(%i3) draw2d(
        grid   = true,
        xrange = [5, 25],
        histogram_description(
          s2,
          nclasses     = 9,
          frequency    = relative,
          fill_density = 0.5),
        explicit(pdf_normal(x,m,s), x, m - 3*s, m + 3* s))$
関数: piechart (list)
関数: piechart (list, option_1, option_2, …)
関数: piechart (one_column_matrix)
関数: piechart (one_column_matrix, option_1, option_2, …)
関数: piechart (one_row_matrix)
関数: piechart (one_row_matrix, option_1, option_2, …)
関数: piechart_description (…)

barsplotに似ていますが、長方形の代わりに扇をプロットします。

利用可能なオプションは以下のものです:

関数 piechart_descriptionは他のグラフィックオブジェクトと一緒に 複雑なシーンを生成するのに適したグラフィックオブジェクトを生成します。 wxMaximaと iMaximaインターフェイスで埋め込みヒストグラムを生成する 関数wxhistogramもあります。

例:

(%i1) load ("descriptive")$
(%i2) s1 : read_list (file_search ("pidigits.data"))$
(%i3) piechart(
        s1,
        xrange = [-1.1, 1.3],
        yrange = [-1.1, 1.1],
        title  = "Digit frequencies in pi")$

関数barsplotも参照してください。

関数: scatterplot (list)
関数: scatterplot (list, option_1, option_2, …)
関数: scatterplot (matrix)
関数: scatterplot (matrix, option_1, option_2, …)
関数: scatterplot_description (…)

1変量(list)や多変量(matrix)の標本の散布図をプロットします。

利用可能なオプションは histogramが許すものと同じです。

関数 scatterplot_descriptionは他のグラフィックオブジェクトと一緒に 複雑なシーンを生成するのに適したグラフィックオブジェクトを生成します。 wxMaximaと iMaximaインターフェイスで埋め込みヒストグラムを生成する 関数wxscatterplotもあります。

例:

シミュレーティッドGauss標本の1変量散布図。

(%i1) load ("descriptive")$
(%i2) load ("distrib")$
(%i3) scatterplot(
        random_normal(0,1,200),
        xaxis      = true,
        point_size = 2,
        dimensions = [600,150])$

二次元散布図。

(%i1) load ("descriptive")$
(%i2) s2 : read_matrix (file_search ("wind.data"))$
(%i3) scatterplot(
       submatrix(s2, 1,2,3),
       title      = "Data from stations #4 and #5",
       point_type = diamant,
       point_size = 2,
       color      = blue)$

3次元散布図。

(%i1) load ("descriptive")$
(%i2) s2 : read_matrix (file_search ("wind.data"))$
(%i3) scatterplot(submatrix (s2, 1,2), nclasses=4)$

5つのクラスのヒストグラムと5次元散布図。

(%i1) load ("descriptive")$
(%i2) s2 : read_matrix (file_search ("wind.data"))$
(%i3) scatterplot(
        s2,
        nclasses     = 5,
        frequency    = relative,
        fill_color   = blue,
        fill_density = 0.3,
        xtics        = 5)$

2次元か3次元で孤立点か線で結んだ点をプロットすることについては、 pointsを参照してください。 histogramも参照してください。

関数: starplot (data1, data2, …, option_1, option_2, …)
関数: starplot_description (…)

1変量、多変量どちらの標本でも離散統計変数のスターダイアグラムをプロットします

dataは1標本を意味する結果のリストかもしれませんし、 それぞれサイズmn個の標本を意味するmn列の行列かもしれません。

利用可能なオプションは以下のものです:

関数 starplot_descriptionは他のグラフィックオブジェクトと一緒に 複雑なシーンを生成するのに適したグラフィックオブジェクトを生成します。 wxMaximaと iMaximaインターフェイスで埋め込みヒストグラムを生成する 関数wxstarplotもあります。

例:

絶対頻度に基づいたプロット。 ユーザーが定義した位置と半径。

(%i1) load ("descriptive")$
(%i2) l1: makelist(random(10),k,1,50)$
(%i3) l2: makelist(random(10),k,1,200)$
(%i4) starplot(
        l1, l2,
        stars_colors = [blue,red],
        sample_keys = ["1st sample", "2nd sample"],
        star_center = [1,2],
        star_radius = 4,
        proportional_axes = xy,
        line_width = 2 ) $ 
関数: stemplot (data)
関数: stemplot (data, option)

幹葉図をプロットします。

固有の利用可能なオプションは:

例:

(%i1) load ("descriptive")$
(%i2) load("distrib")$
(%i3) stemplot(
        random_normal(15, 6, 100),
        leaf_unit = 0.1);
-5|4
 0|37
 1|7
 3|6
 4|4
 5|4
 6|57
 7|0149
 8|3
 9|1334588
10|07888
11|01144467789
12|12566889
13|24778
14|047
15|223458
16|4
17|11557
18|000247
19|4467799
20|00
21|1
22|2335
23|01457
24|12356
25|455
27|79
key: 6|3 =  6.3
(%o3)                  done

Previous: Functions and Variables for descriptive statistics, Up: descriptive   [Contents][Index]