Statalist


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

Re: st: RE: How to use Postfile without using a new Stata dataset


From   n j cox <n.j.cox@durham.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: How to use Postfile without using a new Stata dataset
Date   Thu, 04 Oct 2007 19:34:21 +0100

Jeph Herrin and Austin Nichols between them came up with what looks
like a good solution:

------------------------------
clear
input a b c study p
26 85 41 1 0.056
12 56 23 2 0.862
45 85 96 3 0.996
45 86 91 4 0.005
end
g double pvalue=.
local number = _N
forv i = 1/`number' {
 qui genhwi `=a[`i']' `=b[`i']' `=c[`i']'
 qui replace pvalue = r(p_exact) in `i'
}
li
--------------------------------

The FAQ

How do I accumulate the results of immediate commands?
http://www.stata.com/support/faqs/data/results.html

covers some related ideas.

Nick
n.j.cox@durham.ac.uk
*
*   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