Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Nick Cox <njcoxstata@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Results to file problem |
Date | Thu, 6 Dec 2012 09:05:38 +0000 |
My guess: r(adj) contains a vector. You can't write a vector as if it were a scalar. You would need to do some pre-processing to split it into scalars. Nick On Thu, Dec 6, 2012 at 8:50 AM, arosella <arosella@irccsdebellis.it> wrote: > Hi All, > I'm using Stata 12.1 on W7 and trying to write a txt file > after the command -dstdize- > Here my code: > > webuse hbp > generate pop=1 > file open myfile1 using "E:\Alberto\tab_sep.txt", write replace > set more off > file write myfile1 "Tasa Cruda" _tab "Tasa Ajustada" /// > _tab "SE Tasa Ajus" _tab "LowerCI" /// > _tab "UpperCI" > dstdize hbp pop age race sex, by(city year) > file write myfile1 (r(crude)) /// > _tab (r(adj)) /// > _tab (r(se)) /// > _tab (r(lb)) /// > _tab (r(ub)) > > file close myfile1 > set more on > > And here the erro I get: > > . file write myfile1 (r(crude)) /// >> _tab (r(adj)) /// >> _tab (r(se)) /// >> _tab (r(lb)) /// >> _tab (r(ub)) > type mismatch > r(109); * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/