Learn R Programming

SSDforR (version 1.0)

Pchart: SPC P-chart

Description

When the target behavior has a binary outcome (i.e., completing or not completing a task), comparing the proportion of tasks completed over time or between phases can be measured. Attendance (vs. non-attendance) in a group, child welfare workers completing records on time (vs. not completing on time), workers completing home visits (vs. not completing home visits), if a patient is compliant with medication (vs. non-compliant), or if a patient with hearing loss wears his or her hearing aid (vs. not hearing the hearing aid) are all possible examples of task completion that can be assessed using p-charts.

Usage

Pchart(behavior, groupX, bandX, ABxlab, ABylab, ABmain)

Arguments

behavior
behavior variable
groupX
grouping variable
bandX
number of standard deviations 1 2 or 3
ABxlab
x label
ABylab
y label
ABmain
main title

References

go to www.ssdanalysis.com for more info

Examples

Run this code
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")

Run the code above in your browser using DataLab