figsize[inches_] := inches(468/3.125);

Input data

{dataDA} = Import["/Users/dmeyer/Teaching/111fall19/golf/2019drivingaccuracy.xlsx"];
Dimensions[dataDA]
dataDA[[1]]
dataDA[[2]]

{dataDD} = Import["/Users/dmeyer/Teaching/111fall19/golf/2019drivingdistance.xlsx"];
Dimensions[dataDD]
dataDD[[1]]
dataDD[[2]]

{dataP510} =
Import["/Users/dmeyer/Teaching/111fall19/golf/2019putts5to10.xlsx"];
Dimensions[dataP510]
dataP510[[1]]
dataP510[[2]]

{dataW} =
Import["/Users/dmeyer/Teaching/111fall19/golf/2019winnings.xlsx"];
Dimensions[dataW]
dataW[[1]]
dataW[[2]]

Organize data

data = {};
Do[
recordDA = dataDA[[i]];
name = recordDA[[3]];
hitfraction = recordDA[[6]]/recordDA[[7]];
{recordDD} = Select[dataDD,#[[3]]==name &];
If[recordDD≠{},
dave = recordDD[[6]]/recordDD[[7]];
{recordP510} = Select[dataP510,#[[3]]==name &];
If[recordP510≠{},
madefraction = recordP510[[7]]/recordP510[[6]];
{recordW} = Select[dataW,#[[3]]==name &];
If[recordW ≠{},
avewinnings = recordW[[5]]/recordW[[4]];
AppendTo[data,{name,dave,hitfraction,madefraction,avewinnings}]
]
]
],
{i,2,Length[dataDA]}
];
Length[data]

Plot data

plotdataDDW =
Table[{data[[i,2]],data[[i,5]]},{i,1,Length[data]}];
ListPlot[
plotdataDDW,
PlotStyle->Red,
PlotRange->All,
BaseStyle->{FontSize->18},
AxesLabel->{"drive dist.","winnings"},
ImageSize->figsize[5]
]
Print["correlation = ",Correlation[plotdataDDW[[All,1]],plotdataDDW[[All,2]]]];

plotdataDAW =
Table[{data[[i,3]],data[[i,5]]},{i,1,Length[data]}];
ListPlot[
plotdataDAW,
PlotStyle->Red,
PlotRange->All,
BaseStyle->{FontSize->18},
AxesLabel->{"drive acc.","winnings"},
ImageSize->figsize[5]
]
Print["correlation = ",Correlation[plotdataDAW[[All,1]],plotdataDAW[[All,2]]]];

plotdataP510W =
Table[{data[[i,4]],data[[i,5]]},{i,1,Length[data]}];
ListPlot[
plotdataP510W,
PlotStyle->Red,
PlotRange->All,
BaseStyle->{FontSize->18},
AxesLabel->{"putt acc.","winnings"},
ImageSize->figsize[5]
]
Print["correlation = ",Correlation[plotdataP510W[[All,1]],plotdataP510W[[All,2]]]];

Linear model

rdata = Transpose[Rest[Transpose[data]]];
lm = LinearModelFit[rdata,{dd,da,pa},{dd,da,pa}];
Normal[lm]

{c0,c1,c2,c3} = lm["BestFitParameters"];
f[dd_,da_,pa_] := c0 + {c1,c2,c3}.{dd,da,pa};
fitdata =
Table[{f[rdata[[i,1]],rdata[[i,2]],rdata[[i,3]]],rdata[[i,4]]},{i,1,Length[rdata]}];
ListPlot[
fitdata,
PlotStyle->Blue,
PlotRange->All,
BaseStyle->{FontSize->18},
AxesLabel->{"linear fit","winnings"},
ImageSize->figsize[5]
]
Correlation[fitdata[[All,1]],fitdata[[All,2]]]

lm["RSquared"]
lm["ParameterTable"]

Plot winning vs drive distance * drive accuracy

plotdddaW = Table[{data[[i,2]]*data[[i,3]],data[[i,5]]},{i,1,Length[data]}];
ListPlot[
plotdddaW,
PlotStyle->Darker[Green],
PlotRange->All,
BaseStyle->{FontSize->18},
AxesLabel->{"da*dd","winnings"},
ImageSize->figsize[5]
]
Print["correlation = ",Correlation[plotdddaW[[All,1]],plotdddaW[[All,2]]]];

Plot winnings

dataW = Reverse[Sort[Table[data[[i,5]],{i,1,Length[data]}]]];
plotdataW = Table[{r,dataW[[r]]},{r,1,Length[dataW]}];
ListPlot[
plotdataW,
PlotStyle->Red,
PlotRange->All,
BaseStyle->{FontSize->18},
AxesLabel->{"rank","winnings"},
ImageSize->figsize[5]
]

ListLogLogPlot[
Take[plotdataW,148],
PlotStyle->Red,
PlotRange->All,
BaseStyle->{FontSize->18},
AxesLabel->{"rank","winnings"},
ImageSize->figsize[5]
]

Product model

ldata = 
Table[
{Log[rdata[[i,1]]],Log[rdata[[i,2]]],Log[rdata[[i,3]]],Log[rdata[[i,4]]]},{i,1,Length[rdata]}
];
lm = LinearModelFit[ldata,{logdd,logda,logpa},{logdd,logda,logpa}];
Normal[lm]

{c0,c1,c2,c3} = lm["BestFitParameters"];
f[logdd_,logda_,logpa_] := c0 + {c1,c2,c3}.{logdd,logda,logpa};
fitdata =
Table[{f[ldata[[i,1]],ldata[[i,2]],ldata[[i,3]]],ldata[[i,4]]},{i,1,Length[ldata]}];
ListPlot[
fitdata,
PlotStyle->Blue,
PlotRange->All,
BaseStyle->{FontSize->18},
AxesLabel->{"nonlinear model","winnings"},
ImageSize->figsize[5]
]
Correlation[fitdata[[All,1]],fitdata[[All,2]]]
lm["RSquared"]
lm["ParameterTable"]