# How to estimate the Statistical Significance of a Correlation When the Data Are Serially Correlated in matlab?

조회 수: 26 (최근 30일)
Subhodh Sharma 2022년 3월 17일
편집: Subhodh Sharma 2022년 3월 21일
I want to calculate the statistical significance of a computed correlation coefficient when serial correlation is a concern.
I have two variables (var1 and var2). Data is attached.
I have computed lag correlation between the two time series following the standard procedure. Now I want to check whether estimated the correlation is significant or not using a matlab code.
Looking forward to your valuable suggestions.
For your better understanding on the problem you can refer to this paper

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

### 답변 (1개)

Scott MacKenzie 2022년 3월 17일
편집: Scott MacKenzie 2022년 3월 17일
MATLAB's corrcoef function provides the correlation (r) as well as the significance (p) of the correlation. For your data set, the correlation is not significant (p > .05):
a = M(:,1);
b = M(:,2);
nanIdx = isnan(a); % seems there are a few nans in a, remove
a = a(~nanIdx);
b = b(~nanIdx);
[r, p] = corrcoef(a,b);
fprintf('r=%.4f, p=%.4f\n', r(1,2), p(1,2));
r=0.0948, p=0.1472
##### 댓글 수: 2없음 표시없음 숨기기
Subhodh Sharma 2022년 3월 17일
편집: Subhodh Sharma 2022년 3월 17일
I am looking for significance test ( for p value) on my cross correlation analysis.(xcorr in matlab)
That is significance values (p values) of my cross correlations. And am I supposed to do a t-test? or a Z-test? (or any hypothesis test)
I actually need to calculate p-value for Cross-Correlation for two time series ( with my provided data) with delay?
Hope this clears my need.
Scott MacKenzie 2022년 3월 17일
Sorry, not sure.

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

### 카테고리

Help CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

R2017b

### Community Treasure Hunt

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

Start Hunting!

Translated by