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]
RE: st: RE: Nonlinear least squares restrictions
From
Haluk Vahaboglu <[email protected]>
To
"[email protected]" <[email protected]>
Subject
RE: st: RE: Nonlinear least squares restrictions
Date
Thu, 6 Jun 2013 09:00:31 +0000
TD P { margin-bottom: 0in; }P { margin-bottom: 0.08in; }
Hello Everybody,
In our research papers we
mostly present continuous data in a table with comparison to cases vs
controls as “n mean SD and p (from Ttest)”. Here is a brief
example of such a table:
Cases / Controls
N mean (SD) N mean (SD) p
Var1
Var2
With STATA I use these
commands
1. “estpost tabstat age
VAR1 VAR2, by(C/C) s(n mean sd) c(s)”
2. “esttab ., main(mean)
aux(sd) unstack noobs nonote wide compress label”
3. “estpost ttest age
VAR1 VAR2, by(C/C) une w”
4. “esttab ., cell("p
(fmt(3))")”
and get two separate
tables; “n mean SD” in one and “p” in the other. I, afterwards merge these two (in an Exel spreadsheet) as a table formatted as mentioned above.
Is there any simple way to
get a table with "n-mean-SD-p" all in one line for multiple continuous
variables?
TD P { margin-bottom: 0in; }P { margin-bottom: 0.08in; }
Prof. Dr. Haluk Vahaboğlu
Istanbul Medeniyet
Üniversitesi,
Göztepe Eğitim ve Araştırma Hastanesi
Enfeksiyon Hastalıkları
ve Klinik Mikrobiyoloji ABD
Dr. Erkin Caddesi 34730
Kadıköy / Istanbul TURKIYE
----------------------------------------
> Date: Thu, 6 Jun 2013 09:29:28 +0100
> From: [email protected]
> To: [email protected]
> Subject: Re: st: RE: Nonlinear least squares restrictions
>
> Hi Tim,
>
> Thanks a lot for getting back to me. Unfortunately I'm not sure standard
> OLS will work here- I want to constrain the relative responses in the
> vector B to be constant over time- and the estimate both the dummy scalar b
> (for each year) and the vector B.
>
> Will give the stuff on dummy variables a read - looks like it could prove
> useful.
>
> Many thanks,
>
> Gareth
>
>
> On Jun 6 2013, tshmak wrote:
>
>>Hi Gareth,
>>
>> I think this is a linear regression rather than a nonlinear regression
>> problem.
>>
>>Naively, we can just create a variable called year, run:
>>
>>reg y i.year##X, nocons
>>
>>This would result in a different intercept and slope for each year.
>>
>> To make the average of b = 1, simply divide the year-specific slopes by
>> the average of the slopes, the average being your estimate of B.
>>
>> The only problem of this approach is that your slopes across years would
>> not meet at the boundary. To constraint the slopes to meet, you need to
>> use splines. The best place to start is probably Roger Newson's -bspline-
>> package. Dr. Newson has also written a few informative articles
>> explaining their use in Stata Journal.
>>
>>HTH,
>>Tim
>>
>> ps. I think the reason -nl- fails on this problem is that the problem is
>> not identified unless you can somehow constraint the b to average 1, and
>> I'm not sure you can do that in -nl-.
>>
>>
>>
>> -----Original Message----- From: [email protected]
>> [mailto:[email protected]] On Behalf Of G. Anderson
>> Sent: 05 June 2013 19:24 To: [email protected] Subject: st:
>> Nonlinear least squares restrictions
>>
>>Hi,
>>
>>Using daily data, I am trying to estimate a relationship of the form y=a
>>+bBX +u
>>
>>Where a is a scalar which can vary across years, b is a scalar which can
>>vary across years, X is a vector of data and B is a vector of parameters
>>which is fixed across years.
>>
>> Therefore I am trying to estimate a, b and B. I want to normalise b so
>> that on average it is equal to 1 across years.
>>
>>I have tried experimenting using the nonlinear regression function but so
>>far to no avail- is this type of restriction possible in Stata?
>>
>>Many Thanks,
>>
>>Gareth
>>
>>*
>>* 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/
>>
>>*
>>* 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/
>>
> *
> * 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/
*
* 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/