testing hypothesis that p=alpha at 5% & 1%

3 次查看(过去 30 天)
%does this mean that I just need to change the value of p ? to either 5% or 1% ?
p=0.05
n=9
% create a 1x(n+1) vector y containing the probabilities with which a
% Bin(n,p) random variable is equal to the values 0,1,2,...,n
x=0:n;
y=binopdf(x,n,p);
% create a 1x(n+1) vector z containing the values taken by the standardized
% sample mean when the mean is equal to the values 0,1/n,2/n,...,1
z = (x/n-p)/sqrt(p*(1-p)/n);
%plotting the PMF of sample mean
bar(z,y);
xlabel('Observation')
ylabel('Probability')

回答(1 个)

Rohit Pappu
Rohit Pappu 2020-11-23
To test the hypothesis at various confidence levels, Lilliefors test can be used .
Example
[h,p] = lillietest(x, 'Alpha', 0.05) %% Alpha is a name-value pair argument which takes a value between 0 and 1
Additional documentation about Lilliefors test can be found here

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by