I designed this little program, but I want you to be able to choose what I want to look for by choosing it as you do with the widget tab, please help me.

widget Widget of internet

what I need

my program

L = {12, 20, 16, 18, 19};
Print [ "Lista de Datos =", L];
Print [ "Cantidad de Datos =", Length[L]];

Print [ "Suma  Datos =", Total[L]];
Print [ "Dato Minimo =", Min[L]];

Print [ "Dato Maximo =", Max[L]];
Print [ "Rango =", Max[L] - Min[L]];
Print [ "Media Aritmetica =", Mean[L]];
Print [ "Mediana =", Median[L]];
Print [ "Moda =", Commonest[L]];

Print [ "Media Harmonica =", HarmonicMean[L]];
Print [ "Media CONTRAHarmonica =", ContraharmonicMean[L]];

Print [ "Media Geometrica =", N[GeometricMean[L], 3]];
Print [ "Media Cuadratica =", N[RootMeanSquare[L], 3]];
Print["Desviacion Media =", MeanDeviation[L]];
Print["Variaza Muestral =", Variance[L]]
Print["Desviacion Estandar Muestral =", StandardDeviation[L]];
Print["Variaza Poblacional =", Total[(L - Mean[L])^2]/Length[L]];
Print["Desviacion Estandar Poblacional =",  Sqrt[Total[(L - Mean[L])^2]/Length[L]]];

Print["Desviacion Media =", MeanDeviation[L]];
Print["Cuartiles =", Quartiles[L]];
Print["Rango Intercuartilico =", InterquartileRange[L]];

You can use Manipulate, PopupMenu and InputField as follows:

functions = {Total, Min, Max, MinMax, Mean, Median, Commonest, Quartiles};
flabels = {"Suma  Datos", "Dato Minimo", "Dato Maximo", "Rango", "Media Aritmetica", 
   "Mediana", "Moda", "Cuartiles"};
fl = Thread[functions -> flabels];

Manipulate[Row[{f /. fl, f @ data}, " = "], 
 Row[{Control @ {{f, Total, "Calcula la "}, fl}, 
  Control@{{data, {}, "Lista de Datos ="}, ControlType ->(InputField[#, Expression]&)}},

enter image description here

enter image description here

enter image description here

| improve this answer | |
  • $\begingroup$ thanks, Thanks just what I needed, but I have a question, Mathematica when it calculates the variance and standard deviation divide by n-1, which for me is when it comes to a data sample, when it comes to the population I should divide by n, that formula in mathematics I don't find. I can implement them with code , but if there is any command that calculates it better , do you know one or any other way to do it? $\endgroup$ – BeTDa Oct 3 at 23:50
  • $\begingroup$ @BeTDa, you can use CentralMoment[data, 2] or Variance[data] (Length[data] - 1)/Length[data]? $\endgroup$ – kglr Oct 4 at 0:05
  • $\begingroup$ I have tried to implement it here in various ways but mathematica rejects it ; functions = {Total, Min, Max, MinMax, Mean, Median, Commonest, Quartiles, CentralMoment[fl, 2], Sqrt[CentralMoment[fl, 2]]} $\endgroup$ – BeTDa Oct 4 at 0:49
  • $\begingroup$ @BeTDa, try functions = {Total, Min, Max, MinMax, Mean, Median, Commonest, Quartiles, CentralMoment[#, 2]&, Sqrt[CentralMoment[#, 2]]&} $\endgroup$ – kglr Oct 4 at 1:18
  • 1
    $\begingroup$ @BeTDa look up anonymous functions—it’s akin to writing Function[x,GeometricMean[N[x,3]]] except without the need to use Function. Essentially you are saying that the # should be filled with whatever the function is applied to. When you use the other options, you are using something like Max@input except it’s is ...&@input. $\endgroup$ – CA Trevillian Oct 4 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.