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

st: Re: generating a numlist / ipshin


From   Kit Baum <[email protected]>
To   [email protected]
Subject   st: Re: generating a numlist / ipshin
Date   Thu, 23 Oct 2003 10:09:26 -0400

On Thursday, Oct 23, 2003, at 02:33 US/Eastern, statalist-digest wrote:

foreach k of varlist netprem disclm elr solv {
preserve
keep if variable=="`k'"
forvalues x=1/19{
sum lagrawnotrend if comcode==`x', mean
scalar A`x'=r(mean)
}

levinlin `k', lags(`A1' `A2' `A3' `A4' `A5' `A6' `A7' `A8' `A9' `A10' `A11' `A12' `A13' `A14' `A15' `A16' `A17' `A18' `A19')
restore
}

Many thanks

Dev
Others have made useful comments on this issue, but I would point out that the best way of generating a numlist (without so much typing) would be something like

webuse auto,clear
local list
forv i=1/5 {
summ price if rep78==`i',meanonly
local mu = int(r(mean))
local list "`list' `mu'"
}
di "`list'"


In re ipshin (as a coauthor of that routine) if you run the first example in the help file and then do:

. return list

scalars:
r(pval) = .9999988489391395
r(psi) = 4.724914519654275
r(cv1) = -2.18
r(cv5) = -1.99
r(cv10) = -1.88
r(tbar) = -.0703609499728209
r(T) = 26
r(N) = 10
r(nobs) = 23

macros:
r(determ) : "constant"
r(lags) : "2"
r(depvar) : "rgdppc"

You will see what is being returned by the routine.

Kit

*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index