|
Dear All
does anybody have a formula for the sample size calculation of a two-sample crossover design comparing between proportions? Any help will be appreciated. Thanks, Christian ******************************* la volta statistics Christian Schmidhauser, Dr.phil.II Weinbergstrasse 108 Ch-8006 Zürich Tel: +41 (043) 233 98 01 Fax: +41 (043) 233 98 02 email: mailto:[hidden email] internet: http://www.lavolta.ch/ |
|
la volta statistics escribió:
> does anybody have a formula for the sample size calculation of a two-sample > crossover design comparing between proportions? > Hi Christian: You don't give a lot of details, but (correct me if I'm wrong) I think this is the general picture: 1) You are studying a binary variable (yes/no) 2) You are going to use a related samples design (half the patients will test treatment A first and treatment B after, and the other half the other way). This means that you are going to use McNemar test for statistical analysis. The problem with that test (in relation to sample size determination) is that concordant pairs (no/no and yes/yes patters) are discarded for the computation of the p-value. This makes sample size determination difficult. I had a copy of good paper that covered that topic, but, unfortunately it's in Spanish and besides, I lent it to someone who didn't return it (we say in Spain that there are two types of stupid people: those who lend books and those who return them, I suppose the same can be said about photocopies of rare papers...). I was then going to give you the link to a program (in Spanish, but language can be switched toEnglish after installation) that would compute the requiered sample size using a complicated formula I had read in the lost paper, but the program isn't there anymore... (I can't believe that today isn't Monday, but Tuesday...). Anyway, I did a bit of Googling and run into these papers with formulas for McNemar test sample size: http://findarticles.com/p/articles/mi_qa3899/is_200110/ai_n8956223 http://links.jstor.org/sici?sici=0006-341X(198906)45%3A2%3C629%3ATSASSF%3E2.0.CO%3B2-5 Unfortunately, right now I'm not at the University (where I have access to a variaty of papers), but at home, and I can't download the papers for you. Perhaps you (or some kind soul that reads this message) can download them (in that case, I'd REALLY appreciate a copy of both, thaks a lot, because I don't inted to go to the university in several days). If anyone can send me those papers, I promise to write some SPSS syntax to simplify the task. Best regards, Marta |
|
I've forwarded Marta the papers she requested.
Patricia ___________________________________ Patricia Régo Centre for Medical Education School of Medicine The University of Queensland Australia ph: 61-7-3346-4683; fax: 3365-5522 [hidden email] Evaluation Consultant to Qld Health Skills Development Centre ph: 3636-6449 [hidden email] -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Marta Garcia-Granero Sent: Wednesday, 1 August 2007 2:48 AM To: [hidden email] Subject: Re: sample size calculation for crossover design la volta statistics escribió: > does anybody have a formula for the sample size calculation of a two-sample > crossover design comparing between proportions? > Hi Christian: You don't give a lot of details, but (correct me if I'm wrong) I think this is the general picture: 1) You are studying a binary variable (yes/no) 2) You are going to use a related samples design (half the patients will test treatment A first and treatment B after, and the other half the other way). This means that you are going to use McNemar test for statistical analysis. The problem with that test (in relation to sample size determination) is that concordant pairs (no/no and yes/yes patters) are discarded for the computation of the p-value. This makes sample size determination difficult. I had a copy of good paper that covered that topic, but, unfortunately it's in Spanish and besides, I lent it to someone who didn't return it (we say in Spain that there are two types of stupid people: those who lend books and those who return them, I suppose the same can be said about photocopies of rare papers...). I was then going to give you the link to a program (in Spanish, but language can be switched toEnglish after installation) that would compute the requiered sample size using a complicated formula I had read in the lost paper, but the program isn't there anymore... (I can't believe that today isn't Monday, but Tuesday...). Anyway, I did a bit of Googling and run into these papers with formulas for McNemar test sample size: http://findarticles.com/p/articles/mi_qa3899/is_200110/ai_n8956223 http://links.jstor.org/sici?sici=0006-341X(198906)45%3A2%3C629%3ATSASSF%3E2.0.CO%3B2-5 Unfortunately, right now I'm not at the University (where I have access to a variaty of papers), but at home, and I can't download the papers for you. Perhaps you (or some kind soul that reads this message) can download them (in that case, I'd REALLY appreciate a copy of both, thaks a lot, because I don't inted to go to the university in several days). If anyone can send me those papers, I promise to write some SPSS syntax to simplify the task. Best regards, Marta |
|
Hi Patricia
Many thanks, I'm working on some syntax based on Lehr's paper to compute sample size for McNemar test. Best regards, Marta > I've forwarded Marta the papers she requested. > > Patricia > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Marta Garcia-Granero > Sent: Wednesday, 1 August 2007 2:48 AM > To: [hidden email] > Subject: Re: sample size calculation for crossover design > > la volta statistics escribió: > >> does anybody have a formula for the sample size calculation of a two-sample >> crossover design comparing between proportions? >> Hi Christian: >> >> You don't give a lot of details, but (correct me if I'm wrong) I think >> this is the general picture: >> >> 1) You are studying a binary variable (yes/no) >> 2) You are going to use a related samples design (half the patients will >> test treatment A first and treatment B after, and the other half the >> other way). >> >> This means that you are going to use McNemar test for statistical >> analysis. The problem with that test (in relation to sample size >> determination) is that concordant pairs (no/no and yes/yes patters) are >> discarded for the computation of the p-value. This makes sample size >> determination difficult. I had a copy of good paper that covered that >> topic, but, unfortunately it's in Spanish and besides, I lent it to >> someone who didn't return it (we say in Spain that there are two types >> of stupid people: those who lend books and those who return them, I >> suppose the same can be said about photocopies of rare papers...). I was >> then going to give you the link to a program (in Spanish, but language >> can be switched toEnglish after installation) that would compute the >> requiered sample size using a complicated formula I had read in the lost >> paper, but the program isn't there anymore... (I can't believe that >> today isn't Monday, but Tuesday...). >> >> Anyway, I did a bit of Googling and run into these papers with formulas >> for McNemar test sample size: >> >> http://findarticles.com/p/articles/mi_qa3899/is_200110/ai_n8956223 >> http://links.jstor.org/sici?sici=0006-341X(198906)45%3A2%3C629%3ATSASSF%3E2.0.CO%3B2-5 >> >> Unfortunately, right now I'm not at the University (where I have access >> to a variety of papers), but at home, and I can't download the papers >> for you. Perhaps you (or some kind soul that reads this message) can >> download them (in that case, I'd REALLY appreciate a copy of both, thanks >> a lot, because I don't intend to go to the university in several days). >> >> If anyone can send me those papers, I promise to write some SPSS syntax >> to simplify the task. >> >> Best regards, >> Marta >> >> |
|
In reply to this post by Patricia Rego
OK
Quick and dirty solution. It can be easily turned into a cute MACRO. Also, output can be improved (report input conditions, intermediate values computed...). Regards, Marta * Table layout: * | Treatment B * |------------------------- * Treatment A |Negative Positive Total * ---------------------------------------- * Negative | a b a+b * Positive | c d c+d * ---------------------------------------- * Total | a+c b+d n * Proportion with outcome in A * p1=(c+d)/n * Proportion with outcome in B * p2=(b+d)/n * p2-p1=(b-c)/n * Sample size equation (alpha=0.05 and power=0.80): * n = 16pq(1-r²)/d² * where: * p=(p1+p2)/2 * q=1-p * r=phi correlation coefficient: * r=(ad-bc)/SQRT[(a+b)(c+d)(a+c)(b+d)] * also: * r=( p1+p2-phi-2p1p2) ------------------------ (phi=proportion of discordant pairs) 2*SQRT[p1(1-p1)p2(1-p2)] * maximum r is (1-delta)/(1+delta) * where delta=p2-p1 * minimum r value is 0 * Therefore, in order to compute sample size for McNemar test, it * is advisable to have a small pilot study used to estimate phi . * Instead of 16, use: * 21 if alpha=0.05 & power=0.90 * 26 if alpha=0.05 & power=0.95 * 23.5 if alpha=0.01 & power=0.80 * 30 if alpha=0.01 & power=0.90 * 36 if alpha=0.01 & power=0.95 * see Table 3 of Lehr's paper for other values (one tailed tests) * BEGINNING OF SYNTAX *. MATRIX. * Example data from Lehr's paper (table 2), replace by your own *. COMPUTE p1 = 0.9 . COMPUTE p2 = 0.8 . COMPUTE phi= 0.14 . * Coefficient for alpha=0.05 & power =0.80 *. COMPUTE coeff=16. * Intermediate computations *. COMPUTE delta=ABS(p2-p1). COMPUTE p=(p1+p2)/2. COMPUTE q=1-p. COMPUTE minr = 0. COMPUTE maxr = (1-delta)/(1+delta). COMPUTE r = (p1+p2-phi-2*p1*p2)/(2*SQRT(p1*(1-p1)*p2*(1-p2))). * Computing possible values for n *. COMPUTE minn = TRUNC(coeff*p*q*(1-maxr)/(delta**2)). COMPUTE maxn = TRUNC(coeff*p*q*(1-minr)/(delta**2)). COMPUTE realn= TRUNC(coeff*p*q*(1- r)/(delta**2)). * Report *. PRINT {minn,realn,maxn} /FORMAT='F8.0' /CLABELS='Min','Estim.','Max' /TITLE='Estimated sample size required'. END MATRIX. * If only delta is given (no p1 or p2), then the only possibility is compute * max&min n (based on minr=0 and maxr=(1-delta)/(1+delta) and average them. MATRIX. * Input data (replace by your own) *. COMPUTE delta=0.1. COMPUTE p=0.5. COMPUTE q=0.5. * Coefficient for alpha=0.05 & power =0.80 *. COMPUTE coeff=16. * Computing possible values for n *. COMPUTE minr = 0. COMPUTE maxr = (1-delta)/(1+delta). COMPUTE minn = TRUNC(coeff*p*q*(1-maxr)/(delta**2)). COMPUTE maxn = TRUNC(coeff*p*q*(1-minr)/(delta**2)). COMPUTE Estn= (minn+maxn)/2. * Report *. PRINT {minn,estn,maxn} /FORMAT='F8.0' /CLABELS='Min','Estim.','Max' /TITLE='Estimated sample size required'. END MATRIX. |
|
Hi Marta and Patricia
Many thanks for the syntax. I asked Patricia to send me the papers as well. Meanwhile a colleague of mine has sent me a PDF file with class notes from Lehana Thabane about sample size determination in clinical trials. He told me that he found the notes on the web a while a go, but unfortunately they are not there any more. Lehana Thabane mentions the formula for a two sample cross over as follows: (z_alpha - z_beta)^2 * sigma^2 ni = ----------------------------------- 2(pi_1 - pi_2) ^2 where the Null-hypothesis is: pi_1 - pi_2 = 0 If you are interested I can send you the PDF file off-list as attachment. Unfortunately, there are no references where the formulae came from. Thanks again Christian -----Ursprüngliche Nachricht----- Von: SPSSX(r) Discussion [mailto:[hidden email]]Im Auftrag von Marta Garcia-Granero Gesendet: Mittwoch, 1. August 2007 11:57 An: [hidden email] Betreff: Re: PAPERS SENT - RE: sample size calculation for crossover design OK Quick and dirty solution. It can be easily turned into a cute MACRO. Also, output can be improved (report input conditions, intermediate values computed...). Regards, Marta * Table layout: * | Treatment B * |------------------------- * Treatment A |Negative Positive Total * ---------------------------------------- * Negative | a b a+b * Positive | c d c+d * ---------------------------------------- * Total | a+c b+d n * Proportion with outcome in A * p1=(c+d)/n * Proportion with outcome in B * p2=(b+d)/n * p2-p1=(b-c)/n * Sample size equation (alpha=0.05 and power=0.80): * n = 16pq(1-r²)/d² * where: * p=(p1+p2)/2 * q=1-p * r=phi correlation coefficient: * r=(ad-bc)/SQRT[(a+b)(c+d)(a+c)(b+d)] * also: * r=( p1+p2-phi-2p1p2) ------------------------ (phi=proportion of discordant pairs) 2*SQRT[p1(1-p1)p2(1-p2)] * maximum r is (1-delta)/(1+delta) * where delta=p2-p1 * minimum r value is 0 * Therefore, in order to compute sample size for McNemar test, it * is advisable to have a small pilot study used to estimate phi . * Instead of 16, use: * 21 if alpha=0.05 & power=0.90 * 26 if alpha=0.05 & power=0.95 * 23.5 if alpha=0.01 & power=0.80 * 30 if alpha=0.01 & power=0.90 * 36 if alpha=0.01 & power=0.95 * see Table 3 of Lehr's paper for other values (one tailed tests) * BEGINNING OF SYNTAX *. MATRIX. * Example data from Lehr's paper (table 2), replace by your own *. COMPUTE p1 = 0.9 . COMPUTE p2 = 0.8 . COMPUTE phi= 0.14 . * Coefficient for alpha=0.05 & power =0.80 *. COMPUTE coeff=16. * Intermediate computations *. COMPUTE delta=ABS(p2-p1). COMPUTE p=(p1+p2)/2. COMPUTE q=1-p. COMPUTE minr = 0. COMPUTE maxr = (1-delta)/(1+delta). COMPUTE r = (p1+p2-phi-2*p1*p2)/(2*SQRT(p1*(1-p1)*p2*(1-p2))). * Computing possible values for n *. COMPUTE minn = TRUNC(coeff*p*q*(1-maxr)/(delta**2)). COMPUTE maxn = TRUNC(coeff*p*q*(1-minr)/(delta**2)). COMPUTE realn= TRUNC(coeff*p*q*(1- r)/(delta**2)). * Report *. PRINT {minn,realn,maxn} /FORMAT='F8.0' /CLABELS='Min','Estim.','Max' /TITLE='Estimated sample size required'. END MATRIX. * If only delta is given (no p1 or p2), then the only possibility is compute * max&min n (based on minr=0 and maxr=(1-delta)/(1+delta) and average them. MATRIX. * Input data (replace by your own) *. COMPUTE delta=0.1. COMPUTE p=0.5. COMPUTE q=0.5. * Coefficient for alpha=0.05 & power =0.80 *. COMPUTE coeff=16. * Computing possible values for n *. COMPUTE minr = 0. COMPUTE maxr = (1-delta)/(1+delta). COMPUTE minn = TRUNC(coeff*p*q*(1-maxr)/(delta**2)). COMPUTE maxn = TRUNC(coeff*p*q*(1-minr)/(delta**2)). COMPUTE Estn= (minn+maxn)/2. * Report *. PRINT {minn,estn,maxn} /FORMAT='F8.0' /CLABELS='Min','Estim.','Max' /TITLE='Estimated sample size required'. END MATRIX. |
| Free forum by Nabble | Edit this page |
