*! version 1.3.7 15dec2022

Title

nsize -- Sample Size & Power

Syntax

nsize type, type_options [nst(string)]

where nst() allows to optionally label the results with the name of the study

Type Description

co1p Comparison of one proportion to a reference (non equal)

co2p Comparison of two proportions (non equal)

c1pe Comparison of one proportion to a reference (equivalence)

c2pe Comparison of two proportions (equivalence)

copp Comparison of paired proportions (matched)

co1m Comparison of one mean to a reference (non equal)

co2m Comparison of two means (non equal)

c2me Comparison of two means (equivalence)

cokm Comparison of k means (ANOVA)

ci1p Estimation of population proportion

ci2p Estimation of the difference between 2 proportions

ci1m Estimation of population mean

ci2m Estimation of the difference between 2 means

co1c Comparison of one correlation to a reference

co2c Comparison of two correlations

co2r Comparison of two risks

co2i Comparison of two rates

ncr Number of communities (Risk): Intervention trials

Description

Comparisons and estimations for independent proportions, means, correlations, risks and rates.

There are up to 18 different types of computations. Each type has a different set of options,
see the Options section for details.

This command does not work with data of the current dataset. Current dataset is not modified.

You can click here to pop up a dialog or type db nsize.

Execute net from http://metodo.uab.cat/stata for install.

It is important to keep the commands updated. Execute adoupdate nsize, update to update the nsize command.

Execute adoupdate, update to update all the user-written commands.

If you find any bugs or want to suggest any improvements, please send an e-mail to: leam@uab.cat.

Options

co1p_options Description

Common

p Proportion(%) of events in reference population (0 < p < 100)

{p1 Proportion(%) of events in sample (0 < p1 < 100)

| effect} Minimum expected effect size(%); effect = p1-p (effect <> 0)

Sample Size

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

n Sample Size (n integer > 1)

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

co1p examples stored results back to syntax

co2p_options Description

Common

p0 Proportion(%) of events in reference group (0 < p0 < 100)

{p1 Proportion(%) of events in new group (0 < p1 < 100)

| effect} Minimum expected effect size(%); effect = p1-p (effect <> 0)

Sample Size

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

n Sample Size (by group) (n integer > 1)

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

co2p examples stored results back to syntax

c1pe_options Description

Common

p0 Proportion (%) of events in reference treatment (0 < p0 < 100)

p1 Proportion (%) of events in experimental treatment (0 < p1 < 100)

delta Non-Inferiority/Superiority/Equivalence limit (delta <> 0)

by default Equivalence Test is computed

[noninf] Compute Non-Inferiority Test

[super] Compute Superiority Test

Sample Size

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

n Sample Size (n integer > 1)

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

c1pe examples stored results back to syntax

c2pe_options Description

p0 Proportion (%) of events in reference treatment (0 < p0 < 100)

p1 Proportion (%) of events in experimental treatment (0 < p1 < 100)

delta Non-Inferiority/Superiority/Equivalence limit (delta <> 0)

by default Equivalence Test is computed

[noninf] Compute Non-Inferiority Test

[super] Compute Superiority Test

[r] Ratio n0/n1; by default: 1 (r > 0)

Sample Size

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

n0 Sample Size (Reference treatment) (n0 integer > 1)

n1 Sample Size (Experimental treatment) (n1 integer > 1)

or n0 and r, or n1 and r

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

c2pe examples stored results back to syntax

Formulas from Fleiss, Levin and Pai, 2003; p.168-74 are used for proportions (non-inferiority and equivalence)

copp_options Description

Common

or Expected Response/Exposure Odds Ratio (or > 1)

[{pd Proportion of Discordant pairs(%) (0 < pd < 100)

| p0 Proportion in the Reference group(%) (0 < p0 < 100)

& ora}] Marginal Odds Ratio (ora > 1)

[r] Ratio of Matching (1:r); by default: 1 (r integer >= 1)

Sample Size

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

n Sample Size (Total number of cases) (n integer > 1)

copp examples stored results back to syntax

co1m_options Description

Common

sd Common standard deviation (sd > 0)

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

Sample Size

effect Minimum expected effect size (effect <> 0)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

effect Minimum expected effect size (effect <> 0)

n Sample Size (by group) (n integer > 1)

Effect

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

n Sample Size (by group) (n integer > 1)

co1m examples stored results back to syntax

co2m_options Description

Common

sd Common standard deviation of Groups 0 and 1 (sd > 0)

