Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: RE: Nonlinear least squares restrictions


From   Haluk Vahaboglu <vahabo@hotmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
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: ga274@cam.ac.uk
> To: statalist@hsphsun2.harvard.edu
> 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: owner-statalist@hsphsun2.harvard.edu
>> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of G. Anderson
>> Sent: 05 June 2013 19:24 To: statalist@hsphsun2.harvard.edu 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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index