Learn R Programming

sparsereg (version 1.0)

summary.sparsereg: Summaries for a sparse regression.

Description

The function prints and returns a summary table for a sparsereg object.

Usage

## S3 method for class 'sparsereg':
summary(object,... )

Arguments

object
Object of type sparsereg.
...
Additional items to pass to summary. Options below.

Details

Generates a table for an object of class sparsereg. Additional arguments to pass summary below. interval{ Length of posterior interval to return. Must be between 0 and 1, default is .9. The symmetric interval is returned. } ci{ Type of interval to return. Options are "quantile" (default) for quantiles and "HPD" for the highest posterior density interval. } order{ How to order returned coefficients. Options are "magnitude", sorted by magnitude and omitting zero effects, "sort", sorted by size from highest to lowest and omitting zero effects, and "none" which returns all effects } normal{ Whether to return the normal approximate confidence interval (default of TRUE) or posterior interval (FALSE). } select{ Either "mode" or a number between 0 and 1. Whether to select variables for printing off the median of the mode (default) or off the probability of being non-zero. } printit{ Whether to print a summary table.}

stage{ When summarizing output from a sparsereg object, the argument is ignored. When summarizing output from a type 2 tobit, whether to return stage 1 or stage 2 results. }

References

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

See Also

sparsereg, plot.sparsereg, volcanoplot, 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])
 summary(s1)

Run the code above in your browser using DataLab