Stents are devices put inside blood vessels that assist in patient recovery after cardiac events, and they have been shown to reduce the risk of an additional heart attack or death.
Many doctors have hoped that there would be similar benefits for patients at risk of stroke.
Research Question: Does the use of stents reduce the risk of stroke?
## outcome
## group no event stroke
## control 199 28
## treatment 179 45
Suppose that in this group of 451 patients, 73 would have had a stroke event during the year regardless of which group they were in.
Key Question: In this case, how likely is it to get 45 (or more) stroke events in the treatment group?
We can attack the key question via simulation!
First, create a deck of 451 cards so that 73 of them have ‘s’ printed on them (for stroke event), the rest have ‘n’.
deck <- rep(c("n","s"),times=c(378,73))
table(deck)
## deck
## n s
## 378 73
We shuffle the deck, randomly deal 224 cards into Treatment group, and see how many ‘s’ cards we get.
sim1 <- sample(deck)[1:224]
table(sim1)
## sim1
## n s
## 181 43
sim2 <- sample(deck)[1:224]
table(sim2)
## sim2
## n s
## 189 35
sim3 <- sample(deck)[1:224]
table(sim3)
## sim3
## n s
## 178 46
We should expect to get different ‘s’ counts from different samples.
In our three simulations we saw these results: 43, 35, 46
What range of results should we expect if we continued this game? And how likely is it to get 45 or more on any given trial?
If we simulatw a bunch of times, we can address these types of questions.
trials=5000
results<-c()
for(x in 1:trials)
{results<-c(results,table(sample(deck)[1:224])['s'])}
Running this simulation 5000 times, we asked R to record the results in the vector results
. With the code below, we can find how often the treatment group had at least 45 stroke events in these in these 5000 trials.
sum(results>=45)
## [1] 96
The proportion of the trials with at least 45 stroke events:
sum(results>=45)/trials
## [1] 0.0192
In other words, such an extreme number of stroke events would occured in about 1.9% of these trials.
We can also plot a histogram of our simulation results to get a sense of how many ’s’ cards are likely to turn up in any given trial.
If we assume the treatments have no effect on the 451 patients in this group, and that 73 of these patients would have had a stroke event in the first year, regardless of treatment, then it is very unlikely that among 224 randomly chosen patients from the group, 45 or more of them would have a stroke event.
In fact, our simulation of 5000 trials suggests that such an extreme result happens about 1.9% of the time.
The researchers originally asked whether the use of stents reduced the rate of strokes, and the data clearly do not support this claim. In fact, after running this simulation, I am led to consider that the treatment actually makes a stroke more likely, because in the experiment 45 of the patients in the treatment group actually did suffer a stroke event in the first year, something that would happen very rarely if the stent made no difference.