필터 지우기
필터 지우기

How can I determine number of samples?

조회 수: 3 (최근 30일)
MByk
MByk 2024년 4월 15일
편집: MByk 2024년 4월 16일
Hello all, my question may not be directly related to Matlab, but I'm trying to draw samples without replacement from my dataset using the randsample() function. Would it be appropriate to use Cochran's sample size formula to determine the number of samples (I think it is also called as sample size)? If I understand correctly, the data should follow a normal distribution. I conducted the Kolmogorov-Smirnov test (h = kstest(DataSet)) and obtained a result of 1. Does this indicate a normal distribution? I might be doing something ridiculous so I'm open to any suggestions. Thanks.

채택된 답변

Ayush Anand
Ayush Anand 2024년 4월 16일
Hi,
The Kolmogorov-Smirnov test producing a result of 1 indicates that, under the significance level used by the test (commonly 0.05 unless specified otherwise), you reject the null hypothesis that the data comes from a normal distribution. In other words, your dataset does not follow a normal distribution based on this test.
Since the Cochran's formula uses the underlying assumption of the data being normally distributed, it would not be the ideal approach to determine the sample size in this case. Instead you can use other methods such as:
  • For estimating a mean (average) when the data is not normally distributed, consider using the t-distribution.
  • For estimating a proportion (percentage) when the data is not normally distributed, you can use the binomial distribution.
  • (n) is the required sample size.
  • (Z) is the critical value from the t-distribution corresponding to the desired confidence level.
  • is the estimated standard deviation
  • (E) is the desired margin of error (half the width of the confidence interval).
  • (p) is the estimated proportion
You can read more about the t-distribution and binomial distribution in MATLAB here :
  1. https://www.mathworks.com/help/stats/students-t-distribution.html
  2. https://www.mathworks.com/help/stats/binomial-distribution.html
  댓글 수: 1
MByk
MByk 2024년 4월 16일
편집: MByk 2024년 4월 16일
If the result was zero, we could use Cochran's formula but in this case it would be wrong. Ok, I got it. Thank you very much sir.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by