(* charakteristiky polohy *)
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}

(* aritmeticky priemer *)
Mean[panely]
(637/50)

%//N

(* median *)
Median[panely]

(* modus *)
Commonest[panely]

(* harmonicky priemer *)
HarmonicMean[panely]//N

(* kvartily - dolny,median,horny,*)
Quartiles[panely]

(* kvantily *)
Quantile[panely,0.25]

Quantile[panely,0.5]

Quantile[panely,0.75]

(* upravene data - aby stredna hodnota bola nula - od kazdej hodnoty odcitame priemer *)
ZeroMean[panely_]:=panely-Mean[panely]

ZeroMean[panely]//N

(* procedura, ktora spravi vsetko naraz - priemer,median... *)
LocationReport[data_]:={Priemer->Mean[data],HarmPriemer->HarmonicMean[data],Median->Median[data],Modus->Commonest[data]}

LocationReport[panely]//N

(* charakteristiky rozptylu *)
(* disperzia *)
Variance[panely]//N

StandardDeviation[panely//N]

(* MLE - maximum likelyhood estimation - estimator, prestalo sa to pouzivat...*)
StandardDeviationMLE[data_]:=StandardDeviation[data]Sqrt[(Length[data]-1)/Length[data]]

StandardDeviationMLE[panely]//N

(* IRQ *)
InterquartileRange[panely]

QuartileDeviation[panely]

(* sikmost - usporiadanie z hladiska symetrie - pre symetricke rozdelenie je sikmost = 0 *)
Skewness[panely]//N

Skewness[NormalDistribution[]]

(* spicatost - pre normalne rozdelenie = 3*)
Kurtosis[panely]//N

%-3

(* intervaly spolahlivosti *)
<<HypothesisTesting`

(* IS pre ni pri znamom sigma *)

(* intervalovy odhad (k1,k2)*)
(* alfa - hladina vyznamnosti,uroven spolahlivosti, standartne sa voli alfa=0.1 cize 10% chyba a 90% IS 
alebo alfa=0.5 5% 95% alebo 0.01 1% 99% *)

(*  priklad *)
(* zo zakladneho suboru so znamym rozptylom sigma^2 = 20.28 sme urobili nahodny vyber s nasledujucim vysledkom... Vypocitajte 95% IS pre ni. Vypocitajte 90% IS lavostranny a pravostranny pre ni*)

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

aritpriem=Mean[data]

sigma=Sqrt[20.28]

n=Length[data]

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

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

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

(* prednastavena hodnota alfy je 0.05, ak chceme ine tak pridame ConfidenceLevel->1-alfa 
prednastavna hodnota KnownVariance je None, musime pridat KnownVariance->sigma^2*)
MeanCI[data,KnownVariance->20.28]

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

(* PR. - najdite 90%ny lavostranny (k1,∞) a 90%ny pravostranny (-∞,k2) IS*)

MeanCI[data,KnownVariance->20.28,ConfidenceLevel->1-2*0.1]