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')
0 个评论
回答(1 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Hypothesis Tests 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!