Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Postfile question

From   "Poon, Kwun Yee" <>
Subject   st: Postfile question
Date   Wed, 28 Feb 2007 15:25:33 -0800

Dear list, 

I have a question on postfile syntax.  Using the following syntax, I was
expecting vari_name to store var1, var2, etc.  However, when I open the
result.dta, the values stored in vari_name is the values stores in var1,

Can someone help me solve this mystery?




set more off
tempname sim
postfile `sim' str15 vari_name chistat using result, replace
use "inputdata.dta", replace

quietly {
    foreach var of varlist var1-var10 {
      capture tabul gender `var', chi2
      scalar chitest = r(chi2)
    *Writing to external file
      post `sim' (`var') (chitest)
     scalar drop _all
postclose `sim'

*   For searches and help try:

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