Pchart: SPC P-chart

Description Usage Arguments Author(s) References Examples

View source: R/Pchart.R

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

1
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 & Wendy Zeitlin, PhD; Yeshiva University, Wurzweiler School of Social Work

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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")

SSDforR documentation built on Oct. 7, 2018, 1:03 a.m.