0
$\begingroup$

I dont know how to get the results into a popup window i tried a lot of things but nothing works. Can anyone help me? I want the erge and erge 1 to be in the new window. Here is my current code:

{n, p} = Input["Eingabe der Parameter in der Form {n,p}
   n=Größe der Stichprobe
   p=Wahrscheinlichkeit"];
Stichp4 = RandomVariate[BernoulliDistribution[p], n];
xquer = N[1/n \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(i = 
       1\), \(n\)]\(Stichp4[\([i]\)]\)\)];
pneu = xquer;
erge = Print["Geschätzter Parameter p = ", xquer]
erge1 = Print["Abweichung zum wahren Parameter p: ", Abs[pneu - p]]

Thanks in advance

$\endgroup$
  • $\begingroup$ See PopupView $\endgroup$ – Alex Trounev Feb 10 at 14:23
1
$\begingroup$

You can arrange in the form of a button "Click to print" using PopupWindow[]:

{n, p} = Input["Eingabe der Parameter in der Form {n,p}
      n=Größe der Stichprobe
      p=Wahrscheinlichkeit"];
Stichp4 = RandomVariate[BernoulliDistribution[p], n];
xquer = N[1/n \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(i = 
       1\), \(n\)]\(Stichp4[\([i]\)]\)\)];
pneu = xquer;
PopupWindow[
 Graphics[{Red, Circle[], Inset["Click to print", {0, 0}]}], 
 Grid[{{"Geschätzter Parameter p = ", 
    xquer}, {"Abweichung zum wahren Parameter p: ", Abs[pneu - p]}}]]

fig1

$\endgroup$

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.