Beta-Fehler beim Gauß-Test

Hermann.Singer@FernUni-Hagen.de

Gauß - Test/zweiseitig

Clear[muA,sigmaA,xA,fA,f1A]

Manipulate[

{x0A,x1A}={4,8};
plrA={{x0A,x1A},{0,1.5}};
sigmaxqA=sigmaA/Sqrt[nA];
fA=PDF[NormalDistribution[muA,sigmaxqA],xA];


(*mu1=7;*)
f1A=PDF[NormalDistribution[mu1A,sigmaxqA],xA];

xp1A=Quantile[NormalDistribution[muA,sigmaxqA],alphaA/2];
xp2A=Quantile[NormalDistribution[muA,sigmaxqA],1-alphaA/2];

betaA=CDF[NormalDistribution[mu1A,sigmaxqA],xp2A]-CDF[NormalDistribution[mu1A,sigmaxqA],xp1A];

(*Print[" mu0=",mu," mu1=",mu1," beta=",beta];*)

Show[

Plot[{f1A},{xA,xp1A,xp2A},Filling->0,ColorFunction->(Hue[.1]&),GridLines->{{xp1A,xp2A},None},
                                                     PlotLabel->"beta = "<>ToString[betaA//NumberForm[#,{5,2}]&]<>", kritische Werte = "<>
                                                ToString[{xp1A,xp2A}//NumberForm[#,{5,2}]&]<>", {mu0,mu1}="<>ToString[{muA,mu1A}],
                                                     PlotRange->plrA,PlotStyle->Thick],

Plot[{f1A},{xA,x0A,x1A},Filling->None,ColorFunction->(Hue[.1]&),PlotLabel->betaA,PlotRange->plrA,PlotStyle->Thick],

Plot[{fA},{xA,x0A,x1A},Filling->None,ColorFunction->(Hue[0]&),GridLines->{{xp1A,xp2A},None},
                                          PlotLabel->ToString[{xp1A,xp2A}],PlotRange->plrA,PlotStyle->Thick],

Plot[{fA},{xA,x0A,xp1A},Filling->Axis,ColorFunction->(Hue[0]&),PlotRange->plrA,PlotStyle->Thick],

Plot[{fA},{xA,xp2A,x1A},Filling->Axis,ColorFunction->(Hue[0]&),PlotRange->plrA,PlotStyle->Thick],

Frame->True,Axes->False]

,{{mu1A,7,"mu1"},5,8},{{muA,6,"mu"},1,10},{{sigmaA,1.86,"sigma"},1,10},{{nA,32,"n"},10,100},{{alphaA,.05,"alpha"},.01,.1},
ControlPlacement->Left,SaveDefinitions->True]

Gauß - Test/einseitig

Clear[muB,sigmaB,xB,fB,f1B]

Manipulate[

{x0B,x1B}={4,8};
plrB={{x0B,x1B},{0,1.5}};
sigmaxqB=sigmaB/Sqrt[nB];
fB=PDF[NormalDistribution[muB,sigmaxqB],xB];

(*mu1=7;*)
f1B=PDF[NormalDistribution[mu1B,sigmaxqB],xB];

xp1B=4;
xp2B=Quantile[NormalDistribution[muB,sigmaxqB],1-alphaB];

betaB=CDF[NormalDistribution[mu1B,sigmaxqB],xp2B];

(*Print[" mu0=",mu," mu1=",mu1," beta=",beta];*)

Show[

Plot[{f1B},{xB,xp1B,xp2B},Filling->0,ColorFunction->(Hue[.1]&),GridLines->{{xp1B,xp2B},None},
                                                     PlotLabel->"beta = "<>ToString[betaB//NumberForm[#,{5,2}]&]<>", kritischer Wert = "<>
                                                ToString[{xp2B}//NumberForm[#,{5,2}]&]<>", {mu0,mu1}="<>ToString[{muB,mu1B}],
                                                    PlotRange->plrB,PlotStyle->Thick],

Plot[{f1B},{xB,x0B,x1B},Filling->None,ColorFunction->(Hue[.1]&),PlotLabel->betaB,PlotRange->plrB,PlotStyle->Thick],

Plot[{fB},{xB,x0B,x1B},Filling->None,ColorFunction->(Hue[0]&),GridLines->{{xp1B,xp2B},None},
                                          PlotLabel->ToString[{xp1B,xp2B}],PlotRange->plrB,PlotStyle->Thick],

Plot[{fB},{xB,xp2B,x1B},Filling->Axis,ColorFunction->(Hue[0]&),PlotRange->plrB,PlotStyle->Thick],

Frame->True,Axes->False]

,{{mu1B,7,"mu1"},5,8},{{muB,6,"mu"},1,10},{{sigmaB,1.86,"sigma"},1,10},{{nB,32,"n"},10,100},{{alphaB,.05,"alpha"},.01,.1},
  ControlPlacement->Left,SaveDefinitions->True]