[r] Ratio n0/n1; by default: 1 (r > 0)

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

Sample Size

effect Minimum expected effect size (effect <> 0)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

effect Minimum expected effect size (effect <> 0)

n1 Sample Size (Group 1) (n1 integer > 1)

[n0] Sample Size (Group 0); by default: r*n1 (n0 integer > 1)

Effect

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

n1 Sample Size (Group 1) (n1 integer > 1)

[n0] Sample Size (Group 0); by default: r*n1 (n0 integer > 1)

co2m examples stored results back to syntax

c2me_options Description

Common

sd Common standard deviation (sd > 0)

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

Sample Size

eqlim Equivalence limits (eqlim > 0)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

eqlim Equivalence limits (eqlim > 0)

n Sample Size (by group) (n integer > 1)

Equivalence limits

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

n Sample Size (by group) (n integer > 1)

c2me examples stored results back to syntax

cokm_options Description

Common

sd Common standard deviation estimated (sd > 0)

k Simultaneous comparisons

means List of hypothetical means (means > 0)

For sample size results, the maximum number of groups is k=12

c Pairwise comparisons

effect Minimum expected effect size (effect <> 0)

c Number of pairwise comparisons (c integer > 0)

Power

nk Sample size (by group) (nk integer > 1)

If parameter nk is present, Power results are calculated

cokm examples stored results back to syntax

ci1p_options Description

Sample Size

p0 Supposed Population Proportion(%) (0 < p0 < 100)

apre List of CI absolute precision values(%) (0 < p0 ± apre < 100)

[cl] Confidence level(%); by default: 90 95 99 (50 <= CL < 100)

Precission of CI

p0 List of Supposed Population Proportions(%) (0 < p0 < 100)

ns List of Sample Sizes (ns integer > 1)

[cl] Confidence level(%); by default: 95 (50 <= CL < 100)

Common

[n] Population Size; by default: INFINITE (n integer > ns)

ci1p examples stored results back to syntax

ci2p_options Description

Common

p0 Supposed proportion in Pop.0(%) (0 < p0 < 100)

p1 Supposed proportion in Pop.1(%) (0 < p1 < 100)

[r] Ratio n0/n1; by default: 1 (r > 0)

[cl] Confidence level(%); by default: 90 95 97.5 99 (50 <= CL < 100)

Sample Size

apre List of CI absolute precision values(%) (0 < p0 ± apre < 100)

Precission of CI

n1 Sample Size (Group 1) (n1 integer > 1)

[n0] Sample Size (Group 0); by default: r*N1 (n0 integer > 1)

ci2p examples stored results back to syntax

ci1m_options Description

Common

sd Supposed Standard Deviation (sd > 0)

[n] Population Size; by default: INFINITE (n integer > ns)

[cl] Confidence level(%); by default: 90 95 99 (50 <= CL < 100)

Sample Size

apre List of CI absolute precision values

Precission of CI

ns Sample Size (ns integer > 1)

ci1m examples stored results back to syntax

ci2m_options Description

Common

sd Supposed Standard Deviation (sd > 0)

[r] Ratio n0/n1; by default: 1 (r > 0)

[cl] Confidence level(%); by default: 90 95 97.5 99 (50 <= CL < 100)

Sample Size

apre List of CI absolute precision values

Precission of CI

n1 Sample Size (Group 1) (n1 integer > 1)

[n0] Sample Size (Group 0); by default: r*N1 (n0 integer > 1)

ci2m examples stored results back to syntax

co1c_options Description

Common

cr Correlation in a reference population (-1 < cr < 1)

{cr1 Correlation in a sample (-1 < cr1 < 1)

| effect} Minimum expected effect size(%); effect = cr1-cr (effect < 1)

Sample Size

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

n1 Size of sample 1 (n1 integer > 3)

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

co1c examples stored results back to syntax

co2c_options Description

Common

cr0 Correlation in a sample 0 (-1 < cr0 < 1)

{cr1 Correlation in a sample 1 (-1 < cr1 < 1)

| effect} Minimum expected effect size(%); effect = cr1-cr0 (effect < 1)

Sample Size

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

n1 Size of sample 1 (n1 integer > 3)

n0 Size of sample 0 (n0 integer > 3)

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

co2c examples stored results back to syntax

co2r_options Description

Cohort Risk studies

r0 Event risk in UnExposed(%) (0 < r0 < 100)

