Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# RE: st: saving the confidence interval as a scalar

 From "Monuteaux, Michael" To "statalist@hsphsun2.harvard.edu" Subject RE: st: saving the confidence interval as a scalar Date Fri, 29 Jul 2011 08:41:41 -0400

```Thank you, Julian!

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Julian Reif
Sent: Friday, July 29, 2011 7:55 AM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: saving the confidence interval as a scalar

Michael, you can also use -regsave- to save confidence intervals to a dataset. You can install -regsave- with the command -ssc install regsave, replace-

*****************************************
sysuse auto, clear
svyset rep78 [pw = turn]
svy, subpop(if foreign==0): total trunk
regsave, ci
list
******************************************

Julian

On Jul 29, 2011, at 1:33 AM, statalist-digest wrote:

> Date: Thu, 28 Jul 2011 17:56:02 -0400
> From: Steven Samuels <sjsamuels@gmail.com>
> Subject: Re: st: saving the confidence interval as a scalar
>
> Michael, try the following:
>
> *****************************************
> sysuse auto, clear
> svyset rep78 [pw = turn]
> svy, subpop(if foreign==0): total trunk
> matrix b = e(b)
> scalar tot = b[1,1]
> matrix v=e(V)
> scalar v =v[1,1]
> scalar bound =  ///
> sqrt(v)*invttail(e(df_r),0.5*(1-c(level)/100))
> scalar  ll = tot-bound
> scalar  ul = tot + bound
> di  c(level) "% Confidence Interval" _newline ///
> "Estimate: " %8.0fc  tot ///
> " ["%7.0fc  ll "," %8.0fc  ul "]"
> ******************************************
>
> On Jul 28, 2011, at 12:12 PM, Monuteaux, Michael wrote:
>
> Hello everyone,
>
> I am estimating various parameters using a survey dataset.  I am running the following command:
> I am able to save the point estimate as a scalar using the saved matrix, e(b).  But, I would like to also save the upper and lower confidence interval bounds as scalars, as well.  Is it possible to access these values as scalars or a matrix?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```