Pchart {SSDforR} | R Documentation |
SPC P-chart
Description
This function builds a P-chart and can be used when the target behavior has a binary outcome. This chart allows for a comparison of the proportion of tasks completed over time or between phases. A space separates each phase.
Usage
Pchart(behavior, groupX, bandX, ABxlab, ABylab, ABmain)
Arguments
behavior |
behavior variable |
groupX |
grouping variable |
bandX |
number of standard deviations desired (e.g., 2) |
ABxlab |
label for x-axis between quotation marks (e.g., "weeks") |
ABylab |
label for y-axis between quotation marks (e.g., "attendance"") |
ABmain |
main title for chart between quotation marks (e.g., "Attendance Over Time") |
Author(s)
Charles Auerbach, PhD Wurzweiler School of Social Work Wendy Zeitlin, PhD Montclair State University
References
Auerbach, Charles, and Zeitlin Wendy. SSD for R: An R Package for Analyzing Single-Subject Data. Oxford University Press, 2014. p75, p139-140
Orme, J. & Cox, M.E. (2001). Analyzing single-subject design data using statistical proces control charts. Social Work Research, 25(2), 115-127.
Go to www.ssdanalysis.com for more information.
Examples
attend<-c(0,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,0,0,0,0,1,1,0,0,1,NA,
0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,1,1,0,0,1,1,0,1,0,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)
day<-c(1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,NA,6,6,
6,6,6,7,7,7,7,7,
8,8,8,8,8,9,9,9,9,9,10,10,10,10,10,11,11,11,11,
11,12,12,12,12,12,13,
13,13,13,13,14,14,14,14,14,15,15,15,15,15)
Pchart(attend, day, 2, "week", "amount", "Group attendance")