Bookmark and Share

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: Post-regression graph


From   David Torres <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: Post-regression graph
Date   Wed, 20 Nov 2013 22:14:56 -0500

Thanks, Jorge.

But please tell me why I can get a graph using that command even when I haven't run a regression model?  And the fitted line looks exactly the same as it does when I run the regression and then add the "if e(sample)"?  I'm terribly confused.

Also, is the restriction issue a problem if I want to graph a different line for different races/ethnic groups?

Thanks again,
Diego


----------------------------------------
> From: [email protected]
> Date: Wed, 20 Nov 2013 21:51:38 -0500
> Subject: Re: st: Post-regression graph
> To: [email protected]
>
> I think you want to use e(sample)
>
> For example, if you run a quadratic mode on a subsamplel:
>
> sysuse auto, clear
> gen mpg2=mpg*mpg
> reg price mpg mpg2 if foreign
>
> Then the graph of this model would be:
>
> twoway qfit price mpg if e(sample)
>
> You may restrict your graph to a smaller subsample with another
> condition, for example:
>
> twoway qfit price mpg if e(sample)&turn>5
>
> But this graph does not correspond to the model you estimated on the
> first place.
>
>
> --------------------------------------------
> Jorge Eduardo Pérez Pérez
> Graduate Student
> Department of Economics
> Brown University
>
>
> On Wed, Nov 20, 2013 at 9:22 PM, David Torres <[email protected]> wrote:
>> I'm trying to get a nonlinear regression line after estimating a model. The following is the command I'm using (and the error returned).
>>
>> . graph twoway qfit srsc year if `e(model)'&white==1
>> g2sls not found
>> r(111);
>>
>>
>> What specifically am I doing wrong here? If I drop the `e(model)' I can get a line, but I'm afraid it's not taking into account the actual model I want to graph.
>>
>> Thanks in advance,
>> Diego
>> *
>> * 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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index