Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Homework 6 Solutions for Statistical Methods for Clinical Trials | STAT 641, Study notes of Data Analysis & Statistical Methods

hw6 Material Type: Notes; Class: Statistical Methods for Clinical Trials; Subject: STATISTICS; University: University of Wisconsin - Madison; Term: Fall 2014;

Typology: Study notes

2015/2016

Uploaded on 07/21/2016

thook-mocas
thook-mocas 🇺🇸

1 document

1 / 8

Toggle sidebar

Related documents


Partial preview of the text

Download Homework 6 Solutions for Statistical Methods for Clinical Trials | STAT 641 and more Study notes Data Analysis & Statistical Methods in PDF only on Docsity! Statistics 641, Fall 2014 Homework #6 Solutions 1. The dataset data6.csv contains data collected from a crossover study with 40 subjects per sequence. The variables in the dataset are: seq Assigned treatment sequence y Response id Subject id period Period z Treatment (“A” or “B”) (a) Calculate the means within each treatment group separately for periods 1 and 2. Using these means, calculate the estimate of the treatment difference assuming no carryover. > m <- with(data, tapply(y, list(z, period), mean)) > m 1 2 A 9.6625 22.7025 B 10.1000 22.9200 # difference in "AB" group: > m[2,2]-m[1,1] [1] 13.2575 # difference in "BA" group: > m[2,1]-m[1,2] [1] -12.6025 # mean difference: > (m[2,2]-m[1,1] + m[2,1]-m[1,2])/2 [1] 0.3275 Note that the estimate of period effect is: > (m[2,2]-m[1,1] - (m[2,1]-m[1,2]))/2 [1] 12.93 (b) Fit a regression model that estimates the treatment difference and its standard error. > summary(lm(y ~ z + period + id, data=data)) Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -3.409e+00 6.695e-01 -5.091 2.41e-06 *** zB 3.275e-01 1.412e-01 2.320 0.022947 * period 1.293e+01 1.412e-01 91.602 < 2e-16 *** ids02 1.750e+00 8.927e-01 1.960 0.053535 . ... ids80 -1.400e+00 8.927e-01 -1.568 0.120878 --- Signif. codes: 0 ’***’ 0.001 ’**’ 0.01 ’*’ 0.05 ’.’ 0.1 ’ ’ 1 ... The estimate of treatment effect is 0.3275 with SE 0.1412. The p-value is 0.0229. Alternative using mixed-effects model from package lme4: > lmer(y ~ z + period + (1|id), data=data) Linear mixed model fit by REML ... Random effects: Groups Name Variance Std.Dev. id (Intercept) 9.2589} 3.04284 Residual 0.79697 0.89273 Number of obs: 160, groups: id, 80 Fixed effects: Estimate Std. Error t value (Intercept) -3.2125 0.4129 -7.78 zB 0.3275 0.1412 2.32 period 12.9300 0.1412 91.60 Correlation of Fixed Effects: (Intr) zB zB -0.171 period -0.513 0.000 (a) Calculate the required number of events to achieve 90% power at α = 0.05. Assume equal numbers of patients in each treatment group. Schoenfeld’s formula gives the number of events required to achieve the desired power is (assume 90% power and α = 0.05). (Z1−α/2 + Z1−β) 2 ξ1ξ2 log(r)2 = 3.242 (1/2)2 log .752 = 507.4 (b) Compute the required sample size (number of subjects) for each of the two designs. Hint: You need to compute the probability that a subject will experience an event during the trial. The hazard function is piecewise linear. To compute the sample size, we need to find the number of subjects required to reach this number of events. There are a couple approaches, the simplest is to use the average hazard. The hazards for the active treatment group is 0.75/year for the first 6 months and 0.03/year thereafter. The average of the control and active hazards is 0.875/year during the first 6 months and 0.035/year thereafter. The cumulative hazard is Λ(t) = { 0.0875t if t < 0.5 0.0875 × .5 + 0.035(t − .5) = 0.02625 + 0.035t if t ≥ 0.5 The probability that a subject experiences an event before time t is 1− e−Λ(t). If the total length of follow-up is F and the length of the recruitment period is R, then (because F −R > .5) the probability of an event is ρ = 1 R ∫ F F−R 1− e−Λ(u)du = 1− e −.02625 R ∫ F F−R e−.035udu = 1 + e−.02625 0.035R ( e−.035×F − e−.035×(F−R) ) . For the two scenarios we have i. ρ = 0.1305 ii. ρ = 0.1073 Therefore, the required number of subjects for each of the two scenarios is: i. 507.4/0.1305 = 3887 ii. 507.4/0.1073 = 4727 4. Suppose that we have a binary outcome, and wish to show superiority of treatment B relative to treatment B. In designing the trial we assumed that the failure rates are pA = 0.36 and pB = 0.30 in treatment groups A and B respectively. (a) Find the sample size required to detect the difference in rates above with 90% power at two-sided α = .05. p = (.36 + .30)/2 = .33, so N = (1.96 + 1.28)2 × .33× .67 × 4 (.36 − .30)2 = 2579 With equal sized groups, use N = 2580, or 1290 per group. (b) Suppose that the true control rate, pA is different than expected. For the sample size found in (a), i. plot power as a function of true pA for .07 ≤ pA ≤ 0.5 under the assumption of constant risk difference pA − pB = 0.06 and ii. on the same figure, plot power as a function of true pA under the assumption of constant log-odds ratio log(pA/(1− pA))− log(pB/(1− pB) = 0.272. Why do these curves differ in the way that they do? Power can be found by solving the sample size equation for Z1−β and calculating the corre- sponding value of 1− β. Z1−β = √ 2580(pA − pB) 2 √ p(1− p) − Z1−α/2 so 1− β = Φ [√ 2580(pA − pB) 2 √ p(1− p) − Z1−α/2 ] where Φ is the standard normal CDF. If we choose pA, and fix the risk difference to be 0.06, we have 1− β = Φ [ √ 2580 × 0.06 2 √ (pA − .03)(1.03 − pA) − Z1−α/2 ] If we choose pA, and fix the odds-ratio to be .3× .64/.7 × .36 = 0.7619 , we have that pB 1− pB = 0.7619pA 1− pA and solving for pB , pB = 0.7619pA 1− .2381pA R code: > pA <- 7:50/100 > pBi <- pA -.06 > pBii <- exp(-.272)*pA/(1+(exp(-.272)-1)*pA) > pBari <- pA-.03 > pBarii <- (pA+pBii)/2 > plot(pA, pnorm(sqrt(2580)*.06/2/sqrt(pBari*(1-pBari))-1.96), + type="l",ylim=c(0,1), ylab="Power",xlab=expression(pi[A])) > lines(pA, pnorm(sqrt(2580)*sqrt(pBarii*(1-pBarii))*.272/2-1.96), + lty=2) > abline(h=.9,lty=3) > legend("bottomright", bty="n", lty=1:2, c("Constant Difference in Rates", + "Constant Odds Ratio")) 0.1 0.2 0.3 0.4 0.5 0. 0 0. 2 0. 4 0. 6 0. 8 1. 0 pA P ow er As in the previous problem, for fixed risk difference, the variability in p̂A − p̂B decreases as p̂A decreases, so the standardized difference, |pA − pB|/ √ p̂A − p̂B increases, with a corre- sponding increase in power. On the other hand, for fixed OR, the standardized difference, | log(OR)|/ √ Var(log(ÔR)) decreases with decreasing pA, with a corresponding decrease in power. 5. Suppose that we observe the following continuous responses for groups A and B. A: 3.0, 1.7, 4.6, 3.6, 1.2, 3.1 B: 3.9, 6.7, 7.5, 3.4, 8.8, 9.8 Let µ̂ be then difference in means, µ̂ = XB −XA. Compute a one-sided p-value under the randomization distribution generated by the random allocation rule (NA = NB). (Note that you don’t need to generate the entire randomization distribution for µ̂.) Compare to p-values from a two-sample t-test and Wilcoxon rank-sum test (since these are two-sided by default, you’ll need to divide the p-values from these tests by 2).
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved