Normality test temperature data

2 Ansichten (letzte 30 Tage)
Sarah Yun
Sarah Yun am 14 Dez. 2019
Bearbeitet: dpb am 15 Dez. 2019
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 Kommentar
dpb
dpb am 15 Dez. 2019
Bearbeitet: dpb am 15 Dez. 2019
"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>

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Ridwan Alam
Ridwan Alam am 15 Dez. 2019
Bearbeitet: Ridwan Alam am 15 Dez. 2019
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!

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by