Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: RE: postfile, using variable name not value or label
From
"Martin Weiss" <[email protected]>
To
<[email protected]>
Subject
st: RE: postfile, using variable name not value or label
Date
Mon, 26 Apr 2010 19:47:49 +0200
<>
Why not -update- to 10.1, btw? Still:
*******
sysuse auto, clear
tempname hdle
postfile `hdle' str15 var mean using info.dta, replace
qui foreach var of varlist rep78 length weight{
su `var', mean
post `hdle' ("`var'") (r(mean))
}
postclose `hdle'
u info, clear
l, abbrev(12) noobs sep(0)
*******
HTH
Martin
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Karen Wright
Sent: Montag, 26. April 2010 19:37
To: [email protected]
Subject: st: postfile, using variable name not value or label
Dear All,
I am using Stata 10.0 and have written the following code.
**************
foreach j in 1000 750 500 400 300 250 200 150 {
use "E:\Small Clusters Paper\INIS datasets\INIS.0.04.`j'.dta", clear
foreach var of varlist b24age_lm_coef-n24delay_2_lm_coef {
summ `var', det
post INIS_coef (4) (`j') (`var') (r(mean)) (r(p5)) (r(p95))
}
}
****************
However I was wondering how I would be able to -post- the name of the
variable in question rather than the value of the variable? I have
searched the FAQ and archive but have not found how to post the variable
name and not the label.
Thank you,
Karen
The Institute of Cancer Research: Royal Cancer Hospital, a charitable
Company Limited by Guarantee, Registered in England under Company No. 534147
with its Registered Office at 123 Old Brompton Road, London SW7 3RP.
This e-mail message is confidential and for use by the addressee only. If
the message is received by anyone other than the addressee, please return
the message to the sender by replying to it and then delete the message from
your computer and network.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/