kr1010
kr1010

Reputation: 27

Extracting mean, sd and confidence interval from a command

I am using Stata to conduct survey analysis and I am running the command:

quietly svy: mean consumption

I need to extract the results and put them in a matrix.

How do I extract the mean, sd and confidence intervals?

I believe for the mean we can run:

matrix[1,2] = e(b)

Upvotes: 0

Views: 225

Answers (1)

user8682794
user8682794

Reputation:

The following works for me:

webuse nhanes2f
svyset psuid [pweight=finalwgt], strata(stratid)
quietly svy: mean zinc

return list

scalars:
              r(level) =  95

macros:
           r(mcmethod) : "noadjust"

matrices:
              r(table) :  9 x 1

matrix list r(table)

r(table)[9,1]
             zinc
     b  87.182067
    se  .49448269
     t  176.30965
pvalue  4.244e-48
    ll  86.173563
    ul  88.190571
    df         31
  crit  2.0395134
 eform          0

Upvotes: 1

Related Questions