Atakpame

Minimum Temperature

Minimum=Import["http://ceadserv1.nku.edu/longa//classes/2018spring/mat375/data/BinaoData/RawMonthly/TOGO-TEMPERATUREMOYENNEMINIMALE61-15.xls"];

Years = Table[Minimum[[4,i]][[2]], {i,7,61}];
Years = Years - 1961;

MinTemp = Flatten[Table[Minimum[[4,i]][[j]], {i,7,61},{j,3,14}]];
DecimalYears = Flatten[Table[Years[[i]]+(j/12),{i,1,55},{j,1,12}]];
MinTable = Table[{DecimalYears[[i]],MinTemp[[i]]},{i,1,660}];

Fitting data with yearly oscillations and quadratic trend

lm=LinearModelFit[MinTable,{x,(x^2),Sin[2π*x],Cos[2π*x]},x,ConfidenceLevel->0.95]

p1=Plot[lm[x],{x,0,55}]
MinPlot=ListPlot[MinTable];
Show[p1,MinPlot,Frame->True]

ListPlot[lm["FitResiduals"],Filling->Axis]

lm["ParameterConfidenceIntervals"]

lm["ParameterTable"]

params=lm["BestFitParameters"]

lm["RSquared"]

Maximum Temperature

Maximum =Import["http://ceadserv1.nku.edu/longa//classes/2018spring/mat375/data/BinaoData/RawMonthly/TOGO-TEMPERATUREMOYENNEMAXIMALE61-15.xls"];
Years = Table[Maximum[[4,i]][[2]], {i,8,62}];
Years= Years-1961;
MaxTemp = Flatten[Table[Maximum[[4,i]][[j]], {i,8,62},{j,3,14}]];
DecimalYears = Flatten[Table[Years[[i]]+(j/12),{i,1,55},{j,1,12}]];
MaxTable = Table[{DecimalYears[[i]],MaxTemp[[i]]},{i,1,660}];

Fitting data with yearly oscillations and quadratic trend

lm=LinearModelFit[MaxTable,{x,Sin[2π*x],Cos[2π*x]},x,ConfidenceLevel->0.95]

p1=Plot[lm[x],{x,0,55}]
MaxPlot=ListPlot[MaxTable];
Show[p1,MaxPlot,Frame->True]

ListPlot[lm["FitResiduals"],Filling->Axis]

lm["ParameterConfidenceIntervals"]

lm["ParameterTable"]

params=lm["BestFitParameters"]

lm["RSquared"]