Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: postfile and post using a large number of items

From   Lee Sieswerda <>
To   "''" <>
Subject   st: RE: postfile and post using a large number of items
Date   Wed, 11 Jun 2003 17:57:47 -0400

This is perhaps an oblique answer to your question. One solution to
extracting what you want from a matrix is to cycle through the matrix using
a -forvalues- loop and matrix subscripting, storing the results as macros,
and posting them as you go. Silly example with auto data:

...first set up tempfile, tempname, postfile, etc....
svyset [weight=weight]
svytab rep78 foreign, se

matrix myV = e(V)
matrix myb = e(b)

* The number of columns in the matrix will equal 
* the number of cells in the table
local n = colsof(myb)

forvalues x = 1/`n' {
	local df = e(df_r)
	local N = e(N)
	local se = sqrt(myV[`x',`x'])
	local est = myb[1,`x']

	post blah blah blah

This example produces a dataset with all of the proportions and standard
errors from the -svytab- table.


Lee Sieswerda, Epidemiologist
Thunder Bay District Health Unit

-----Original Message-----
From: Smith, David W. [] 
Sent: Wednesday, June 11, 2003 4:23 PM
To: ''
Subject: st: postfile and post using a large number of items

I would like to use postfile and post with a large number of items, such as
the rates and covariance matrix after svytab.  Is it possible to specify the
items as vectors in order to save space and reduce errors?



David W. Smith, Ph.D., M.P.H.
Associate Professor, Biometry

The University of Texas
Health Science Center at Houston
School of Public Health
San Antonio Regional Campus
e-mail at Houston:
e-mail at San Antonio:

*   For searches and help try:
*   For searches and help try:

© Copyright 1996–2019 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index