Sample Tabular Data: Cardiac Disease

Source Notebook

Various health-related parameters collected from individuals in coronary heart disease study

Details

The results of various non-invasive diagnostic tests along with other relevant patient information collected from 303 individuals: age, chest pain type, resting BP, cholesterol level, fasting blood sugar, maximal heart rate, ST depression, ST segment slope, number of major vessels colored by fluoroscopy, thallium stress test, diagnosis of heart disease.

Examples

Basic Examples (3) 

In[1]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Cardiac Disease\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Cardiac Disease-Input",
AutoDelete->True]\)]
Out[1]=

Data dimensions:

In[2]:=
Dimensions[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Cardiac Disease\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Cardiac Disease-Input",
AutoDelete->True]\)]]
Out[2]=

Column keys and descriptions:

In[3]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Cardiac Disease\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Cardiac Disease-Input",
AutoDelete->True]\), "ColumnKeys"]
Out[3]=
In[4]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Cardiac Disease\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Cardiac Disease-Input",
AutoDelete->True]\), "ColumnDescriptions"] // Dataset
Out[4]=

Column types:

In[5]:=
ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Cardiac Disease\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Cardiac Disease-Input",
AutoDelete->True]\), "ColumnTypes"]
Out[5]=

Scope & Additional Elements (3) 

Compute mean heart rate and mean blood sugar level for each of the diagnosis groups:

In[6]:=
PivotTable[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Cardiac Disease\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Cardiac Disease-Input",
AutoDelete->True]\)], {"mean hr" -> (Mean[#"Heart Rate"] &), "mean blood sugar" -> (Mean[#"Blood Sugar"] &)}, "Diagnosis", IncludeGroupAggregates -> True]
Out[6]=

Tally thallium stress test results:

In[7]:=
AggregateRows[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Cardiac Disease\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Cardiac Disease-Input",
AutoDelete->True]\)], "counts" -> Function[Length[#Thallium]], "Thallium"]
Out[7]=

There are non-numeric values in Thallium column - therefore the type of that column is not numeric:

In[8]:=
ColumnTypes[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Cardiac Disease\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Cardiac Disease-Input",
AutoDelete->True]\)]]["Thallium"]
Out[8]=

Visualizations (2) 

Plot blood pressure as a function of age:

In[9]:=
ListPlot[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Cardiac Disease\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Cardiac Disease-Input",
AutoDelete->True]\)] -> {"Age", "Cholesterol"}, AxesLabel -> {"Age", "Cholesterol"}]
Out[9]=

The correlation:

In[10]:=
AggregateRows[ResourceData[\!\(\*
TagBox["\"\<Sample Tabular Data: Cardiac Disease\>\"",
#& ,
BoxID -> "ResourceTag-Sample Tabular Data: Cardiac Disease-Input",
AutoDelete->True]\)], "correlation" -> Function[N[Correlation[#Cholesterol, #Age]]]] // Normal
Out[10]=

Gosia Konwerska, "Sample Tabular Data: Cardiac Disease" from the Wolfram Data Repository (2024)  

Data Resource History

Source Metadata

See Also

Publisher Information