Normality test temperature data

조회 수: 2 (최근 30일)
Sarah Yun
Sarah Yun 2019년 12월 14일
편집: dpb 2019년 12월 15일
Hi,
I have a column of temp data - some neagative values.
I applied a KS and lillietest to the data - it is NOT normally distributed.
As data has negative values, I can't apply a log transform.
Even if I apply log transform, the data takes on non-real values e.g. 5.21493575760899 + 3.14159265358979i
Any ideas how I can transform the data to make it normally distributed?
Nothing too complicated - I am a beginner.
Thank you.
  댓글 수: 1
dpb
dpb 2019년 12월 15일
편집: dpb 2019년 12월 15일
"Any ideas how I can transform the data to make it normally distributed?"
W/O any idea of what the data looks like, no.
But, there may be no need...what is end objective?
However, if you feel compelled the Box-Cox transformation is one common technique that is pretty general. See <NIST handbook EDA Box-Cox Transformation>

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

답변 (1개)

Ridwan Alam
Ridwan Alam 2019년 12월 15일
편집: Ridwan Alam 2019년 12월 15일
Since linear shift won't affect the distribution, you can shift the data and perform log transformation.
%% test data
data = randn(1000,1);
data = data - min(data) + 1;
% making sure that the data is not normal
data = exp(data);
% also, since your data has many negative values
data = data - 0.9*max(data);
lillietest(data) % ans = 1
% LOG TRANSFORMATION
% first, shift your data to all positive range
posdata = data - min(data) + 1;
lillietest(posdata) % ans = 1
% then, perform log transformation
logdata = log(posdata);
lillietest(logdata) % ans = 0
Hope this helps!

카테고리

Help CenterFile Exchange에서 Hypothesis Tests에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by