マン・ケンドール<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />こんにちは、みんな。 一時的な傾向が重要かどうかをテストするためにマン-ケンドールを実行しようとしています。 JMPマニュアルやオンラインのどこにも見つかりません。 何かアイデアがある人はいますか?
ありがとう!
マン・ケンドールMSとデイブに感謝します! Kendall のタウと Mann-Kendall テストが同じ (および/または関連している) かどうかもわかりませんでした。 多変量テストに関する情報とスクリプトもありがとうございます。
マン・ケンドールマン・ケンダル検定統計量とケンダル・タウ b の定義は、(それぞれ時系列と相関の観点から) 異なる用語で記述されることがよくありますが、私の知る限り、それらは本質的に同じです。
以下は私がかなり前に書いたスクリプトです。 Theil の傾きを計算して表示し、Mann-Kendall 検定を実行します。 比較のために、パラメトリック線形回帰直線がプロットに示されています。 私は、季節パターンを考慮する可能性だけでなく、「By」関数を含めることによってスクリプトを一般化することを計画しました。 しかし、私にはまだそれらの計画を実現する時間がありません。 これがあなたにいくつかのアイデアを与えてくれることを願っています。
dt =現在のデータテーブル() ;
ダウンロード=列ダイアログ(
「データテーブルからTheilの傾きとKendall Tauを推定する」 ||
シャア( dt <<名前を取得する) 、
イース= ColList ( 「Yを選択してください」 、
マックスコル( 1 ) 、
ミンコル( 1 ) 、
データ・タイプ(数値)
) 、
× = ColList ( 「Xを選択してください」 、
マックスコル( 1 ) 、
ミンコル( 1 ) 、
データ・タイプ(数値)
) 、
グループ= ColList ( 「(仕事をしていないことで)」 、マックスコル( 1 ) )
) ;
コリ=桁( dt 、ダウンロード[ 「イース」 ] ) ;
列X =桁( dt 、ダウンロード[ 「×」 】 ) ;
コルグループ=桁( dt 、ダウンロード[ "グループ" 】 ) ;
//傾斜の計算
n = N 行( dt ) ;
坂道= J ( n 、 n 、 。 ) ;
ために(私= 1 、私< n 、私++、
ために( j =私+ 1 、 j <= n 、 j ++、
坂道[私、 j 】 = (コリ[ j 】 -コリ[私]) / (列X [ j 】 -列X [私])
)
) ;
それは=分位数( 0.5 、坂道) ;
//Kendall の Tau b を使用して傾きがゼロと異なるかどうかをテストします
MV =多変量(
Y (コリ、列X ) 、
散布図行列( 0 ) 、
相関関係は多変量です( 0 ) 、
ケンダルのタウ( 1 )
) ;
//データをプロットし、線形回帰とタイルの傾きを追加します
ビブ=二変量(
Y (コリ) 、
バツ(列X ) 、
フィットライン( {線の色( "赤" )} ) 、
フィットスペシャル(スロープ(それは) 、 {線の色( "緑" )} ) 、
見えない
) ;
rbiv =ビブ<<報告;
rbiv [ 「リニアフィット」 】 <<このようにすべてを閉じます;
rbiv [アウトラインボックス( 7 )] <<タイトルを設定する( 「ティールの坂道」 ) ;
データベース=報告( MV )[ 「多変量」 】 <<親;
データベース<<先頭に追加する( rbiv ) ;
データベース[テキストボックス( 4 )] <<テキストを設定する( 「ティールの坂道」 ) ;
rbiv <<ウィンドウを閉じる;
Re: マン・ケンダルMann-Kendall 検定がノンパラメトリック相関の Kendall Tau 統計量とどの程度関連しているのか (もしあったとしても) はわかりません。後者には、多変量プラットフォームでアクセスできます: [分析] > [多変量メソッド] を選択し、多変量レポートからホットスポットから [ノンパラメトリック相関] を選択します。
テストが完全に異なる場合は、この方法に関する参考文献があれば興味があります。水文学分野向けに開発されたさまざまな手法 (ハースト インデックスなど) を実装するアドインを構築することを検討しています。
よろしく
デイブ
マン・ケンドールについてこんにちは。これは、Big Class の例を使用して、ロール別 (2 つのレベル) の列が指定されている状況をカバーするこのスクリプトの更新版です。
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dlg = Column Dialog(
"Estimate Theil slope and Kendall Tau from Data Table " ||
Char( dt << get name ),
Ys = ColList( "Select Y",
maxcol( 1 ),
mincol( 1 ),
Datatype( numeric )
),
Xs = ColList( "Select X",
maxcol( 1 ),
mincol( 1 ),
Datatype( numeric )
),
Group = ColList( "By", maxcol( 1 ) )
);
colY = Column( dt, dlg["Ys"] );
colX = Column( dt, dlg["Xs"] );
colGroup = Column( dt, dlg["Group"] );
//create subset data tables when By Role is used
subdt = dt << Subset(
By( :sex ),
All rows,
Selected columns only( 0 ),
);
//hide subset data tables, for 2 levels of the Group column in the By Role
subdt[1] << Show Window(0);
subdt[2] << Show Window(0);
//Calculation of Theil-Sen slope: A robust non-parametric estimate of trend magnitude.
theil = {}; //create empty list call 'theil'to store Theil-Sen slopes
for (k = 1, k <= Nitems(subdt), k++,
curY = Column( subdt[k], dlg["Ys"] );
curX = Column( subdt[k], dlg["Xs"] );
n = N Rows( subdt[k] );
slopes = J( n, n, . ); //this is initialized not as an empty matrix but it's full of missing values
For( i = 1, i < n, i++,
For( j = i+1, j <= n, j++,
slopes[i, j] = (curY[j] - curY[i]) / (curX[j] - curX[i])
)
);
insert into(theil, Quantile( 0.5, slopes )); //calculate the median of all the slopes
);
new window("windowname",
/*Kendall's Tau b to test if slope differs from zero. Analogous to the Mann-Kendall significance test, which Outputs the S statistic and p-value.*/
mv = dt << Multivariate(
Y( colY, colX ),
Scatterplot Matrix( 0 ),
Correlations multivariate( 0 ),
Kendall's Tau( 1 ), /*see above*/
By(colGroup)
);
//Plot data and add linear regression and Theil's slope
biv = dt << Bivariate(
Y( colY ),
X( colX ),
By(colGroup),
Fit Line( {Line Color( "Red" )} ),
//invisible
);
);
//Plot Theil's Slopes using Fit special in Bivariate report
biv[1] << Fit Special( Slope( theil[1] ), {Line Color( "Green" )});
biv[2] << Fit Special( Slope( theil[2] ), {Line Color( "Green" )});
rbiv = biv << Report;
rbiv[1]["Linear Fit"] << close all like this;
//all of the second linear fit outline boxes under an outline box that contains the word "sex" in the title is what I want
tsb = rbiv << Xpath("(//OutlineBox[text()='Linear Fit'])[2]"); //this returns the list of display boxes titled "Linear Fit" that I want to change to "Thiel's slope" and then I am capturing this reference with the variable name tsb
tsb << set title( "Theil's Slope" );