{r1 Event risk in Exposed(%) (0 < r1 < 100)

| rr Expected Risk Ratio (rr > 0)

| rd Expected Risk Difference(%) (rd <> 0)

| or} Expected Odds Ratio (or > 0)

{[r Ratio n0/n1 (r > 0)

| pe]} Cohort exposure prevalence(%); r = (100-pe)/pe (0 < pe < 100)

by default n0 = n1

Case-Control studies

pe0 Proportion of exposed in NonCases(%) (0 < pe0 < 100)

{pe1 Proportion of exposed in Cases(%) (0 < pe1 < 100)

| or} Expected Odds Ratio (or > 0)

[r] Ratio n0/n1; by default: 1 (r > 0)

Sample Size

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power - Cohort Risk Studies

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

n1 Size of sample 1 (n1 integer > 1)

n0 Size of sample 0 (n0 integer > 1)

or n0 and r|pe, or n1 and r|pe

Power - Case-Control Studies

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

m1 Size of sample 1 (m1 integer > 1)

m0 Size of sample 0 (m0 integer > 1)

or m0 and r, or m1 and r

co2r examples stored results back to syntax

co2i_options Description

Common

i0 Event rate in UnExposed (i0 > 0)

{i1 Event rate in Exposed (i1 > 0)

| ir Expected Rate Ratio (ir > 0)

| id} Expected Rate Difference (id <> 0)

d Mean duration of Follow up (rd > 0)

[r] Ratio n0/n1; by default: 1 (r > 0)

Sample Size

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

Power

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

n1 Size of sample 1 (n1 integer > 1)

n0 Size of sample 0 (n0 integer > 1)

or n0() and r(), or n1() and r()

co2i examples stored results back to syntax

ncr_options Description

Sample Size

vb Supposed Between Group Variance (vb > 0)

vw Supposed Within Group Variance (vw > 0)

effect Minimum expected effect size in proportion (0 < effect < 1)

[alpha] Alpha risk(%); by default: 5 (0 < alpha <= 50)

[beta] Beta risk(%); by default: 20 15 10 (0 < beta <= 50)

ncr examples stored results back to syntax

Examples

co1p examples

. nsize co1p, p(30) p1(50)

. nsize co1p, p(5) effect(-1) alpha(5) beta(15) nst(Name of the study)

. nsize co1p, p(40) effect(15) n(80) alpha(5)

stored results co1p options back to syntax

co2p examples

. nsize co2p, p0(30) effect(20)

. nsize co2p, p0(6) p1(8) alpha(5) beta(15) nst(Name of the study)

. nsize co2p, p0(4) effect(3) n(600) alpha(5)

stored results co2p options back to syntax

c1pe examples

. nsize c1pe, p0(90) p1(93) delta(-2) noninf

. nsize c1pe, p0(50) p1(90) delta(20) super alpha(5) beta(20) nst(Name of the study)

. nsize c1pe, p0(40) p1(40) delta(10) n(211) alpha(5)

stored results c1pe options back to syntax

c2pe examples

. nsize c2pe, p0(75) p1(80) delta(20) nst(Name of the study)

. nsize c2pe, p0(65) p1(85) delta(5) super alpha(5) beta(20) r(1.5)

. nsize c2pe, p0(65) p1(85) delta(-10) noninf n1(25) alpha(5)

stored results c2pe options back to syntax

copp examples

. nsize copp, or(2) r(1) nst(Name of the study)

. nsize copp, or(2) pd(30.5) r(1) alpha(5) beta(10)

. nsize copp, or(2.5) p0(42.8) ora(3.0) r(2)

. nsize copp, or(2.3) pd(26.2) r(1) n(216) alpha(5)

stored results copp options back to syntax

co1m examples

. nsize co1m, sd(2.45) effect(2.5) nst(Name of the study)

. nsize co1m, sd(10) effect(6) alpha(5) beta(20)

. nsize co1m, sd(10) effect(6) alpha(5) n(68)

. nsize co1m, sd(10.45) alpha(5) n(49)

. nsize co1m, sd(10.45) alpha(5) beta(15) n(49)

stored results co1m options back to syntax

co2m examples

. nsize co2m, sd(10) effect(6) r(1.5) nst(Name of the study)

. nsize co2m, sd(10) effect(6) alpha(5) beta(15)

. nsize co2m, sd(10) effect(6) alpha(10) n0(55) n1(37)

. nsize co2m, sd(10) alpha(5) n1(32) n0(32)

