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 <Lee.Sieswerda@tbdhu.com>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
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.

Regards,
Lee

Lee Sieswerda, Epidemiologist
Thunder Bay District Health Unit
Lee.Sieswerda@tbdhu.com



-----Original Message-----
From: Smith, David W. [mailto:SmithD2@uthscsa.edu] 
Sent: Wednesday, June 11, 2003 4:23 PM
To: 'statalist@hsphsun2.harvard.edu'
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?

Thanks,

David


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: david.w.smith@uth.tmc.edu
e-mail at San Antonio: smithd2@uthscsa.edu

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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