필터 지우기
필터 지우기

please review the code for randomization test

조회 수: 1 (최근 30일)
BYUNGSUK KIM
BYUNGSUK KIM 2019년 12월 13일
Hi.
I created code for Randomization t-test (2-samples)
The final p value appears as 1 for all row data.
Please review the code below and the attached data for correctness.
The data I used is attached to Excel.
Thank you.
[code]
eA= y- yhatA;
eB= y- yhatB;
diff=eA.^2-eB.^2;
meandiff=mean(diff);
n=length(diff);
niter = 199
sum= 0;
for k = 1: niter
randomsign=2*round(rand(1,n))-1;
signeddiff =randomsign. *diff;
meansigneddiff=mean(signeddiff);
sum=sum+...
(abs(meansigneddiff)>
=abs(meandiff));
end
pvalue=(sum+1)/(niter+1)

답변 (0개)

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by