- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

To find the sample size for two sample proportion tests with given power, we can use the function power.prop.test where we need to at least pass the two proportions and power.

By default the significance level will be taken as 0.05 and if we want to change it then sig.level argument will be used.

Given below are some examples with the display of significance levels.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=8/20,p2=6/20,power=0.90,sig.level=0.05)

If you execute the above given snippet, it generates the following Output for the two-sample comparison of proportions power calculation −

n = 476.0072 p1 = 0.4 p2 = 0.3 sig.level = 0.05 power = 0.9 alternative = two.sided

**Note** − n is number in *each* group.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=18/20,p2=16/20,power=0.90,sig.level=0.05)

If you execute the above given snippet, it generates the following Output for the two-sample comparison of proportions power calculation −

n = 265.856 p1 = 0.9 p2 = 0.8 sig.level = 0.05 power = 0.9 alternative = two.sided

**Note** − n is number in *each* group.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=18/100,p2=16/100,power=0.90,sig.level=0.05)

If you execute the above given snippet, it generates the following Output for the two-sample comparison of proportions power calculation −

n = 7410.91 p1 = 0.18 p2 = 0.16 sig.level = 0.05 power = 0.9 alternative = two.sided

**Note** − n is number in *each* group.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=18/1000,p2=16/1000,power=0.90,sig.level=0.05)

n = 87792.7 p1 = 0.018 p2 = 0.016 sig.level = 0.05 power = 0.9 alternative = two.sided

**Note** − n is number in *each* group.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=49/100,p2=51/100,power=0.90,sig.level=0.05)

n = 13132.2 p1 = 0.49 p2 = 0.51 sig.level = 0.05 power = 0.9 alternative = two.sided

**Note** − n is number in *each* group.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=49/100,p2=51/100,power=0.90,sig.level=0.10)

n = 10702.93 p1 = 0.49 p2 = 0.51 sig.level = 0.1 power = 0.9 alternative = two.sided

**Note** − n is number in *each* group.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=49/100,p2=51/100,power=0.95,sig.level=0.10)

n = 13525.01 p1 = 0.49 p2 = 0.51 sig.level = 0.1 power = 0.95 alternative = two.sided

**Note** − n is number in *each* group.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=49/100,p2=51/100,power=0.80,sig.level=0.10)

n = 7727.15 p1 = 0.49 p2 = 0.51 sig.level = 0.1 power = 0.8 alternative = two.sided

**Note** − n is number in *each* group.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=5/200,p2=5/100,power=0.80,sig.level=0.10)

n = 713.0383 p1 = 0.025 p2 = 0.05 sig.level = 0.1 power = 0.8 alternative = two.sided

**Note** − n is number in *each* group.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=5/200,p2=5/100,power=0.80,sig.level=0.05)

n = 905.3658 p1 = 0.025 p2 = 0.05 sig.level = 0.05 power = 0.8 alternative = two.sided

**Note** − n is number in *each* group.

Use the code given below to find the sample size for two sample proportion tests −

power.prop.test(p1=5/200,p2=5/100,power=0.80,sig.level=0.05,alternative="one.sided")

n = 713.0383 p1 = 0.025 p2 = 0.05 sig.level = 0.05 power = 0.8 alternative = one.sided

**Note** − n is number in *each* group.

- Related Questions & Answers
- How to find the sample size for t test in R?
- Sample question for testing
- How to create sample space of throwing two dices in R?
- How to repeat a random sample in R?
- How to create the random sample by defining the probabilities for each unit in R?
- How to perform one-way anova with unequal sample sizes in R?
- Sample questions for ITIL Foundation Course
- How to create a random sample of months in R?
- How to perform one sample Kolmogorov-Smirnov test in R?
- How to create a random sample with values 0 and 1 in R?
- How to apply two sample t test using a categorical column in R data frame?
- How to create a random sample of week days in R?
- How to create sample of rows using ID column in R?
- How to take a random sample from a matrix in R?
- How to find the proportion using normal distribution in R?

Advertisements