plot.Maf: Plot maf object

Description Usage Arguments Details Value Examples

View source: R/maf.R

Description

This function will plot the first few mafs in the dataset overlaid with a smooth version of the same maf and, if desired, confidence intervals. Additionally, an estimate of the number of mafs will be printed.

Usage

1
2
3
plot.Maf(maf.obj, smooth.span = 30, cexVal = 1.5,
  which.maf = c(1:min(dim(maf.obj$x)[2], 3)), with.uncertainty = TRUE,
  B = 100, alpha = 0.05, block.size = 5)

Arguments

cexVal

The size of the labels in the plot

B

Number of replications in the confidence interval calculations

alpha

The significance level

block.size

The block size of the resampled residuals, i.e. the number of contiguous time steps to sample at the time from the set of residuals.

maf.object

The output of the maf function.

smoothSpan

Fraction between 0-1 that specifies the proportion of timesteps to include in the smoothing window, which is weighted by a tricubic. See ?loess for details. Alternatively, one can specify an integer greater than 1 which refers to the number of time points to include in the tricubic filter.

nmaf

The number of MAFs to plot

with.wncertainty

A logical specifying whether to plot the confidence interval around each maf.

Details

The confidence intervals are obtained using a resampling scheme which extracts the residuals of the original time series after smoothing with the same filter as the one parametrized by smoothSpan. The residuals are bootstrapped or block bootstrapped (if there is temporal structure in the residuals) and added back to the smooth, creating a new data set. From the new data set a new set of MAFs are calculated.

The smoothing parameter smooth.span is also used when calculating the empirical Signal-to-Noise ratio. Where we subtract the smooth from the time series and calculate the variance of the smooth estimate over the residual variance. This gives an empirical signal-to-noise estimate.

Value

A plot of the MAFs and a list containing

statStar

Empirical SNR for each resampled MAF time series, i.e. a p x B matrix where p is the total number of predictors and B is the number of bootstraps/replications

statObs

The empirical SNR of the original MAF time series.

pval

The p-values of each MAF, where the p-value refers to the number of resampled MAFs that have a higher empirical SNR than the original MAFs. If there are less than α, e.g. 0.05, resampled MAFs that have a higher empirical SNR than the original MAF, the MAF in question is not significant.

Examples

1
2
3
4
5
# Extract mafs from dataset
maf.object = maf(treeringTimeseries)
# Plot the first 6 mafs with undertainty estimates and estimate number of 
# significant mafs contained in the dataset
plot(maf.object) 

matzhaugen/maf documentation built on May 21, 2019, 1:36 p.m.