. nsize co2m, sd(10) alpha(5) beta(10) n1(32) n0(32)

stored results co2m options back to syntax

c2me examples

. nsize c2me, sd(10) eqlim(6)

. nsize c2me, sd(10) eqlim(6) alpha(5) beta(20) nst(Name of the study)

. nsize c2me, sd(10) eqlim(5) n(60) alpha(5)

. nsize c2me, sd(10) alpha(5) n(53)

. nsize c2me, sd(10) alpha(5) beta(10) n(53)

stored results c2me options back to syntax

cokm examples

. nsize cokm, sd(3.5) means(8.25 11.75 12.00 13.00) nst(Name of the study)

. nsize cokm, sd(3.5) means(8 8 9 12) nk(10 10 10 20)

. nsize cokm, sd(10) effect(6) c(3)

. nsize cokm, sd(10) effect(6) c(3) nk(50)

stored results cokm options back to syntax

ci1p examples

. nsize ci1p, p0(20) apre(1 2 3 4 5) nst(Name of the study)

. nsize ci1p, p0(20) ns(300)

. nsize ci1p, p0(5 10 15 20 25 30 40 50) cl(95) n(1350) ns(250 300 350 400)

. nsize ci1p, p0(20) apre(2 3 4) n(4000) cl(99.9)

stored results ci1p options back to syntax

ci2p examples

. nsize ci2p, p0(40) p1(32) apre(5) nst(Name of the study)

. nsize ci2p, p0(40) p1(32) apre(2.5 3 4 5 6) cl(99.9)

. nsize ci2p, p0(40) p1(32) n1(175)

stored results ci2p options back to syntax

ci1m examples

. nsize ci1m, sd(1.5) apre(0.5 0.6 0.8 1.0) nst(Name of the study)

. nsize ci1m, sd(1) ns(300)

. nsize ci1m, sd(1) apre(0.2) n(4000) cl(99.9)

stored results ci1m options back to syntax

ci2m examples

. nsize ci2m, sd(10) apre(10 2 3) nst(Name of the study)

. nsize ci2m, sd(75) apre(20) r(2) cl(99.9)

. nsize ci2m, sd(75) n1(175) n0(240)

. nsize ci2m, sd(75) n1(175) cl(90)

stored results ci2m options back to syntax

co1c examples

. nsize co1c, cr(0) cr1(0.25) nst(Name of the study)

. nsize co1c, cr(0) effect(-0.25) alpha(5) beta(20)

. nsize co1c, cr(0.32) cr1(0.47) n1(100) alpha(5)

stored results co1c options back to syntax

co2c examples

. nsize co2c, cr0(0.30) cr1(0.50) nst(Name of the study)

. nsize co2c, cr0(0) effect(0.25) alpha(5) beta(20)

. nsize co2c, cr0(0.32) cr1(0.47) n1(100) n0(80) alpha(5)

stored results co2c options back to syntax

co2r examples

. nsize co2r, r0(30) rd(10) nst(Name of the study)

. nsize co2r, pe0(25) or(2.5) r(2)

. nsize co2r, r0(4) rr(2) pe(15) alpha(5) beta(15)

. nsize co2r, r0(4) rr(2) r(5.67) alpha(5) n1(363)

. nsize co2r, pe0(25) or(2.5) m0(205) m1(36) alpha(5)

stored results co2r options back to syntax

co2i examples

. nsize co2i, i0(0.30) id(0.10) d(2) nst(Name of the study)

. nsize co2i, i0(0.30) id(0.10) d(2) r(2)

. nsize co2i, i0(0.4) ir(2) d(2) r(3) alpha(5) beta(15)

. nsize co2i, i0(0.4) ir(2) d(2) n0(69) n1(23) alpha(5)

stored results co2i options back to syntax

ncr examples

. nsize ncr, vb(0.000001685) vw(0.000001685) effect(0.003) nst(Name of the study)

. nsize ncr, vb(0.000001685) vw(0.000001685) effect(0.003) alpha(5) beta(10)

stored results ncr options back to syntax

Stored results

The command stores the following scalars or matrices in r():

co1p & co2p results

Sample Size

r(nn_2) sample size (n) Normal method Two-Sided Test

r(nc_2) sample size (n) Normal method corrected Two-Sided Test

r(na_2) sample size (n) ArcoSinus method Two-Sided Test

r(nn_1) sample size (n) Normal method One-Sided Test

