Statistical analysis

Importing the data

NukeTF1=Transpose[Import["./NukeTF1.csv","Data"]];
NukeTF2=Transpose[Import["./NukeTF2.csv","Data"]];
RenTF1=Transpose[Import["./RenTF1.csv","Data"]];
RenTF2=Transpose[Import["./RenTF2.csv","Data"]];

Calculating the covariances

In what follows, we note that the index 2 of RenTF and NukeTF corresponds to the fraction of nuclear, index 3 corresponds to the fraction of renewables, index 4 are the CO2eq emissions per capita and index 5 is the GDP per capita.

rTF1={RenTF1[[2,All]],RenTF1[[3,All]],100-RenTF1[[2,All]]-RenTF1[[3,All]]};
rTF2={RenTF2[[2,All]],RenTF2[[3,All]],100-RenTF2[[2,All]]-RenTF2[[3,All]]};
nTF1={NukeTF1[[2,All]],NukeTF1[[3,All]],100-NukeTF1[[2,All]]-NukeTF1[[3,All]]};
nTF2={NukeTF2[[2,All]],NukeTF2[[3,All]],100-NukeTF2[[2,All]]-NukeTF2[[3,All]]};

MatrixForm[Table[Covariance[rTF1[[i,All]]/100,rTF1[[j,All]]/100],{i,1,3},{j,1,3}]]
MatrixForm[Table[Covariance[rTF2[[i,All]]/100,rTF2[[j,All]]/100],{i,1,3},{j,1,3}]]
MatrixForm[Table[Covariance[nTF1[[i,All]]/100,nTF1[[j,All]]/100],{i,1,3},{j,1,3}]]
MatrixForm[Table[Covariance[nTF2[[i,All]]/100,nTF2[[j,All]]/100],{i,1,3},{j,1,3}]]

Studying the distributions of R, N and F

PairedHistogram[RenTF1[[2,All]]/100,RenTF2[[2,All]]/100,"Sturges",LabelingFunction->Center,BarOrigin->"XAxis",ChartStyle->{"Pastel",None,None},ChartLegends->{"Timeframe 1","Timeframe 2"},PlotLabel->"Fraction of nuclear (N)"]
PairedHistogram[RenTF1[[3,All]]/100,RenTF2[[3,All]]/100,"Sturges",LabelingFunction->Center,BarOrigin->"XAxis",ChartStyle->{"Pastel",None,None},ChartLegends->{"Timeframe 1","Timeframe 2"},PlotLabel->"Fraction of renewables (R)"]
PairedHistogram[1-RenTF1[[2,All]]/100-RenTF1[[3,All]]/100,1-RenTF2[[2,All]]/100-RenTF2[[3,All]]/100,"Sturges",LabelingFunction->Center,BarOrigin->"XAxis",ChartStyle->{"Pastel",None,None},ChartLegends->{"Timeframe 1","Timeframe 2"},PlotLabel->"Fraction of other (F)"]

Stepwise selection, model definition

n=Length[TF1Ren12[[3,All]]];

CO2 vs. cte + GDP

M=Transpose[{ConstantArray[1,n],TF1Ren12[[5,All]]}];
lmM=LinearModelFit[{M,TF1Ren12[[4,All]]}];
lmM["AdjustedRSquared"]
lmM["ParameterTable"]
Histogram[lmM["StudentizedResiduals"]]

Following these results, we neglect the constant parameter according to the principles of bidirectional selection

CO2 vs. GDP

M=Transpose[{TF1Ren12[[5,All]]}];
lmM=LinearModelFit[{M,TF1Ren12[[4,All]]}];
lmM["AdjustedRSquared"]
lmM["ParameterTable"]
Histogram[lmM["StudentizedResiduals"]]

log CO2 vs. cte + log GDP

M=Transpose[{ConstantArray[1,n],Log[TF1Ren12[[5,All]]]}];
lmM=LinearModelFit[{M,Log[TF1Ren12[[4,All]]]}];
lmM["AdjustedRSquared"]
lmM["ParameterTable"]
Histogram[lmM["StudentizedResiduals"]]

CO2 vs. GDP + N

M=Transpose[{TF1Ren12[[5,All]],TF1Ren12[[2,All]]}];
lmM=LinearModelFit[{M,TF1Ren12[[4,All]]}];
lmM["AdjustedRSquared"]
lmM["ParameterTable"]
Histogram[lmM["StudentizedResiduals"]]

It follows that N is not significant, so we discard this variable

CO2 vs. GDP + R

M=Transpose[{TF1Ren12[[5,All]],TF1Ren12[[3,All]]}];
lmM=LinearModelFit[{M,TF1Ren12[[4,All]]}];
lmM["AdjustedRSquared"]
lmM["ParameterTable"]
Histogram[lmM["StudentizedResiduals"]]

It follows that R is not significant, so we discard this variable

CO2 vs. GDP + F

M=Transpose[{TF1Ren12[[5,All]],100-TF1Ren12[[3,All]]-TF1Ren12[[2,All]]}];
lmM=LinearModelFit[{M,TF1Ren12[[4,All]]}];
lmM["AdjustedRSquared"]
lmM["ParameterTable"]
Histogram[lmM["StudentizedResiduals"]]

CO2 vs. cte + GDP + R and cte + GDP + F

MR=Transpose[{ConstantArray[1,n],TF1Ren12[[5,All]],100-TF1Ren12[[3,All]]-TF1Ren12[[2,All]]}];
lmMR=LinearModelFit[{MR,TF1Ren12[[4,All]]}];
lmMR["AdjustedRSquared"]
lmMR["ParameterTable"]
Histogram[lmMR["StudentizedResiduals"]]

MF=Transpose[{ConstantArray[1,n],TF1Ren12[[5,All]],100-TF1Ren12[[3,All]]-TF1Ren12[[2,All]]}];
lmMF=LinearModelFit[{MF,TF1Ren12[[4,All]]}];
lmMF["AdjustedRSquared"]
lmMF["ParameterTable"]
Histogram[lmMF["StudentizedResiduals"]]