Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: saving the confidence interval as a scalar

From   "Monuteaux, Michael" <>
To   "" <>
Subject   RE: st: saving the confidence interval as a scalar
Date   Fri, 29 Jul 2011 09:03:15 -0400

Steven, this is perfect, thanks so much!

-----Original Message-----
From: [] On Behalf Of Steven Samuels
Sent: Thursday, July 28, 2011 5:56 PM
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 =  ///
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:
	svy: total myvar, subpop(adults)
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:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index