Description Usage Arguments Details Author(s) Examples
This function visualizes the NIRS time series data and estimates the underlying smoothed trend of the NRIS based on a nonparametric regression approach.
1 | plotNIRS(Yvec,timevec,transfusionvec)
|
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. |
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.
Yikai Wang [Emory], Xiao Wang [ICF]
Maintainer: Yikai Wang johnzon.wyk@gmail.com
1 2 3 4 5 6 7 8 9 | # 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)
|
Loading required package: ggplot2
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-33. For overview type 'help("mgcv-package")'.
Loading required package: gridExtra
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
Warning messages:
1: Removed 3 rows containing non-finite values (stat_smooth).
2: Removed 3 rows containing missing values (geom_point).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.