.- help for ^sampsi2^ (STB-40 sbe18) .- Sample size calculations with repeated measures ----------------------------------------------- ^sampsi2^ #1 #2^, pre(^#^)^ ^post(^#^)^ ^r0(^#^)^ ^r1(^#^)^ ^r01(^#^)^ ^m^ethod^(post^|^change^|^ancova^|^all)^ ^a^lpha^(^#^)^ ^p^ower^(^#^)^ ^n^1^(^#^)^ ^n2(^#^)^ ^r^atio^(^#^)^ ^sd^1^(^#^)^ ^sd2(^#^)^ ^onesam^ple ^onesid^ed Description ----------- ^sampsi2^ is an extension to @sampsi@ for repeated measured data, following Frison & Pocock (1992) Statistics in Medicine. Like ^sampsi^, it estimates required sample size for comparisons of means or proportions. If ^n1()^ or ^n2()^ is specified, ^sampsi^ computes power; otherwise, it computes sample size. ^sampsi^ is an immediate command; all of its arguments are numbers; see help @immed@. If any of ^pre^, ^post^, ^r0^, ^r1^, ^r01^, ^method^ are specified, ^sampsi2^ computes sample size or power for comparisons of means. 1. Two-sample comparison of means. The postulated values of the means are #1 and #2. The postulated standard deviations are ^sd1()^ and ^sd2()^. The number of measurements made at baseline & follow-up are ^pre(^#^)^ and ^post(^#^)^ The correlations are given by ^r0(^#^)^, ^r1(^#^)^ and ^r01(^#^)^ ^method^ shows the planned method of analysis. 2. One-sample comparison of mean to hypothesized value. Option ^onesample^ must be specified. The hypothesized value (null hypothesis) is #1. The postulated mean (alternative hypothesis) is #2. The postulated standard deviation is ^sd1()^. The number of measurements made at baseline & follow-up are ^pre(^#^)^ and ^post(^#^)^ The correlations are given by ^r0(^#^)^, ^r1(^#^)^ and ^r01(^#^)^ ^method^ shows the planned method of analysis. Otherwise, ^sampsi2^ behaves like ^sampsi^. 3. Two-sample comparison of means. The postulated values of the means are #1 and #2. The postulated standard deviations are ^sd1()^ and ^sd2()^. 4. One-sample comparison of mean to hypothesized value. Option ^onesample^ must be specified. The hypothesized value (null hypothesis) is #1. The postulated mean (alternative hypothesis) is #2. The postulated standard deviation is ^sd1()^. 5. Two-sample comparison of proportions. The postulated values of the proportions are #1 and #2. 6. One-sample comparison of proportion to hypothesized value. Option ^onesample^ must be specified. The hypothesized proportion (null hypothesis) is #1. The postulated proportion (alternative hypothesis) is #2. Options specific to sampsi2 --------------------------- ^method^ can be any of ^post^ (use the average of post measures only), ^change^ (use the average change between baseline and follow-up), ^ancova^ (use the average of the baseline measures, corrected for baseline by ANCOVA) or ^all^ (all three of these). If ^method^ is specified, ^r1(^#^)^ must be given. ^pre(^#^)^ and ^post(^#^)^ are the planned number of measurements before and after randomisation. If not specified, ^post()^ is taken as 1; ^pre()^ is taken as 0. If ^pre()^ is 0, method ^post^ is assumed. (The other methods make no sense.) If ^pre()^ is 0, and ^post()^ is 1, results are the same as for ^sampsi^. ^r0(^#^)^, ^r1(^#^)^ and ^r01(^#^)^ are the correlations of measures at baseline, during follow-up, and between baseline & follow-up. If ^r0()^ or ^r01()^ are not given, they are taken as equal to ^r1()^. Frison & Pocock suggest that a typical value for ^r1()^ is 0.7. Options also used by sampsi --------------------------- ^alpha(^#^)^ specifies the significance level of the test; the default is ^alpha(.05)^. (More correctly, the default is 1-level/100 from ^set level^, see help @level@.) ^power(^#^)^ is power of the test. Default is ^power(.90)^. ^n1(^#^)^ specifies the size of the first (or only) sample and ^n2(^#^)^ specifies the size of the second sample. If specified, ^sampsi^ reports the power calculation. If not specified, ^sampsi^ computes sample size. ^ratio(^#^)^ is an alternative way to specify ^n2()^ in two-sample tests. In a two-sample test, if ^n2()^ is not specified, ^n2()^ is assumed to be ^n1()^*^ratio()^. That is, ^ratio()^ = ^n2()^/^n1()^. The default is ^ratio(1)^. ^sd1(^#^)^ and ^sd2(^#^)^ are the standard deviations for comparison of means. If not specified, comparison of proportions is assumed. In two-sample cases, if only ^sd1()^ is specified, ^sd2()^ is assumed to equal ^sd1()^. ^onesample^ indicates a one-sample test. The default is a two-sample test. ^onesided^ indicates a one-sided test. The default is a two-sided test. Examples going beyond sampsi ---------------------------- 1. Two-sample comparison of mean1 to mean2. Compute sample sizes with no baseline measures and two at follow-up, correlations 0.7 Show sample sizes for POST: . ^sampsi2 132.86 127.44, pre(1) post(2) r1(.7) sd(15.34) ^ Compute power with n1 = n2, sd1 = sd2, and alpha = 0.01 one-sided, assume one baseline measure and two at follow-up, correlations 0.7 at follow-up , and 0.6 between baseline and follow-up. Use a onesided test. Show power for POST, CHANGE, and ANCOVA: . ^sampsi2 5.6 6.1, pre(1) post(2) r1(0.7) r01(0.6) n1(100) sd1(1.5) a(0.01) onesided^ 2. One-sample comparison of mean to hypothesized value = 180. Assume one baseline measure and one at follow-up, all correlations 0.7. Show sample size for POST: . ^sampsi2 180 211, pre(1) r1(0.7) method(post) sd(46) onesam^ One-sample comparison of mean to hypothesized value = 0. Assume no baseline measures and three at follow-up, all correlations 0.7. Compute power for CHANGE: . ^sampsi2 0 -2.5, pre(1) post(3) r1(0.7) method(change) sd(4) n(25) onesam^ Examples identical to sampsi (One follow-up measurement only) ------------------------------------------------------------- 3. Two-sample comparison of mean1 to mean2. Compute sample sizes with n2/n1 = 2: . ^sampsi2 132.86 127.44, p(0.8) r(2) sd1(15.34) sd2(18.23)^ Compute power with n1 = n2, sd1 = sd2, and alpha = 0.01 one-sided . ^sampsi2 5.6 6.1, n1(100) sd1(1.5) a(0.01) onesided^ 4. One-sample comparison of mean to hypothesized value = 180. Compute sample size: . ^sampsi2 180 211, sd(46) onesam^ One-sample comparison of mean to hypothesized value = 0. Compute power: . ^sampsi2 0 -2.5, sd(4) n(25) onesam^ 5. Two-sample comparison of proportions. Compute sample size with n1 = n2 (i.e., ratio = 1, the default) and power = 0.9 (the default): . ^sampsi2 0.25 0.4^ Compute power with n1 = 500 and ratio = n2/n1 = 0.5: . ^sampsi2 0.25 0.4, n1(300) r(0.5)^ 6. One-sample comparison of proportion to hypothesized value = 0.5: . ^sampsi2 0.5 0.75, power(0.8) onesample^ Compute power: . ^sampsi2 0.5 0.6, n(200) onesam^ Author ------ Paul Seed Department of Public Health Medicine United Medical and Dental Schools Guy's and St. Thomas's Hospitals, UK email: p.seed@@umds.ac.uk Also see -------- STB: STB-40 sbe18 Manual: [R] sampsi On-line: help for @sampsi@, @immed@