Analyze Employment Data of College Faculty Members

Import employment data on members of a college faculty.

 In[1]:= Xdata = SemanticImport["ExampleData/categories-numbers"]
 Out[1]=

Pick out just the salary and rank columns.

 In[2]:= XsalaryRank = data[All, {"Salary", "Rank"}]
 Out[2]=

Plot rank versus salary.

 In[3]:= XListPlot[salaryRank, AxesLabel -> {"Salary", "Rank"}]
 Out[3]=

Determine the correlation between salary and rank.

 In[4]:= XN[Correlation @@ Transpose[Values[Normal[salaryRank]]]]
 Out[4]=

Make a function that shows the relationship between any two variables.

 In[5]:= XvisualizeData[var1_, var2_] := With[ {slice = data[All, {var1, var2}]}, Labeled[ ListPlot[slice, AxesLabel -> {var1, var2}], Row[{"\nCorrelation: ", N[Correlation @@ Transpose[Values /@ Normal[slice]]]}] ] ]
 In[6]:= XvisualizeData["Salary", "Rank"]
 Out[6]=

Make an interactive viewer that shows the relationship between any two variables.

 In[7]:= XWith[{keys = Keys[Normal[data][[1]]]}, Manipulate[ visualizeData[var1, var2], {var1, keys}, {var2, keys} ] ]
 Out[7]=

Mathematica

Questions? Comments? Contact a Wolfram expert »