panely={14, 13, 15, 12, 14, 9, 15, 8, 14, 10, 16, 12, 13, 17, 18, 13, 13, 10, 14, 16, 11, 14, 12, 9, 15, 11, 14, 15, 11, 15, 10, 16, 10, 12, 13, 11, 13, 11, 9, 13, 8, 12, 16, 12, 17, 12, 13, 11, 13, 12}

Mean[panely]

%//N

Median[panely]

(*modus*)
Commonest[panely]

HarmonicMean[panely]//N

Quartiles[panely]

Quantile[panely,0.1]

ZeroMean[data_]:=data-Mean[data]

ZeroMean[panely]//N

LocationReport[data_]:={Mean->Mean[data],HarmonicMean->HarmonicMean[data],Median->Median[data],Mode->Commonest[data]}

LocationReport[panely]//N

(*charakteristiky rozptylu*)

Variance[panely]//N

VarianceMLE[data_]:=Variance[data](Length[data]-1)/Length[data]

VarianceMLE[panely]//N

(*MLE metoda maxim vierohodnosti maximum likely hood estimation*)

StandardDeviation[panely]//N

StandartDeviationMLE[data_]:=StandardDeviation[panely](Length[data]-1)/Length[data]

StandartDeviationMLE[panely]//N

InterquartileRange[panely]

QuartileDeviation[panely]

Skewness[panely]//N

Skewness[NormalDistribution[]]

Kurtosis[panely]//N

Kurtosis[NormalDistribution[]]

(*intervaly spolahlivosti*)

<<"HypothesisTesting`"

(*intervaly spolahlivosti pre niake mi a zname sigma *)

data={51.3,62.8,51.9,57,55.3,52.1,58.4}

(*vypocitaj 95% interval spolahlivosti*)

aritpriem=Mean[data]

sigma=Sqrt[20.28](*rozptyl pol dany*)

n=Length[data]

kvantil=Quantile[NormalDistribution[0,1],0.975]

lstrana=aritpriem-((kvantil*sigma)/(Sqrt[n]))

pstrana=aritpriem+((kvantil*sigma)/(Sqrt[n]))

(*teraz to urobime v systeme MAthematica*)

(*alfa je standartne 0.05  -> robime 95% interval spolahlivosti*)

(*inak sa dava confidencelevel->1-alfa*)

MeanCI[data,KnownVariance->20.28]

MeanCI[data,KnownVariance->20.28,ConfidenceLevel->0.9]

MeanCI[data,KnownVariance->20.28,ConfidenceLevel->0.95]

(*teraz na jednostranne*)

(*teraz 90% lavostranny a pravostranny*)

MeanCI[data,KnownVariance->20.28,ConfidenceLevel->0.8]

(*lavostranny*)

lstrana=Quantile[data,0.1]

(*pravostranny*)

pstrana=Quantile[data,0.9]

(*teraz niaky priklad : generuj data normal rozdelenia s Ex=2 a Dx=1 urob interval spolahlivosti A)ak je sigma znama a je = 1 B)sigma nieje znama ale terba ho odhadnut(*sigman nahradime odhadom a spravime interval s novou sigmou*)*)
(*pocet prvkou men dovdedy kym s aodhad nebude velmi menit od neodhadnuteho*)

n=80;
data=RandomReal[NormalDistribution[2,1],n];
MeanCI[data,KnownVariance->1,ConfidenceLevel->0.9]

data={18,12,18,13,13,16,11,17,20,14,15,14,16,15,15,17,13,14,16,13}
MeanCI[data,KnownVariance->1,ConfidenceLevel->0.90]

MeanCI[data,KnownVariance->1,ConfidenceLevel->(1-2*0.05)]

data={18,18.4,19,20.2,19.6,18.6,19.4,17,18.5,19}
MeanCI[data,KnownVariance->1.5^2,ConfidenceLevel->0.99]
MeanCI[data,KnownVariance->1.5^2,ConfidenceLevel->(1-2*0.1)]

data={40 ,45,75,80,90,90,85,79,110,105,125,120,120,130,135,140,150,180,180,200}
MeanCI[data,KnownVariance->15^2,ConfidenceLevel->0.90]
MeanCI[data,KnownVariance->15^2,ConfidenceLevel->(1-2*0.1)]