Nrog Spearman cov qib sib piv sib piv peb tuaj yeem txheeb xyuas seb ob qho kev hloov pauv puas muaj kev cuam tshuam kev ua haujlwm monotonic (uas yog, thaum ib tus lej nce ntxiv, lwm tus lej tseem yuav nce ntxiv, lossis hloov pauv). Txhawm rau xam Spearman cov qib sib piv sib piv, koj yuav tsum tau qeb duas thiab sib piv cov ntaub ntawv teeb tsa kom pom d2, thiab tom qab ntawd nkag mus rau cov ntaub ntawv rau hauv tus txheej txheem lossis yooj yim Spearman qib sib piv sib piv cov mis. Koj kuj tseem tuaj yeem suav cov coefficients no siv cov qauv Excel lossis R cov lus txib.
Kauj ruam
Txoj Kev 1 ntawm 3: Txoj hauv kev
Kauj Ruam 1. Tsim lub rooj
Cov lus tau siv los suav nrog txhua cov ntaub ntawv xav tau los laij cov Spearman Rank Correlation Coefficient. Koj xav tau ib lub rooj zoo li no:
- Tsim 6 kab nrog cov npe, zoo li hauv qhov piv txwv.
- Npaj kom muaj ntau kab dawb paug raws li tus lej ntawm cov ntaub ntawv khub.
Kauj Ruam 2. Sau thawj ob kab ntawv nrog cov ntaub ntawv ua khub
Kauj Ruam 3. Nkag mus rau qeb qeb ntawm thawj pawg ntawm cov ntaub ntawv hauv kab thib peb los ntawm 1 txog n (tus naj npawb ntawm cov ntaub ntawv)
Muab qhov ntsuas ntawm 1 rau tus nqi qis tshaj, ntsuas ntawm 2 rau tus nqi qis tshaj tom ntej, thiab ntxiv rau.
Kauj Ruam 4. Hauv kem plaub, ua tib yam li hauv qib 3, tab sis txhawm rau txheeb xyuas cov ntaub ntawv hauv kab thib ob
-
Yog tias muaj ob (lossis ntau dua) cov ntaub ntawv uas muaj tus nqi zoo ib yam, suav qhov ntsuas nruab nrab ntawm cov ntaub ntawv, thiab tom qab ntawd nkag mus rau hauv lub rooj raws tus nqi nruab nrab no.
Hauv qhov piv txwv ntawm sab xis, muaj ob qhov txiaj ntsig ntawm 5 ntawm kev ntaus nqi 2 thiab 3. Txij li thaum muaj ob 5s, nrhiav qhov nruab nrab ntawm kev ntaus nqi. Qhov nruab nrab ntawm 2 thiab 3 yog 2.5, yog li sau tus nqi ntsuas ntawm 2.5 rau ob qho txiaj ntsig 5.
Kauj Ruam 5. Hauv kem "d" xam qhov sib txawv ntawm ob tus lej hauv qeb qeb
Ntawd yog, yog tias ib kab ntawv nyob qib 1 thiab lwm kem yog qeb 3, qhov sib txawv yog 2. (Qhov kos npe tsis muaj teeb meem, vim tias cov kauj ruam tom ntej yog txhawm rau ntsuas tus nqi.)
Kauj Ruam 6. Txiav txhua tus lej hauv kab "d" thiab sau qhov tshwm sim hauv kab "d"2".
Kauj Ruam 7. Ntxiv tag nrho cov ntaub ntawv hauv kab d2".
Qhov tshwm sim yog d2.
Kauj Ruam 8. Xaiv ib qho ntawm cov qauv hauv qab no:
-
Yog tias tsis muaj kev ntsuas zoo ib yam li hauv cov kauj ruam dhau los, sau tus nqi no hauv qhov yooj yim Spearman Rank Correlation Coefficient formula
thiab hloov "n" nrog cov lej ntawm cov ntaub ntawv kom tau txais qhov txiaj ntsig.
-
Yog tias muaj qib sib xws hauv qib dhau los, siv tus qauv Spearman Rank Correlation Coefficient formula:
Kauj Ruam 9. Txhais cov txiaj ntsig
Tus nqi tuaj yeem sib txawv ntawm -1 thiab 1.
- Yog tias tus nqi ze rau -1, kev sib raug zoo tsis zoo.
- Yog tias tus nqi ze rau 0, tsis muaj kev sib txheeb ncaj ncaj.
- Yog tias tus nqi ze rau 1, kev sib raug zoo yog qhov zoo.
Txoj Kev 2 ntawm 3: Siv Excel
Kauj Ruam 1. Tsim kab ntawv tshiab rau cov ntaub ntawv nrog rau nws qeb duas
Piv txwv li, yog tias koj cov ntaub ntawv nyob hauv Kab A2: A11, siv cov qauv "= RANK (A2, A $ 2: A $ 11)", thiab luam nws kom txog thaum nws npog tag nrho cov kab thiab kab.
Kauj Ruam 2. Hloov tib qho kev ntsuas raws li tau piav qhia hauv qib 3 thiab 4 ntawm txoj kev 1
Kauj Ruam 3. Hauv lub cell tshiab, xam qhov sib txheeb ntawm ob kab nyob qib nrog cov qauv "= CORREL (C2: C11, D2: D11)"
Hauv qhov piv txwv no, C thiab D xa mus rau kab ntawv uas qeb duas nyob. Lub xovtooj tshiab yuav puv nrog Spearman Rank Correlation.
Txoj Kev 3 ntawm 3: Siv R
Kauj Ruam 1. Nruab qhov program R ua ntej yog tias koj tsis muaj nws lawm
(Saib
Kauj Ruam 2. Khaws koj cov ntaub ntawv hauv CSV daim ntawv, muab cov ntaub ntawv koj xav nrhiav kom muaj kev sib txheeb hauv thawj ob kab
Peb tuaj yeem ua qhov no los ntawm kev siv "Save as" menu.
Kauj Ruam 3. Qhib R Editor
Yog tias koj ua haujlwm los ntawm lub davhlau ya nyob twg, tsuas yog khiav R. Yog tias koj ua haujlwm los ntawm lub desktop, nyem R icon.
Kauj Ruam 4. Ntaus cov lus txib hauv qab no:
- d <- read.csv ("NAME_OF_YOUR_CSV.csv") thiab nias Enter.
- nrum (qib (d [, 1]), qib (d [, 2]))
Lub tswv yim
Cov ntaub ntawv yuav tsum muaj tsawg kawg 5 khub kom pom qhov sib txawv (tus naj npawb ntawm cov ntaub ntawv yog 3 khub hauv qhov piv txwv tsuas yog ua kom yooj yim suav.)
Ceeb toom
- Spearman qib kev sib txheeb sib piv tsuas yog qhia txog lub zog ntawm kev sib txheeb uas cov ntaub ntawv nce lossis poob tas li. Yog tias muaj lwm qhov sib txawv hauv cov ntaub ntawv, Spearman qib sib txheeb tsis muaj yuav muab tus sawv cev raug.
- Cov mis no yog ua raws qhov kev xav tias tsis muaj kev ntsuas sib npaug. Thaum muaj qib ib yam li hauv qhov piv txwv, peb yuav tsum siv lub ntsiab lus no: qhov sib piv sib piv ntawm lub sijhawm sib kis los ntawm qib.