NuclearGuy
IS-IT--Management
I'm a beginner with SQL started on monday.
I could use some help.
My table:
column name
1 Anterior_read
2 Septum_read
3 Apical_ read
4 InferiorApical_read
5 PosteriorLaterial_read
6 Inferior_read
7 Anterior_cath
8 Septum_cath
9 Apical_ cath
10 InferiorApical_cath
11 PosteriorLaterial_cath
12 Inferior_cath
DATA in each row: Normal Scar Ischemia
What I want to know:
1) What is the percent correlation between reader (read) and cardiac Catheterization (cath)
(column 1 = column 7)+ (column 2 = column 8)+ (column 3= column 9)+ (column 4 = column 10)+ (column 5 = column 11)+ (column 6= column 12) = total "agree segments" / total possible agreements
example1: Anterior_Read Septum_Read Apical_Read InferiorApical_read PosteriorLateral_read Inferior_read
Normal Scar Scar Normal Normal Ischemia
Anterior_cath Septum_cath Apical_cath InferiorApical_cath PosteriorLateral_cath Inferior_cath
Normal Scar Scar Normal Normal Ischemia
if we compare: Anterior_read to anterior_cath (normal = normal) = 1
Septum_read to Septum_cath (scar = scar) = 1
Apical_Read to Apical_cath (scar = scar) = 1
InferiorApical_read to InferiorApical_cath (normal = normal) = 1
PosteriorLateral_read to PosteriorLateral_cath (normal = normal) = 1
Inferior_read to Inferior_cath (Ischemia = Ischemia) =1
There were 6 possible comparisons 6 out of a possible 6 = 6/6 = 100% correlation.
example2: Anterior_Read Septum_Read Apical_Read InferiorApical_read PosteriorLateral_read Inferior_read
Normal Scar Scar Normal Normal Ischemia
Anterior_cath Septum_cath Apical_cath InferiorApical_cath PosteriorLateral_cath Inferior_cath
Normal Normal Normal Normal Normal Normal
if we compare: Anterior_read to anterior_cath (normal = normal) = 1
Septum_read to Septum_cath (scar = Normal) = 0
Apical_Read to Apical_cath (scar = normal) = 0
InferiorApical_read to InferiorApical_cath (normal = normal) = 1
PosteriorLateral_read to PosteriorLateral_cath (normal = normal) = 1
Inferior_read to Inferior_cath (Ischemia = Normal) =0
There were 6 possible comparisons 3 out of a possible 6 = 3/6 = 50% correlation.
What I have written so far:
SELECT Anterior_read, Anterior_cath, Sum(1) AS Anterior_Agree, Septum_read, Septum_cath, Sum(1) AS Septum_Agree, Apical_read, Apical_cath, Sum(1) AS Apical_Agree, InferiorApical_read, InferiorApical_cath, Sum(1) AS InferiorApical_Agree, Inferior_read, Inferior_cath, Sum(1) AS Inferior_Agree, PosteriorLateral_read, PosteriorLateral_cath, Sum(1) AS PosteriorLateral_Agree
FROM tblComments
GROUP BY Anterior_read, Anterior_cath, Septum_read, Septum_cath, Apical_read, Apical_cath, InferiorApical_read, InferiorApical_cath, Inferior_read, Inferior_cath, PosteriorLateral_read, PosteriorLateral_cath
HAVING (((Anterior_read="normal") AND (Anterior_cath="Normal") OR
(Anterior_read="scar") AND (Anterior_cath="scar") OR
(Anterior_read="ischemia") AND (Anterior_cath="ischemia")) AND
((Septum_read="normal") AND (Septum_cath="Normal") OR
(Septum_read="scar") AND (Septum_cath="scar") OR
(Septum_read="ischemia") AND (Septum_cath="ischemia")) AND
((Apical_read="normal") AND (Apical_cath="Normal") OR
(Apical_read="scar") AND (Apical_cath="scar") OR
(Apical_read="ischemia") AND (Apical_cath="ischemia")) AND
((InferiorApical_read="normal") AND (InferiorApical_cath="Normal") OR
(InferiorApical_read="scar") AND (InferiorApical_cath="scar") OR
(InferiorApical_read="ischemia") AND (InferiorApical_cath="ischemia")) AND
((Inferior_read="normal") AND (Inferior_cath="Normal") OR
(Inferior_read="scar") AND (Inferior_cath="scar") OR
(Inferior_read="ischemia") AND (Inferior_cath="ischemia")) AND
((PosteriorLateral_read="normal") AND (PosteriorLateral_cath="Normal") OR
(PosteriorLateral_read="scar") AND (PosteriorLateral_cath="scar") OR
(PosteriorLateral_read="ischemia") AND (PosteriorLateral_cath="ischemia")));
Thanks for your help!
Thank you,
stu
I could use some help.
My table:
column name
1 Anterior_read
2 Septum_read
3 Apical_ read
4 InferiorApical_read
5 PosteriorLaterial_read
6 Inferior_read
7 Anterior_cath
8 Septum_cath
9 Apical_ cath
10 InferiorApical_cath
11 PosteriorLaterial_cath
12 Inferior_cath
DATA in each row: Normal Scar Ischemia
What I want to know:
1) What is the percent correlation between reader (read) and cardiac Catheterization (cath)
(column 1 = column 7)+ (column 2 = column 8)+ (column 3= column 9)+ (column 4 = column 10)+ (column 5 = column 11)+ (column 6= column 12) = total "agree segments" / total possible agreements
example1: Anterior_Read Septum_Read Apical_Read InferiorApical_read PosteriorLateral_read Inferior_read
Normal Scar Scar Normal Normal Ischemia
Anterior_cath Septum_cath Apical_cath InferiorApical_cath PosteriorLateral_cath Inferior_cath
Normal Scar Scar Normal Normal Ischemia
if we compare: Anterior_read to anterior_cath (normal = normal) = 1
Septum_read to Septum_cath (scar = scar) = 1
Apical_Read to Apical_cath (scar = scar) = 1
InferiorApical_read to InferiorApical_cath (normal = normal) = 1
PosteriorLateral_read to PosteriorLateral_cath (normal = normal) = 1
Inferior_read to Inferior_cath (Ischemia = Ischemia) =1
There were 6 possible comparisons 6 out of a possible 6 = 6/6 = 100% correlation.
example2: Anterior_Read Septum_Read Apical_Read InferiorApical_read PosteriorLateral_read Inferior_read
Normal Scar Scar Normal Normal Ischemia
Anterior_cath Septum_cath Apical_cath InferiorApical_cath PosteriorLateral_cath Inferior_cath
Normal Normal Normal Normal Normal Normal
if we compare: Anterior_read to anterior_cath (normal = normal) = 1
Septum_read to Septum_cath (scar = Normal) = 0
Apical_Read to Apical_cath (scar = normal) = 0
InferiorApical_read to InferiorApical_cath (normal = normal) = 1
PosteriorLateral_read to PosteriorLateral_cath (normal = normal) = 1
Inferior_read to Inferior_cath (Ischemia = Normal) =0
There were 6 possible comparisons 3 out of a possible 6 = 3/6 = 50% correlation.
What I have written so far:
SELECT Anterior_read, Anterior_cath, Sum(1) AS Anterior_Agree, Septum_read, Septum_cath, Sum(1) AS Septum_Agree, Apical_read, Apical_cath, Sum(1) AS Apical_Agree, InferiorApical_read, InferiorApical_cath, Sum(1) AS InferiorApical_Agree, Inferior_read, Inferior_cath, Sum(1) AS Inferior_Agree, PosteriorLateral_read, PosteriorLateral_cath, Sum(1) AS PosteriorLateral_Agree
FROM tblComments
GROUP BY Anterior_read, Anterior_cath, Septum_read, Septum_cath, Apical_read, Apical_cath, InferiorApical_read, InferiorApical_cath, Inferior_read, Inferior_cath, PosteriorLateral_read, PosteriorLateral_cath
HAVING (((Anterior_read="normal") AND (Anterior_cath="Normal") OR
(Anterior_read="scar") AND (Anterior_cath="scar") OR
(Anterior_read="ischemia") AND (Anterior_cath="ischemia")) AND
((Septum_read="normal") AND (Septum_cath="Normal") OR
(Septum_read="scar") AND (Septum_cath="scar") OR
(Septum_read="ischemia") AND (Septum_cath="ischemia")) AND
((Apical_read="normal") AND (Apical_cath="Normal") OR
(Apical_read="scar") AND (Apical_cath="scar") OR
(Apical_read="ischemia") AND (Apical_cath="ischemia")) AND
((InferiorApical_read="normal") AND (InferiorApical_cath="Normal") OR
(InferiorApical_read="scar") AND (InferiorApical_cath="scar") OR
(InferiorApical_read="ischemia") AND (InferiorApical_cath="ischemia")) AND
((Inferior_read="normal") AND (Inferior_cath="Normal") OR
(Inferior_read="scar") AND (Inferior_cath="scar") OR
(Inferior_read="ischemia") AND (Inferior_cath="ischemia")) AND
((PosteriorLateral_read="normal") AND (PosteriorLateral_cath="Normal") OR
(PosteriorLateral_read="scar") AND (PosteriorLateral_cath="scar") OR
(PosteriorLateral_read="ischemia") AND (PosteriorLateral_cath="ischemia")));
Thanks for your help!
Thank you,
stu