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

조회 수: 3 (최근 30일)
Jardine Shi
Jardine Shi 2020년 11월 19일
답변: Rohit Pappu 2020년 11월 23일
%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

카테고리

Help CenterFile Exchange에서 Hypothesis Tests에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by