Resampling Procedure:
- Standard deviation (SD) is computed for PA and NA observations from a dense sampling period (DSP).
- PA and NA observations are removed in in a loop. One response is removed with each iteration.
- Note: data is not residualized before observations are removed
- SD is computed for each iteration.
- 10 permutations of this process are performed for each DSP. SD values are then averaged across all permutations.
- Mean SD values for each number of responses are stored for all subjects.
Curve-fitting to find breakpoints
- The curves displayed below are approximated from the resampling procedure. A third degree polynomial function is fit to the SD values at each number of responses to approximate the change point (i.e., breakpoint).
# Plot PA curve
PA.gg <- ggplot(data = Data, aes(x = PA_x1, y = PA_y1))+
geom_line(size = 0.8)+
xlab("Number of Responses")+
ylab("Standard Deviation (SD) of PA time series")+
ggtitle("Standard Deviation of PA Time Series \n by Number of Responses")+
theme_grey()+
theme(plot.title = element_text(hjust = 0.5))
print(PA.gg)

For the curve fit to PA SD values, there is a notable breakpoint at approximately 5 responses.
# Plot NA curve
NA.gg <- ggplot(data = Data, aes(x = NA_x1, y = NA_y1))+
geom_line(size = 0.8)+
xlab("Number of Responses")+
ylab("Standard Deviation (SD) of NA time series")+
ggtitle("Standard Deviation of NA Time Series \n by Number of Responses")+
theme_grey()+
theme(plot.title = element_text(hjust = 0.5))
print(NA.gg)

For the curve fit to NA SD values, there is no distinct breakpoint.