Normality test temperature data
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
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>
Antworten (1)
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!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Hypothesis Tests finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!