Learn R Programming

sparsereg (version 1.0)

volcanoplot: Function for plotting posterior distribution of effects of interest.

Description

The function produces a volcano plot for specified effects. This can be useful for presenting or examining particular marginal effects of interest.

Usage

volcanoplot(x, columns=NULL, newlabels=NULL, type="mode", stage=NULL)

Arguments

x
Object of class sparsereg.
columns
A vector of numbers (or strings) corresponding to columns (or column names) to produce plots for.
newlabels
New labels for columns rather than variable names in object. If empty, variable names are used.
type
Options are "mode" and "mean". Whether to plot the posterior mode or mean.
stage
When plotting output from a sparsereg object, the argument is ignored. When plotting output from a type 2 tobit, whether to return stage 1 or stage 2 results.

Details

Generates a volcano plot for coefficients from object from class sparsereg. The desired coefficients can be requested using the columns argument and they can be assigned new names through newlabels.

References

Ratkovic, Marc and Tingley, Dustin. 2015. "Sparse Estimation with Uncertainty: Subgroup Analysis in Large Dimensional Design." Working paper.

See Also

sparsereg, plot.sparsereg, summary.sparsereg, difference, print.sparsereg

Examples

Run this code
set.seed(1)
 n<-500
 k<-100
 Sigma<-diag(k)
 Sigma[Sigma==0]<-.5
 X<-mvrnorm(n,mu=rep(0,k),Sigma=Sigma)
 y.true<-3+X[,2]*2+X[,3]*(-3)
 y<-y.true+rnorm(n)



##Fit a linear model with five covariates.
 s1<-sparsereg(y,X[,1:5])
 volcanoplot(s1,1:3)

Run the code above in your browser using DataLab