RAR_Bands_plot: RAR_Bands_plot

View source: R/RAR_Bands_plot.r

RAR_Bands_plotR Documentation

RAR_Bands_plot

Description

Estimates the effect of variability of residuals estimated from extended cosine model based on specific frequency bands.

Usage

RAR_Bands_plot(rar_object, freq.bands, sampling.rate = (1/60),
  id_vals = NULL)

Arguments

rar_object

default output from RAR().

freq.bands

a matrix of frequency bands, e.g. (t(c(0, 2/24))), ranging between 0 and 60.

sampling.rate

the number of observations per second. Default is 1/60 for 60-second activity epochs.

id_vals

character vector to print plots for each participant specified. Default is NULL.

Author(s)

Jessica Graves

Examples

data(age_wise)
d <- age_wise[age_wise$id==1,]
rar_ex <- RAR(d, act, date_time, "antilogit")
bands <- RAR_Bands_plot(rar_ex, t(c(0, 2/24)))
bands$plots # effect of filter

# Multiple bands
f1 <- c(0, 2/24); f2 <- c(2/24, 25); f3 <- c(25, 60)
fs = as.data.frame(rbind(f1, f2, f3))
bands_m <- RAR_Bands_plot(rar_ex, fs)
bands_m$plots[[1]] # effect of filter 1

# Multiple subjects, multiple bands
d4 <- age_wise[age_wise$id %in% c(1:4), ]
rar_ex4 <- RAR(d4, act, date_time, id_column=id)
bands_m.4 <- RAR_Bands_plot(rar_ex4, fs, id_vals=c("1", "2"))
bands_m.4$plots[[1]] # effect of filter from 0, 2/24 (filter [[1]])
bands_m.4$plots[[2]] # effect of filter 2
bands_m.4$plots[[3]] # effect of filter 3

JessLGraves/RAR documentation built on April 5, 2025, 3:42 p.m.