IE 5342 Group D001, flipped assignment number 5.
One method for assessing the bioavailability of a drug is to note its concentration in blood and/or urine samples at certain periods of time after the drug is given. Suppose we want to compare the concentrations of two types of aspirin (types A and B) in urine specimens taken from the same person 1 hour after he/ she has taken the drug. In this study protocol, a specific dosage of either type A or type B aspirin is given and the urine concentration after 1-hour is measured. One week later, after the first aspirin has presumably been cleared from the system, the same dosage of the other aspirin is given to the same person and the urine concentration after 1-hour is noted. Because the order of giving the drugs may affect the results, a table of random numbers is used to decide which of the two types of aspirin to give first. The concentration will be measured as a percentage, and it is presumed that the standard deviation of the difference between subjects is approximately 3%.
Determine how many samples would be needed to test if the mean urin concentration for Aspirin B is less than Aspirin A at an alpha=0.05 level of significance such that there would be a 75% chance of correctly rejecting the null hypothesis if the urine concentration of Aspirin B is 1.5% less than that of Aspirin A.
A pwr.t.test with the number of samples = NULL to determine compute the required value.
library(pwr)
pwr.t.test(n=NULL,d=.5,sig.level=0.05,power=.75, type="paired",alternative = "greater")
##
## Paired t test power calculation
##
## n = 22.92958
## d = 0.5
## sig.level = 0.05
## power = 0.75
## alternative = greater
##
## NOTE: n is number of *pairs*
The output shows that 23 subjects are needed to have a 75% chance of correctly rejecting the null hypothesis for the described conditions.
Researchers at a major university would like to design an experiment to test the hypothesis that exercise can shorten the time that it takes for an infant to learn how to walk. Specifically, they would like to use one-week old male infants from white middle-class white families as test subjects and will allocate them into one of two treatment groups. Those in the active exercise group will receive stimulation of the walking reflexes for four 3-minute sessions each day from the beginning of the second week through the end of the eighth week following birth; those in the other group will receive no such stimulation. Following this, the time (in months) that it takes subjects from each group to walk independently will then be measured. Since this is a preliminary project, the researchers would like to use an alpha=0.10 level of significance for this test, but would like to achieve a power of .85 at detecting a mean difference that is half of the (pooled) standard deviation of walking times.
Determine how many infants need to be enrolled in each group and how many infants total.
A pwr.t.test with the number of samples = NULL to determine compute the required value.
pwr.t.test(n=NULL,d=.5,sig.level=.10,power=.85,type="two.sample",alternative = "greater")
##
## Two-sample t test power calculation
##
## n = 43.40568
## d = 0.5
## sig.level = 0.1
## power = 0.85
## alternative = greater
##
## NOTE: n is number in *each* group
Each group needs to have 44 infants in it; this requires 88 infants total.