Thirty-Six Months of A1c Control in R: A Control Chart and a Segmented Regression of the Clinic's Poor-Control Rate Before and After Nurse Coaching, With the Code Logic and the Assumptions Checked
[Student Name]
University of Phoenix
DNP/701: Biostatistics and Epidemiology
Week 7 Assignment
[Instructor Name]
[Date]
The clinic and its figures are a composite written for a model paper.
Our rural clinic network began nurse telephone coaching for all patients with A1c above 8% in month 19 of a 36-month period. I have monthly data on the percentage of patients with diabetes whose most recent A1c was above 9%, our poor-control measure, for 18 months before and 18 months after the start. This paper describes my analysis in R, the methods chosen and the results.
Preparing the Data
Each row in the data set represents one month and includes the number of patients with diabetes who had an A1c in the prior 12 months, the number with A1c above 9%, a time variable from 1 to 36, an indicator for the post-intervention period and a variable counting months since the intervention began. I checked for missing months, confirmed denominators against source reports and plotted the raw data before any analysis.
Why a Control Chart
Benneyan (2003) describes statistical process control as a method that combines time series analysis with graphical display, distinguishing natural variation from special causes, and allows faster decisions than traditional methods that aggregate data over time. Points are plotted month by month around a central line, with boundaries set at a statistically defined distance on either side, and a set of rules flags patterns unlikely to arise from a stable process.
Building the P-Chart
Because each monthly value is a proportion with a varying denominator, the appropriate chart is a p-chart, in which control limits vary with each month's sample size. In R, I used the qcc package. For the first 18 months, the center line was 27.4%, and all points fell within the control limits, indicating a stable process. I then fixed those limits and plotted the post-intervention months against them.
P-Chart Findings
Beginning in month 22, points fell below the center line for 15 consecutive months, and two points in months 33 and 35 fell below the lower control limit. Both are special cause signals, indicating that the process changed after coaching began.
The control chart said the process changed; the segmented regression said by how much and how fast.
Why an Interrupted Time Series
Penfold and Zhang (2013) describe interrupted time series analysis as a strong quasi-experimental method for evaluating quality improvement, with advantages over simple before-after comparisons, including control of secular trends. They note that at least eight time points before and after an intervention are needed and warn that interventions implemented close together are hard to separate. Our 18 points on each side meet the requirement.
The Segmented Regression Model
Wagner et al. (2002) describe segmented regression for interrupted time series, which separates four quantities: where the series starts, how it was moving before the change, how far it jumps at the change point and how its direction shifts afterward. In R, I fit a linear model with the poor-control percentage as the outcome and three predictors: time, the post-intervention indicator and months since intervention.
Regression Results
The baseline trend was essentially flat, with a slope of 0.05 percentage points per month, p = .62. The immediate change in level after coaching began was a drop of 1.1 points, p = .21, not clearly different from zero. The change in slope was minus 0.28 points per month, p < .001. By month 36, the model estimates that poor control was about 6.1 percentage points lower than it would have been had the baseline trend continued.
Interpreting the Pattern
The result, little immediate change but a steady decline afterward, fits how coaching would be expected to work: patients enroll gradually, and A1c changes over months. Wagner et al. (2002) note that separating level from trend changes is one of the design's strengths.
Checking Assumptions
Monthly data are often autocorrelated, meaning each month resembles the last. I tested residuals with the Durbin-Watson test, which showed mild autocorrelation. Refitting with generalized least squares with a first-order autoregressive error structure produced similar estimates, with the slope change remaining significant. Residuals were approximately normal and showed no seasonal pattern.
Why Not a Simple Before-After Test
Comparing the average of the 18 months before with the 18 months after would give a difference of about 3.6 points and a small p value. But this comparison ignores trends, cannot distinguish an immediate drop from a gradual one and treats the months as independent. The time series approach answers the question our director actually cares about: did the direction of change shift after coaching began?
Choosing the Chart Rules
I used the Western Electric rules built into the software, such as any single month outside a limit or a long unbroken run of months below the center. Using many rules at once raises the risk of false signals, so I specified these rules before plotting the post-intervention data.
Sensitivity Analysis
I refit the model excluding the first three months after coaching began, when enrollment was still ramping up. The slope change was similar, so the finding holds whether or not the ramp-up months are included.
Threats to Validity
The design controls for existing trends but not for other changes at the same time. During the same period, our clinic added a part-time pharmacist in month 24. That change might contribute to the continued decline. Penfold and Zhang (2013) recommend a comparison series when possible; a neighboring clinic network without coaching could serve that role.
Why Proportions, Not Counts
The number of patients with diabetes grew from 480 to 540 over three years. Plotting counts of poorly controlled patients would mix changes in control with changes in panel size. Using proportions with their own denominators, and a p-chart that adjusts limits for each month's size, keeps the measure comparable across time.
Reproducibility
I saved the R script with comments explaining each step, the package versions used and the data dictionary, so another analyst could reproduce the analysis.
Stratified Series
Running separate p-charts for each of the three sites showed that the decline began at all three, which argues against a single-site event explaining the change. The site with the pharmacist addition showed a slightly steeper decline after month 24, consistent with a modest added effect from that change.
Reporting the Findings
For the quality committee, I will present the p-chart and a plot of the observed data with fitted segments and the counterfactual line. I will report estimates with confidence intervals and the note about the pharmacist.
Conclusion
A p-chart showed a stable process before coaching and special cause signals afterward. Segmented regression estimated no immediate drop but a significant downward change in trend, about 6 points lower poor control by month 36 than projected. Assumptions were checked and autocorrelation addressed. The design strengthens the case that coaching contributed, while a concurrent pharmacist addition remains a possible alternative explanation.
References
Benneyan, J. C. (2003). Statistical process control as a tool for research and healthcare improvement. Quality and Safety in Health Care, 12(6), 458-464. https://doi.org/10.1136/qhc.12.6.458
Penfold, R. B., & Zhang, F. (2013). Use of interrupted time series analysis in evaluating health care quality improvements. Academic Pediatrics, 13(6 Suppl.), S38-S44. https://doi.org/10.1016/j.acap.2013.08.002
Wagner, A. K., Soumerai, S. B., Zhang, F., & Ross-Degnan, D. (2002). Segmented regression analysis of interrupted time series studies in medication use research. Journal of Clinical Pharmacy and Therapeutics, 27(4), 299-309. https://doi.org/10.1046/j.1365-2710.2002.00430.x
How this DNP 701 Week 7 example is structured
The DNP/701 Week 7 work usually applies statistical analysis to a practice data set with software. This paper chooses methods suited to monthly quality data, explains each analytic step and its output and reports what the results support. Students search this week as DNP 701 Week 7, DNP701 Wk 7 or DNP/701 Wk 7; all three are the same assignment.
DNP/701 Week 7 questions, answered
What does DNP/701 Week 7 usually ask for?
Many sections ask students to analyze a practice data set with statistical software, choosing appropriate methods, running the analysis and interpreting the output.
What is an interrupted time series?
A design that analyzes an outcome measured repeatedly before and after an intervention, estimating changes in level and trend; at least eight time points before and after are generally recommended.
What is a control chart?
A time-ordered chart with a center line and statistically calculated control limits that helps distinguish common cause variation, inherent in a stable process, from special cause variation that signals a change.
Write yours, or have the desk draft it
This paper is an original model document written by our desk, not a submitted student paper and not an official University of Phoenix document. Read it for the moves, then write your own to the instructions in your classroom. If you want one built to your exact prompt and rubric, the first custom sample is free and arrives in 24 to 48 hours.