From | "Michael Blasnik" <[email protected]> |
To | <[email protected]> |
Subject | st: Re: nl error |
Date | Tue, 11 Oct 2005 11:29:47 -0400 |
Dear all,
I’ve been having trouble with the nl command in stata. I’m trying to estimate the following function
Crh= b0 + b1*triwk + b2*(max(triwk-k1,0))
The code is given below
gen trisp1=max(triwk -14, 0)
regress crh triwk trisp1
global b0= _b[_cons]
global b1= _b[triwk ]
global b2= _b[trisp1]
capture program drop nlspline
program define nlspline
version 8.2
if "`1' " == "?" {
global S_1 "b0 b1 b2 k1"
global b0= $b0
global b1= $b1
global b2= $b2
global k1=14
exit
}
replace `1' = $b0 + $b1*triwk + $b2*(max(triwk-$k1,0))
end
nl spline crh
When I run the code I get the error:
variable ? not found
nlsplinec refused query, rc=111
<snip>
Thank you for your help.
Leny
* * 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 |