Tanggal 20 February 2009, Teh Lusi menanyakan bagaimana mengihung korelasi dengan sampel kecil n<30 (Untuk data skala interval atau rasio, Jika sampel besar bisa kita gunakan korelasi Pearson).
Saya sudah kasih software PRAM untuk menghitung korelasi dengan sampel kecil, beliau minta ” Kalo bisa dengan SPSS atau TSP”. Akhirnya dengan ijin Allah SWT, aku dapatkan metode tersebut dengan mencari di google.
Metode tersebut : LIN’S CONCORDANCE CORRELATION COEFFICIENT.
Dan Alhamdulillah akhirnya aku dapatkan pula syntax programnya dengan SPSS.
Semoga bisa bermanfaat, bagi siapa saja yang membutuhkan.
SYNTAX SPSS dari LIN’S CONCORDANCE CORRELATION COEFFICIENT
*********************************************
* LIN’S CONCORDANCE CORRELATION COEFFICIENT *
*********************************************
* (c) Marta Garcia-Granero (08/2005) *
* magrciagranero@gmail.com *
* Downloaded from: http://gjyp.nl/marta/Lin.sps*
* Feel free to use or modify this code, but *
* acknowledge the author and the web site *
*********************************************
DESCRIPTION
Lin’s concordance correlation coefficient measures how well a new set of
observations reproduce an original set. So, for example, it can be used to
assess the effectiveness of new instruments or measurement methods.
The coefficient is calculated by multiplying two components. The first is
the ordinary Pearson correlation coefficient, which essentially assesses the
linear relationship between the two sets of measurements. However, for the
second set to reproduce the first, the slope of the line relating the two
sets should be one, and the line should go through the origin. These other
aspects are assessed by the second component, which is known as Cb.
METHOD
The coefficient Rc is derived by Lin (1989) by considering how well the
relationship between the measurements is represented by a line through the
origin at an angle of 45 degrees (as would be generated if the two
measurements generated identical results):
Rc = 1 – dc²/du²
where dc² is the expected squared perpendicular deviation from the line, and
du² is the expected squared perpendicular deviation from the line when the
measurements are uncorrelated.
This can be written as
Rc = R × Cb
The term R is the standard Pearson product-moment correlation coefficient,
while Cb is a bias correction factor which is calculated by
Cb = 2 / (v + 1/v + u²)
v = s1/ s2
u = (m1 – m2) / SQRT(s1 × s2) –> ‘Mean shift’
where mi and si (i = 1,2) are the mean and standard deviation of the ith set
of measurements.
The Z-transformation (Fisher) is
Z = 0.5 × (log(1 + Rc)/(1 – Rc))
The standard deviation of the Z-transformed coefficient is calculated as
defined by Lin (2000). See formula 31 & 32 in: “Assessment of the Adequacy
of Mathematical Models”, by Luis Orlindo Tedeschi.
http://nutritionmodels.tamu.edu/mes/docs/model_adequacy.pdf
SCALE
0.21–0.40 Fair
0.41–0.60 Moderate
0.61–0.80 Substantial
0.81–1.00 Almost perfect
REFERENCES
- Lin, L.I. (1989). A concordance correlation coefficient to evaluate
reproducibility. Biometrics, 45, 255-268.
- Lin, L.I. (2000). A note on the concordance correlation coefficient.
Biometrics, 56, 324-325.
* BEGINNING OF SYNTAX *.
DEFINE LINCCC(!POS=!CMDEND).
MATRIX.
PRINT /TITLE=”Lin’s Concordance Coefficient”.
GET pair
/VARIABLES=!1
/NAMES=vname
/MISSING OMIT.
COMPUTE n=NROW(pair).
COMPUTE mean=CSUM(pair)/n.
COMPUTE variance=(CSSQ(pair)-n*mean&**2)/(n-1).
PRINT {mean;variance}
/TITLE=’X & Y Statistics’
/FORMAT=’F8.3′
/RLABELS=’Mean’,'Variance’
/CNAMES=vname.
PRINT n
/TITLE=’Nr. of valid pairs’
/FORMAT=’F8.0′.
COMPUTE covxy=((T(pair(:,1))*pair(:,2))-n*mean(1)*mean(2))/(n-1).
COMPUTE r=covxy/SQRT(variance(1)*variance(2)).
COMPUTE ncovxy=covxy*(n-1)/n.
COMPUTE nvarx=variance(1)*(n-1)/n.
COMPUTE nvary=variance(2)*(n-1)/n.
COMPUTE sdx=SQRT(nvarx).
COMPUTE sdy=SQRT(nvary).
COMPUTE lcc=2*ncovxy/(nvarx+nvary+(mean(1)-mean(2))**2).
COMPUTE cb=lcc/r.
COMPUTE zr=.5*LN((1+lcc)/(1-lcc)).
COMPUTE u=((n-1)/n)*(mean(1)-mean(2))/(SQRT(sdx*sdy)).
COMPUTE u2=u**2.
COMPUTE u4=u**4.
COMPUTE r2=r**2.
COMPUTE rc2=lcc**2.
COMPUTE rc3=lcc**3.
COMPUTE rc4=lcc**4.
COMPUTE term1=((1-r2)*rc2)/((1-rc2)*r2).
COMPUTE term2=(2*(rc3-rc4)*u2)/(r*((1-rc2)**2)).
COMPUTE term3=(rc4*u4)/(2*r2*((1-rc2)**2)).
COMPUTE sezr=SQRT((term1+term2-term3)/(n-2)).
COMPUTE lowz1=zr-1.645*sezr.
COMPUTE lowzr=zr-1.959964*sezr.
COMPUTE uppzr=zr+1.959964*sezr.
COMPUTE lowr1=((exp(2*lowz1))-1)/((exp(2*lowz1))+1).
COMPUTE lowr=((exp(2*lowzr))-1)/((exp(2*lowzr))+1).
COMPUTE uppr=((exp(2*uppzr))-1)/((exp(2*uppzr))+1).
PRINT {covxy,r}
/TITLE=’Association statistics’
/FORMAT=’F8.4′
/CLABELS=”Cov.”,”R”.
PRINT {lcc,cb,ABS(u)}
/TITLE=”Lin’s Concordance Coefficient & related statistics”
/CLABELS=’Rc’,'Cb’,'Mn.Shift’
/FORMAT=’F8.3′.
PRINT {lowr,uppr}
/FORMAT=’F8.3′
/CLABELS=’Lower’ ‘Upper’
/TITLE=’95%CI for Rc’.
PRINT lowr1
/FORMAT=’F8.3′
/TITLE=’Lower one-sided 95% CL for Rc’.
PRINT {zr,sezr}
/FORMAT=’F8.3′
/CLABEL=’Z',’SE(Z)’
/TITLE=’Fisher transformation:’.
END MATRIX.
!ENDDEFINE.
* Sample dataset *.
DATA LIST LIST /var1 var2 (2 F8.0).
begin data
494 512
395 430
516 520
434 428
476 500
557 600
413 364
442 380
650 658
433 445
417 432
656 626
267 260
478 477
178 259
423 350
427 451
END DATA.
LINCCC var1 var2.
* END OF SYNTAX *.
=============================
OUTPUTNYA
=============================
Run MATRIX procedure:
Lin’s Concordance Coefficient
X & Y Statistics
var1 var2
Mean 450.353 452.471
Variance 13528.62 12795.01
Nr. of valid pairs
17
Association statistics
Cov. R
12410.45 .9433
Lin’s Concordance Coefficient & related statistics
Rc Cb Mn.Shift
.943 .999 .018
95%CI for Rc
Lower Upper
.851 .979
Lower one-sided 95% CL for Rc
.871
Fisher transformation:
Z SE(Z)
1.762 .257
—— END MATRIX —–
Menggunakan sampel data sebanyak 3.
* Sample dataset *.
DATA LIST LIST /var1 var2 (2 F8.0).
begin data
494 512
395 430
516 520
END DATA.
Output Korelasi dengan sampel sebanyak 3:
Run MATRIX procedure:
Lin’s Concordance Coefficient
X & Y Statistics
var1 var2
Mean 468.333 487.333
Variance 4154.333 2481.333
Nr. of valid pairs
3
Association statistics
Cov. R
3197.333 .9959
Lin’s Concordance Coefficient & related statistics
Rc Cb Mn.Shift
.891 .895 .274
95%CI for Rc
Lower Upper
.398 .985
Lower one-sided 95% CL for Rc
.525
Fisher transformation:
Z SE(Z)
1.427 .513
—— END MATRIX —–
Posted in 1
Tags: Menghitung korelasi dengan sampel kecil