"Import the data of a circle with unknown radius R"
SetDirectory[NotebookDirectory[]];

"Check whether the files is in your current Directory[]"
FileExistsQ["datacircle.dat"]

"Now, import the file and name it 'rawdata' "
SetDirectory[NotebookDirectory[]];
rawdata=Import["datacircle.dat"];
lprawdata=ListPlot[rawdata,AspectRatio->1];
Print[lprawdata]

"Try drawing a circle with trial valued R and overlap it on the rawdata circle"
x[t_,R_]:=R*Cos[t];y[t_,R_]:=R*Sin[t];
pp[R_]:=ParametricPlot[{x[t,R],y[t,R]},{t,0,2Pi}];
Show[{pp[3.0],lprawdata}]

"How to quantify the error of the trial values of R with respect to the “true” R value of datacircle.dat?"
xrawdata[i_]:=rawdata[[i]][[1]];yrawdata[i_]:=rawdata[[i]][[2]];
Deltar[i_,R_]:=(R^2-(xrawdata[i]^2+yrawdata[i]^2))^2;
ilast=Length[rawdata];
variance[R_]:=Sum[Deltar[i,R]^2,{i,1,ilast}]/Length[rawdata];
stderror[R_]:=Sqrt[variance[R]];
Do[Print[{r,stderror[r]}];
,{r,0.1,2,0.05}
];

Plot[stderror[R],{R,0,2},AxesLabel->{"R","stderror"}]

tRstderror=Table[{R,stderror[R]},{R,0,2,0.05}];

"Try to figure out a way to abstract the info of the value of R in which sumerroriny = 0 occurs."
Min[tRstderror]

t2=Table[tRstderror[[i]][[2]],{i,1,Length[tRstderror]}]
Sort[t2]

positionofmin=Ordering[t2][[1]]
pairatmin=tRstderror[[positionofmin]]
minimisedstd=pairatmin[[2]]
ratminimum=pairatmin[[1]]