Skip to main content

Section 9.5 Exercises

Magnetic fields have been shown to have an effect on living tissue and were proposed as a method for treating pain. In the case study presented here, Carlos Vallbona and his colleagues
 1 
Vallbona, Carlos, Carlton F. Hazlewood, and Gabor Jurida. (1997). Response of pain to static magnetic fields in postpolio patients: A double-blind pilot study. Archives of Physical and Rehabilitation Medicine 78(11): 1200-1203.
sought to answer the question “Can the chronic pain experienced by postpolio patients be relieved by magnetic fields applied directly over an identified pain trigger point?”
A total of 50 patients experiencing post-polio pain syndrome were recruited. Some of the patients were treated with an active magnetic device and the others were treated with an inactive placebo device. All patients rated their pain before (score1) and after application of the device (score2). The variable “change” is the difference between “score1” and “score2”. The treatment condition is indicated by the variable “active”. The value “1” indicates subjects receiving treatment with the active magnet and the value “2” indicates subjects treated with the inactive placebo.
This case study is taken from the Rice Virtual Lab in Statistics. More details on this case study can be found in the case study Magnets and Pain Relief that is presented in that site.

Checkpoint 9.5.1.

The data for the 50 patients is stored in file “magnets.csv”. The file can be found on the internet at pluto.huji.ac.il/~msby/StatThink/Datasets/magnets.csv. Download this file to your computer and store it in the working directory of R. Read the content of the file into an R data frame. Produce a summary of the content of the data frame and answer the following questions:
  1. What is the sample average of the change in score between the patient’s rating before the application of the device and the rating after the application?
  2. Is the variable “active” a factor or a numeric variable?
  3. Compute the average value of the variable “change” for the patients that received and active magnet and average value for those that received an inactive placebo. (Hint: Notice that the first 29 patients received an active magnet and the last 21 patients received an inactive placebo. The sub-sequence of the first 29 values of the given variables can be obtained via the expression “change[1:29]” and the last 21 vales are obtained via the expression “change[30:50]”.)
  4. Compute the sample standard deviation of the variable “change” for the patients that received and active magnet and the sample standard deviation for those that received an inactive placebo.
  5. Produce a boxplot of the variable “change” for the patients that received and active magnet and for patients that received an inactive placebo. What is the number of outliers in each subsequence?

Checkpoint 9.5.2.

In Chapter 13 we will present a statistical test for testing if there is a difference between the patients that received the active magnets and the patients that received the inactive placebo in terms of the expected value of the variable that measures the change. The test statist for this problem is taken to be
\begin{equation*} \frac{\bar X_1 - \bar X_2}{\sqrt{S^2_1/29 + S^2_2/21}}\;, \end{equation*}
where \(\bar X_1\) and \(\bar X_2\) are the sample averages for the 29 patients that receive active magnets and for the 21 patients that receive inactive placebo, respectively. The quantities \(S^2_1\) and \(S_2^2\) are the sample variances for each of the two samples. Our goal is to investigate the sampling distribution of this statistic in a case where both expectations are equal to each other and to compare this distribution to the observed value of the statistic.
  1. Assume that the expectation of the measurement is equal to 3.5, regardless of what the type of treatment that the patient received. We take the standard deviation of the measurement for patients the receives an active magnet to be equal to 3 and for those that received the inactive placebo we take it to be equal to 1.5. Assume that the distribution of the measurements is Normal and there are 29 patients in the first group and 21 in the second. Find the interval that contains 95% of the sampling distribution of the statistic.
  2. Does the observed value of the statistic, computed for the data frame “magnets”, falls inside or outside of the interval that is computed in 1?