# Crawford-Howell t-test

11 ビュー (過去 30 日間)
AwedBy Matlab 2014 年 10 月 4 日
コメント済み: AwedBy Matlab 2014 年 10 月 5 日
Hello,
I need to perform a Crawford-Howell t-test between single cases and normative groups of controls.
I found this code for it, but it is in R.
Does anyone have any code for it in Matlab, or is able to convert the code to matlab code?
Thanks!
##### 1 件のコメント-1 件の古いコメントを表示-1 件の古いコメントを非表示
the cyclist 2014 年 10 月 5 日
The original paper seems to be freely available here, if anyone is interested.

サインインしてコメントする。

### 回答 (2 件)

the cyclist 2014 年 10 月 4 日
The MATLAB Statistics Toolbox has a built-in function ttest2(). The result of using this function on a single case vs controls, for example,
[h p ci stats] = ttest2(5,[1 2 3])
gives me the same result (to several decimal places) as the R code in that link.
(This is just a bit puzzling to me, since ttest2() is just a standard t-test, and you are suggesting that Crawford-Howell is something other than that. But, the results are what they are.)
##### 1 件のコメント-1 件の古いコメントを表示-1 件の古いコメントを非表示
the cyclist 2014 年 10 月 5 日
I was able to replicate the example on the bottom right of page 483 of the Crawford-Howell table:
kase = 33;
x = 26.457514;
kontrol = [50-x repmat(50,1,13) 50+x]; % This has mean 50 and standard deviation 10, as specified in the paper's example.
[h p ci stats] = ttest2(kase,kontrol)

サインインしてコメントする。

Star Strider 2014 年 10 月 4 日

I don’t have ‘R’, so I transliterated it as best I could understand it. (I won’t post it as a File Exchange contribution, since I have no desire to pay US\$39 to download the paper to be sure I got it correct.)
It runs. I will let you determine if it gives correct answers:
function [tval,degfre,pval] = CrawfordHowell(kase,kontrol)
lenk = length(kontrol);
tval = (kase - mean(kontrol))./(std(kontrol).*sqrt((lenk+1)./lenk));
degfre = lenk-1;
pval = 2*(1-tcdf(abs(tval),degfre));
end
[t,d,p] = CrawfordHowell(1, rand(1,10)) % Test
I used ‘kase’ and ‘kontrol’ because ‘case’ is a reserved word in MATLAB and I just decided to have fun with ‘kontrol’.
##### 3 件のコメント1 件の古いコメントを表示1 件の古いコメントを非表示
Star Strider 2014 年 10 月 5 日

I appreciate the original paper. I didn’t find it in my search.
I’m not advocating anything — just doing my best to answer the question! All I did was convert the R function, and test it to be sure the code worked before I posted it.
I’m not surprised that ttest2 and the Crawford-Howell function give the same results. Apparently, Crawford and Howell thought there was some need for their approach in neuropsychology applications and got it published.
AwedBy Matlab 2014 年 10 月 5 日
Thanks a lot to both of you for your help!

サインインしてコメントする。

### カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by