Last data update: 2014.03.03

R: A function for plotting of an object of class simrel as...
simrelplotR Documentation

A function for plotting of an object of class simrel as output from a call to simrel().

Description

The plotting function produces three plots: 1) A barplot of the true regression coefficents in the linear regression model. 2) Scree-plot of true eigenvalues (barplot) with true covariances (absolute values) between components and response overlayed (red dots). The covariances are scaled by the largest covariance (in absolute value). 3) Scree-plot of eigenvalues estimated from the simulated data (barplot) with estimated covariances (absolute values) between components and simulated response overlayed (red dots). The estimated covariances are scaled by the largest estimated covariance (in absolute value).

Usage

  simrelplot(obj, ncomp = min(obj$p, obj$n, 20), ask = FALSE, print.cov=FALSE)

Arguments

obj

A simrel object. Output of call from function simrel().

ncomp

The number of desired components to plot.

ask

Logical; if TRUE, the user is asked before displaying each plot separately, see par(ask=.).

print.cov

Logical; if TRUE, then the absolute values of the estimated covariances between the latent components and the response are printed (non-scaled).

Details

A plot of true eigenvalues of the covariance matrix with covariances between principal components and the response overlayed (plot number 2) displays important properties of the predictor variables and their relevance to the response variable. This is discussed in S<c3><a6>b<c3><b8> et al. (2015). The relevant components (indexed by obj$relpos) have non-zero covariances with the response. The size of the eigenvalues (variances) of the relevant components is tightly connected to the performance of predictors. As discussed in Helland and Alm<c3><b8>y (1994) prediction is relatively easy if the relevant components also have large variances, whereas the opposite is typically the case if the relevant components have small variances (eigenvalues). A corresponding plot of eigenvalues and covariances estimated from the simulated data (plot number 3) is included for comparison. This kind of plot may in a real data setting give information about the number of relevant components and their positions (when ordered according to declining eigenvalues).

Author(s)

Solve S<c3><a6>b<c3><b8>

References

Helland, I. S. and Alm<c3><b8>y, T., 1994, Comparison of prediction methods when only a few components are relevant, J. Amer. Statist. Ass., 89(426), 583 – 591.

S<c3><a6>b<c3><b8>, S., Alm<c3><b8>y, T. and Helland, I. S., (2015), A versatile method for linear model data simulation based on the concept of a relevant subspace and relevant predictors, (submitted).

Examples

mydata <- simrel(n=250, p=20, m=2, q=5, relpos=c(2,4), gamma=0.25, R2=0.75 )
simrelplot(mydata)

Results