r(nc_1) sample size (n) Normal method corrected One-Sided Test

r(na_1) sample size (n) ArcoSinus method One-Sided Test

Sample Size with alpha, beta by default

r(nn_power_side) sample size (n) Normal method

r(nc_power_side) sample size (n) Normal method corrected

r(na_power_side) sample size (n) ArcoSinus method

where power is the power in %: 80 85 90

side is Two (2) or One (1) Sided Test

Power

r(pn_2) power (p) Normal method Two-Sided Test

r(pc_2) power (p) Normal method corrected Two-Sided Test

r(pa_2) power (p) ArcoSinus method Two-Sided Test

r(pn_1) power (p) Normal method One-Sided Test

r(pc_1) power (p) Normal method corrected One-Sided Test

r(pa_1) power (p) ArcoSinus method One-Sided Test

co1p options co2p options
co1p examples co2p examples back to syntax

c1pe results

Sample Size

r(n) sample size (n)

Sample Size with alpha, beta by default

r(n_80) sample size (n) for power = 80%

r(n_85) sample size (n) for power = 85%

r(n_90) sample size (n) for power = 90%

Power

r(p) power (p)

c1pe options c1pe examples back to syntax

c2pe results

Sample Size

r(n0) sample size, Reference treatment (n0)

r(n1) sample size, Experimental treatment (n1)

r(n) sample size, Total (n)

Sample Size with alpha, beta by default

r(n0_power) sample size, Reference treatment (n0)

r(n1_power) sample size, Experimental treatment (n1)

r(n_power) sample size, Total (n)

where power is the power in %: 80 85 90

Power

r(p) power (p)

c2pe options c2pe examples back to syntax

co1p options co2p options
co1p examples co2p examples back to syntax

copp results

Sample Size

r(Size) sample size (n) matrix

Power

r(p2) power (p), Two-Sided Test

r(p1) power (p), One-Sided Test

copp options copp examples back to syntax

co1m results

Sample Size

r(n_2) sample size (n), Two-Sided Test

r(n_1) sample size (n), One-Sided Test

Sample Size with alpha, beta by default

r(n_power_side) sample size (n)

where power is the power in %: 80 85 90

side is Two (2) or One (1) Sided Test

Power

r(p_2) power (p), Two-Sided Test

r(p_1) power (p), One-Sided Test

Minimum Effect Size

r(eff_2) minimum effect size (eff), Two-Sided Test

r(eff_1) minimum effect size (eff), One-Sided Test

Minimum Effect Size with alpha, beta by default

r(eff_power_side) minimum effect size (eff)

where power is the power in %: 80 85 90

side is Two (2) or One (1) Sided Test

co1m options co1m examples back to syntax

co2m results

Sample Size

r(n0_2) sample size n0, Two-Sided Test

r(n0_1) sample size n0, One-Sided Test

r(n1_2) sample size n1, Two-Sided Test

r(n1_1) sample size n1, One-Sided Test

r(n_2) sample size Total (n), Two-Sided Test

r(n_1) sample size Total (n), One-Sided Test

Sample Size with alpha, beta by default

r(n0_power_side) sample size n0

r(n1_power_side) sample size n1

r(n_power_side) sample size Total (n)

where power is the power in %: 80 85 90

side is Two (2) or One (1) Sided Test

Power

r(p_2) power (p), Two-Sided Test

r(p_1) power (p), One-Sided Test

Minimum Effect Size

r(eff_2) minimum effect size (eff), Two-Sided Test

r(eff_1) minimum effect size (eff), One-Sided Test

Minimum Effect Size with alpha, beta by default

r(eff_power_side) minimum effect size (eff)

where power is the power in %: 80 85 90

side is Two (2) or One (1) Sided Test

co2m options co2m examples back to syntax

c2me results

Sample Size

r(n_2) sample size (n), Two-Sided Test

r(n_1) sample size (n), One-Sided Test

Sample Size with alpha, beta by default

r(n_power_side) sample size (n)

where power is the power in %: 80 85 90

side is Two (2) or One (1) Sided Test

Power

r(p_2) power (p), Two-Sided Test

r(p_1) power (p), One-Sided Test

Equivalence limits

r(eq_2) equivalence limits (eq), Two-Sided Test

r(eq_1) equivalence limits (eq), One-Sided Test

Equivalence limits with alpha, beta by default

r(eq_power_side) equivalence limits (eq)

where power is the power in %: 80 85 90

side is Two (2) or One (1) Sided Test

