NIRStat (version 1.0)

plotNIRS: NIRS Time Series Visualization

Description

This function visualizes the NIRS time series data and estimates the underlying smoothed trend of the NRIS based on a nonparametric regression approach.

Usage

plotNIRS(Yvec,timevec,transfusionvec)

Arguments

Yvec

The outcome of NIRS time series \(Y(t_{i})\) of length N ranging from 15 to 100.

timevec

The time index of NIRS time series \(t_{i}\) of length N.

transfusionvec

The 0/1 indicator of the transfusion status \(X(t_{i})\). \(X(t_{i})=0\) means the current time point is before transfusion and \(X(t_{i})=1\) means the current time point is after transfusion.

Details

This function visualizes the NIRS time series data before and after transfusion. In order to estimate the underlying smoothed curve, it first imputes the data with detection limit (DL) and utilizes a nonparametric regression approach for the imputed data. The time points with DL is in red and others are in black.

Examples

Run this code
# NOT RUN {
# Data Simulation
dat = data.frame(Y= rep(0,200),t=1:200,trans = c(rep(0,100),rep(1,100)))
dat$Y = apply(dat,1,function(x){rnorm(1,5*rnorm(1),6*exp(rnorm(1)))})
dat$Y = dat$Y + 15 - quantile(dat$Y,0.3) 
dat$Y[dat$Y<=15] = 15


# Visualize the NIRS time series before and after transfusion. 
plotNIRS(dat$Y,dat$t,dat$trans)
# }

Run the code above in your browser using DataLab