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

st: postfile

From   "VISINTAINER PAUL" <[email protected]>
To   <[email protected]>
Subject   st: postfile
Date   Mon, 22 Nov 2004 09:35:26 -0500

In the following program, I write the output of several t-tests to a
file.  Is it possible to post the name of the variable being tested to
such a file?  When I include ("`var'"), I get the error below.  If I
post (`var'), I only get a number. 
tempname out
. postfile `out' variable case sd1 n1 control sd2 n2 using outfile,
. foreach var of varlist igf bp3 . . . etc . .{
. 2.   qui ttest `var', by(case)
  3.    post `out' ("`var'") (r(mu_2)) (r(sd_2)) (r(N_2)) (r(mu_1)) /*
              */ (r(sd_1)) (r(N_1)) 
  4. }
type mismatch
post:  above message corresponds to expression 1, variable variable

Any suggestions would be appreciated.

Paul F. Visintainer, PhD
Professor and Program Director 
Health Quantitative Sciences
School of Public Health
New York Medical College 

*   For searches and help try:

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