How to calculate the sample size? (2024)

🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

<!#-- DETERMINE THREAD OR REPLY --> <!#-- GET THE MESSAGE ID AND DATA, EITHER WAY -->

<!#-- ASSIGN MESSAGE AND AUTHOR QUERIES APPROPRIATELY -->

How to calculate the sample size? (2) Lady_Lucy

Fluorite | Level 6

Go to Solution

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

How to calculate the sample size?

<!#-- DETERMINE THREAD OR REPLY -->

Posted 03-05-2018 12:55 PM (1579 views)

/* Population size: 29.477.792
/* Parametros:
N P Q P*Q Z_95% Z2_95% E_ 5% E2_5%
29477792 0,5 0,5 0,25 1,9600 3,8416 0,05 0,0025

/* Formula : n = N*(p*q)*Z2 / (p*q)*Z2 + (N-1)*E2 */

How can I do a program to calculate the sample size, according to this formula ???

0Likes

1 ACCEPTED SOLUTION


Accepted Solutions

<!#-- DETERMINE THREAD OR REPLY --> <!#-- GET THE MESSAGE ID AND DATA, EITHER WAY -->

<!#-- ASSIGN MESSAGE AND AUTHOR QUERIES APPROPRIATELY -->

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

Re: How to calculate the sample size?

<!#-- DETERMINE THREAD OR REPLY -->

Posted 03-05-2018 05:21 PM (1709 views) | In reply to Lady_Lucy

data want; n=29477792; p= 0.5; q= 0.5; pq = p*q; z_95 = 1.96; z2_95 = 3.8416; e_5 = .05; e2_5 = 0.0025; nwant = n*pq*z2_95/pq*z2_95 +(n-1)*e2_5;run;

But I think you need to verify your "formula".

Note I use . instead of , as that is the NLS setting for my system. You should be able to reverse things easy enough.

View solution in original post

1Like

4 REPLIES 4

<!#-- DETERMINE THREAD OR REPLY --> <!#-- GET THE MESSAGE ID AND DATA, EITHER WAY -->

<!#-- ASSIGN MESSAGE AND AUTHOR QUERIES APPROPRIATELY -->

How to calculate the sample size? (6) ballardw

Super User

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

Re: How to calculate the sample size?

<!#-- DETERMINE THREAD OR REPLY -->

Posted 03-05-2018 05:21 PM (1710 views) | In reply to Lady_Lucy

data want; n=29477792; p= 0.5; q= 0.5; pq = p*q; z_95 = 1.96; z2_95 = 3.8416; e_5 = .05; e2_5 = 0.0025; nwant = n*pq*z2_95/pq*z2_95 +(n-1)*e2_5;run;

But I think you need to verify your "formula".

Note I use . instead of , as that is the NLS setting for my system. You should be able to reverse things easy enough.

1Like

<!#-- DETERMINE THREAD OR REPLY --> <!#-- GET THE MESSAGE ID AND DATA, EITHER WAY -->

<!#-- ASSIGN MESSAGE AND AUTHOR QUERIES APPROPRIATELY -->

How to calculate the sample size? (8) Lady_Lucy

Fluorite | Level 6

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

Re: How to calculate the sample size?

<!#-- DETERMINE THREAD OR REPLY -->

Posted 03-06-2018 08:01 AM (1508 views) | In reply to ballardw

Hi, Thank you so much!

It's worked.

data want;
n=10000;
p=0.5;
q=0.5;
pq = p*q;
z_95 = 1.96;
z2_95 = 3.8416;
e_5 = 0.05;
e2_5 = 0.0025;
nwant = (n*pq*z2_95) / ((pq*z2_95) + ((n-1)*e2_5));
run;

0Likes

<!#-- DETERMINE THREAD OR REPLY --> <!#-- GET THE MESSAGE ID AND DATA, EITHER WAY -->

<!#-- ASSIGN MESSAGE AND AUTHOR QUERIES APPROPRIATELY -->

How to calculate the sample size? (10) Tommy1

Quartz | Level 8

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

Re: How to calculate the sample size?

<!#-- DETERMINE THREAD OR REPLY -->

Posted 03-06-2018 09:01 AM (1504 views) | In reply to Lady_Lucy

Yea I agree I think you need to verify your formula. I think what you are trying to do is:

n = N*X / (X + N – 1),

where,

X = Z(α/2)^2­*p*(1-p) / MOE^2,

and Zα/2is the critical value of the Normal distribution at α/2 (e.g. for a confidence level of 95%, α is 0.05 and the critical value is 1.96), MOE is the margin of error, p is the sample proportion, and N is the population size. Note that a Finite Population Correction has been applied to the sample size formula.

I think it would look something like this

n=(N*((Z^2­*p*(1-p)) /MOE^2)) / (((Z^2­*p*(1-p)) /MOE^2)+N+1)

1Like

<!#-- DETERMINE THREAD OR REPLY --> <!#-- GET THE MESSAGE ID AND DATA, EITHER WAY -->

<!#-- ASSIGN MESSAGE AND AUTHOR QUERIES APPROPRIATELY -->

How to calculate the sample size? (12) Lady_Lucy

Fluorite | Level 6

  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • RSS Feed
  • Permalink
  • Print
  • Report Inappropriate Content

Re: How to calculate the sample size?

<!#-- DETERMINE THREAD OR REPLY -->

Posted 03-06-2018 12:24 PM (1486 views) | In reply to Tommy1

Thank you. Thank you.

You really helped me.

you're so right. that's the 'exact format' of formula.

before,I guess that I didn't express right.

sorry about my english 😉

0Likes

How to calculate the sample size? (2024)

References

Top Articles
Latest Posts
Article information

Author: Merrill Bechtelar CPA

Last Updated:

Views: 6535

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.