c2me options c2me examples back to syntax

cokm results

Sample Size

r(n_80_5) sample size (n) for Alpha Risk=5%, Power=80%

r(n_85_5) sample size (n) for Alpha Risk=5%, Power=85%

r(n_90_5) sample size (n) for Alpha Risk=5%, Power=90%

r(n_80_1) sample size (n) for Alpha Risk=1%, Power=80%

r(n_85_1) sample size (n) for Alpha Risk=1%, Power=85%

r(n_90_1) sample size (n) for Alpha Risk=1%, Power=90%

Power

r(p_5) power (p) for Alpha Risk=5%

r(p_1) power (p) for Alpha Risk=1%

cokm options cokm examples back to syntax

ci1p results

Sample Size

r(Size) sample size results matrix

Precision of CI

r(Precision) precision of CI results matrix

ci1p options ci1p examples back to syntax

ci2p results

Sample Size

r(Size) sample size results matrix

Precision of CI

r(p_90) precision of CI for 90% confidence level

r(p_95) precision of CI for 95% confidence level

r(p_975) precision of CI for 97.5% confidence level

r(p_99) precision of CI for 99% confidence level

ci2p options ci2p examples back to syntax

ci1m results

Sample Size

r(Size) sample size results matrix

Precision of CI

r(p_90) precision of CI for 90% confidence level

r(p_95) precision of CI for 95% confidence level

r(p_99) precision of CI for 99% confidence level

ci1m options ci1m examples back to syntax

ci2m results

Sample Size

r(Size) sample size results matrix

Precision of CI

r(p_cl) precision of CI (p) for a given confidence level (cl)

Precision of CI for default CL

r(p_90) precision of CI for 90% confidence level

r(p_95) precision of CI for 95% confidence level

r(p_975) precision of CI for 97.5% confidence level

r(p_99) precision of CI for 99% confidence level

ci2m options ci2m examples back to syntax

co1c & co2c results

Sample Size

r(n2) sample size (n), Two-Sided Test

r(n1) sample size (n), One-Sided Test

Sample Size with alpha, beta by default

r(n_power_side) sample size (n)

where power is the power in %: 80 85 90

side is Two (2) or One (1) Sided Test

Power

r(p2) power (p), Two-Sided Test

r(p1) power (p), One-Sided Test

co1c options co2c options
co1c examples co2c examples back to syntax

co2r & co2i results

Sample Size

r(Size) sample size results matrix

Power

r(Power) power results matrix

co2r options co2i options
co2r examples co2i examples back to syntax

ncr results

Number of communities by Group

r(n_2) number of communities (n), Normal method Two-Sided Test

r(n_1) number of communities (n), Normal method One-Sided Test

r(nc_2) number of communities (n), Student's correction Two-Sided Test

r(nc_1) number of communities (n), Student's correction One-Sided Test

Number of communities by Group with alpha, beta by default

r(n_power_side) number of communities (n), Normal method

r(nc_power_side) number of communities (n), Student's correction

where power is the power in %: 80 85 90

side is Two (2) or One (1) Sided Test

ncr options ncr examples back to syntax

Version

Version 1.3.7 -- 15 December 2022

Authors

JM.Doménech

Programmer: R.Sesma

Laboratori d'Estadística Aplicada

Universitat Autònoma de Barcelona

leam@uab.cat

Vancouver reference

Doménech JM. Sample Size and Power: Comparisons and estimations for independent proportions, means,

correlations, risks and rates: User-written command nsize for Stata [computer program].

V1.3.7. Bellaterra: Universitat Autònoma de Barcelona; 2022.

Available executing from Stata: net from http://metodo.uab.cat/stata

References

Chow SC, Shao J. A note on statistical methods for assessing therapeutic equivalence. Control Clin Trials. 2002;23(5): 515-20.

Chow SC, Shao J, Wang H. Sample size calculations in clinical research. 2nd ed. Boca Raton: Chapman & Hall/CRC; 2008.

Fleiss JL, Levin B, Pai MC. Statistical Methods for rates and proportions. 3rd ed. Hoboken (NJ): John Wiley& Sons; 2003.

Lemeshow S, Hosmer DW, Klar J, Lwanga SK. Adequacy of Sample Size in Health Studies. World Health Organization. Baffins Lane, Chichester: John Wiley & Sons; 1990.

Meinert C. Clinical Trials. Design, Conduct and Analysis. New York: Oxford University Press; 1986.