Event Study - Non Parametric Tests

조회 수: 4 (최근 30일)
Daniel
Daniel 2013년 8월 24일
I have run this code, but it does not yield the same result as in Excel?
%%%%%T4 Statistics Calculation
S_adj_T4 = S_adj_T3_2 ;
rep_S_adj_T4 = repmat(S_adj_T4, L1+L2, 1) ;
AR_all = [AR_est ; AR_event] ;
adj_stand_AR_T4 = AR_all./rep_S_adj_T4 ;
rank_T4 = tiedrank(adj_stand_AR_T4) ;
U_T4 = rank_T4/((L1+L2)+1) - 1/2 ;
for i = 1 : L1+L2 ;
sum_U_T4(i) = nansum(U_T4(i, :)) ;
end
for i = 1 : L1+L2 ;
nPos_T4(i) = nansum(U_T4(i,:)>0);
end ;
for i = 1 : L1+L2 ;
sqrt_T4(i) = 1/(sqrt(nPos_T4( : , i))) ;
end ;
q = nansum((sum_U_T4.*sqrt_T4).*(sum_U_T4.*sqrt_T4)) ;
S_k = sqrt(1/(L1+L2)*q) ;
for i = 1 : L1+L2 ;
T4stat(i) = (1/sqrt(N)*sum_U_T4( : , i))/S_k ;
end ;
T4stat = T4stat( : , L1+1:end) ;
for i = 1 : L1+L2 ;
T4CARstat(i) = (1/sqrt(N)*sum_U_T4( : , i))/(S_k*sqrt(L2)) ;
end ;
T4CARstat = nansum(T4CARstat( : , L1+1:end)) ;
  댓글 수: 3
Daniel
Daniel 2013년 8월 24일
Sorry something must have slipped in the final inserting of the code. The questions is whether it reflects a certain formula. But I do not seem able to upload pictures or excel sheets in the forum.
Do you have any suggestions for this?
the cyclist
the cyclist 2013년 8월 24일
See the replies here:
I would warn you, though, that I don't think you will get someone willing to go line-by-line through your code, and guess what is happening in Excel that might be different.
I think you might need to narrow your problem a little.

댓글을 달려면 로그인하십시오.

답변 (1개)

Daniel
Daniel 2013년 8월 25일
Fair enough. I will work to narrowing down my problem, however, it is basically, just how to write a formula correctly in Matlab, because it seems that the code I have written so far does not retrieve the correct result.
I will post again, if I have narrowed down the problem and have a specific question to ask.
Nonetheless Thank you for your comments.

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by